]> git.bitcoin.ninja Git - ldk-c-bindings/blobdiff - lightning-c-bindings/include/lightning.h
Add missing `rustc` `metadata` override for `lightning_types`
[ldk-c-bindings] / lightning-c-bindings / include / lightning.h
index 30fd57705794befbe202a10fe2c0cb9d0375df7d..9076f1a904b65d219ba0e2100e9808e4f8b89566 100644 (file)
 #include <stdint.h>
 #include "ldk_rust_types.h"
 
+/**
+ * Indicates whether the balance is derived from a cooperative close, a force-close
+ * (for holder or counterparty), or whether it is for an HTLC.
+ */
+typedef enum LDKBalanceSource {
+   /**
+    * The channel was force closed by the holder.
+    */
+   LDKBalanceSource_HolderForceClosed,
+   /**
+    * The channel was force closed by the counterparty.
+    */
+   LDKBalanceSource_CounterpartyForceClosed,
+   /**
+    * The channel was cooperatively closed.
+    */
+   LDKBalanceSource_CoopClose,
+   /**
+    * This balance is the result of an HTLC.
+    */
+   LDKBalanceSource_Htlc,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKBalanceSource_Sentinel,
+} LDKBalanceSource;
+
 /**
  * Whether this blinded HTLC is being failed backwards by the introduction node or a blinded node,
  * which determines the failure message that should be used.
@@ -195,6 +222,10 @@ typedef enum LDKBolt12SemanticError {
     * An invoice payment hash was expected but was missing.
     */
    LDKBolt12SemanticError_MissingPaymentHash,
+   /**
+    * An invoice payment hash was provided but was not expected.
+    */
+   LDKBolt12SemanticError_UnexpectedPaymentHash,
    /**
     * A signature was expected but was missing.
     */
@@ -344,13 +375,23 @@ typedef enum LDKChannelShutdownState {
  * estimation.
  */
 typedef enum LDKConfirmationTarget {
+   /**
+    * The most aggressive (i.e. highest) feerate estimate available.
+    *
+    * This is used to sanity-check our counterparty's feerates and should be as conservative as
+    * possible to ensure that we don't confuse a peer using a very conservative estimator for one
+    * trying to burn channel balance to dust.
+    */
+   LDKConfirmationTarget_MaximumFeeEstimate,
    /**
     * We have some funds available on chain which we need to spend prior to some expiry time at
-    * which point our counterparty may be able to steal them. Generally we have in the high tens
-    * to low hundreds of blocks to get our transaction on-chain, but we shouldn't risk too low a
-    * fee - this should be a relatively high priority feerate.
+    * which point our counterparty may be able to steal them.
+    *
+    * Generally we have in the high tens to low hundreds of blocks to get our transaction
+    * on-chain (it doesn't have to happen in the next few blocks!), but we shouldn't risk too low
+    * a fee - this should be a relatively high priority feerate.
     */
-   LDKConfirmationTarget_OnChainSweep,
+   LDKConfirmationTarget_UrgentOnChainSweep,
    /**
     * This is the lowest feerate we will allow our channel counterparty to have in an anchor
     * channel in order to close the channel if a channel party goes away.
@@ -432,14 +473,18 @@ typedef enum LDKConfirmationTarget {
     */
    LDKConfirmationTarget_ChannelCloseMinimum,
    /**
-    * The feerate [`OutputSweeper`] will use on transactions spending
-    * [`SpendableOutputDescriptor`]s after a channel closure.
+    * The feerate used to claim on-chain funds when there is no particular urgency to do so.
+    *
+    * It is used to get commitment transactions without any HTLCs confirmed in [`ChannelMonitor`]
+    * and by  [`OutputSweeper`] on transactions spending [`SpendableOutputDescriptor`]s after a
+    * channel closure.
     *
     * Generally spending these outputs is safe as long as they eventually confirm, so a value
     * (slightly above) the mempool minimum should suffice. However, as this value will influence
     * how long funds will be unavailable after channel closure, [`FeeEstimator`] implementors
     * might want to choose a higher feerate to regain control over funds faster.
     *
+    * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
     * [`OutputSweeper`]: crate::util::sweep::OutputSweeper
     * [`SpendableOutputDescriptor`]: crate::sign::SpendableOutputDescriptor
     */
@@ -471,16 +516,11 @@ typedef enum LDKCreationError {
     */
    LDKCreationError_InvalidAmount,
    /**
-    * Route hints were required for this invoice and were missing. Applies to
-    * [phantom invoices].
-    *
-    * [phantom invoices]: crate::utils::create_phantom_invoice
+    * Route hints were required for this invoice and were missing.
     */
    LDKCreationError_MissingRouteHints,
    /**
-    * The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
-    *
-    * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
+    * The provided `min_final_cltv_expiry_delta` was less than rust-lightning's minimum.
     */
    LDKCreationError_MinFinalCltvExpiryDeltaTooShort,
    /**
@@ -520,8 +560,8 @@ typedef enum LDKCurrency {
 } LDKCurrency;
 
 /**
- * The side of a channel that is the [`IntroductionNode`] in a [`BlindedPath`]. [BOLT 7] defines
- * which nodes is which in the [`ChannelAnnouncement`] message.
+ * The side of a channel that is the [`IntroductionNode`] in a blinded path. [BOLT 7] defines which
+ * nodes is which in the [`ChannelAnnouncement`] message.
  *
  * [BOLT 7]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
  * [`ChannelAnnouncement`]: crate::ln::msgs::ChannelAnnouncement
@@ -599,6 +639,58 @@ typedef enum LDKIOError {
    LDKIOError_Sentinel,
 } LDKIOError;
 
+/**
+ * Exposes the state of pending inbound HTLCs.
+ *
+ * At a high level, an HTLC being forwarded from one Lightning node to another Lightning node goes
+ * through the following states in the state machine:
+ * - Announced for addition by the originating node through the update_add_htlc message.
+ * - Added to the commitment transaction of the receiving node and originating node in turn
+ *   through the exchange of commitment_signed and revoke_and_ack messages.
+ * - Announced for resolution (fulfillment or failure) by the receiving node through either one of
+ *   the update_fulfill_htlc, update_fail_htlc, and update_fail_malformed_htlc messages.
+ * - Removed from the commitment transaction of the originating node and receiving node in turn
+ *   through the exchange of commitment_signed and revoke_and_ack messages.
+ *
+ * This can be used to inspect what next message an HTLC is waiting for to advance its state.
+ */
+typedef enum LDKInboundHTLCStateDetails {
+   /**
+    * We have added this HTLC in our commitment transaction by receiving commitment_signed and
+    * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote
+    * before this HTLC is included on the remote commitment transaction.
+    */
+   LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToAdd,
+   /**
+    * This HTLC has been included in the commitment_signed and revoke_and_ack messages on both sides
+    * and is included in both commitment transactions.
+    *
+    * This HTLC is now safe to either forward or be claimed as a payment by us. The HTLC will
+    * remain in this state until the forwarded upstream HTLC has been resolved and we resolve this
+    * HTLC correspondingly, or until we claim it as a payment. If it is part of a multipart
+    * payment, it will only be claimed together with other required parts.
+    */
+   LDKInboundHTLCStateDetails_Committed,
+   /**
+    * We have received the preimage for this HTLC and it is being removed by fulfilling it with
+    * update_fulfill_htlc. This HTLC is still on both commitment transactions, but we are awaiting
+    * the appropriate revoke_and_ack's from the remote before this HTLC is removed from the remote
+    * commitment transaction after update_fulfill_htlc.
+    */
+   LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFulfill,
+   /**
+    * The HTLC is being removed by failing it with update_fail_htlc or update_fail_malformed_htlc.
+    * This HTLC is still on both commitment transactions, but we are awaiting the appropriate
+    * revoke_and_ack's from the remote before this HTLC is removed from the remote commitment
+    * transaction.
+    */
+   LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFail,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKInboundHTLCStateDetails_Sentinel,
+} LDKInboundHTLCStateDetails;
+
 /**
  * An enum representing the available verbosity levels of the logger.
  */
@@ -659,12 +751,67 @@ typedef enum LDKNetwork {
    LDKNetwork_Sentinel,
 } LDKNetwork;
 
+/**
+ * Exposes the state of pending outbound HTLCs.
+ *
+ * At a high level, an HTLC being forwarded from one Lightning node to another Lightning node goes
+ * through the following states in the state machine:
+ * - Announced for addition by the originating node through the update_add_htlc message.
+ * - Added to the commitment transaction of the receiving node and originating node in turn
+ *   through the exchange of commitment_signed and revoke_and_ack messages.
+ * - Announced for resolution (fulfillment or failure) by the receiving node through either one of
+ *   the update_fulfill_htlc, update_fail_htlc, and update_fail_malformed_htlc messages.
+ * - Removed from the commitment transaction of the originating node and receiving node in turn
+ *   through the exchange of commitment_signed and revoke_and_ack messages.
+ *
+ * This can be used to inspect what next message an HTLC is waiting for to advance its state.
+ */
+typedef enum LDKOutboundHTLCStateDetails {
+   /**
+    * We are awaiting the appropriate revoke_and_ack's from the remote before the HTLC is added
+    * on the remote's commitment transaction after update_add_htlc.
+    */
+   LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd,
+   /**
+    * The HTLC has been added to the remote's commitment transaction by sending commitment_signed
+    * and receiving revoke_and_ack in return.
+    *
+    * The HTLC will remain in this state until the remote node resolves the HTLC, or until we
+    * unilaterally close the channel due to a timeout with an uncooperative remote node.
+    */
+   LDKOutboundHTLCStateDetails_Committed,
+   /**
+    * The HTLC has been fulfilled successfully by the remote with a preimage in update_fulfill_htlc,
+    * and we removed the HTLC from our commitment transaction by receiving commitment_signed and
+    * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote
+    * for the removal from its commitment transaction.
+    */
+   LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess,
+   /**
+    * The HTLC has been failed by the remote with update_fail_htlc or update_fail_malformed_htlc,
+    * and we removed the HTLC from our commitment transaction by receiving commitment_signed and
+    * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote
+    * for the removal from its commitment transaction.
+    */
+   LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKOutboundHTLCStateDetails_Sentinel,
+} LDKOutboundHTLCStateDetails;
+
 /**
  * The reason the payment failed. Used in [`Event::PaymentFailed`].
  */
 typedef enum LDKPaymentFailureReason {
    /**
     * The intended recipient rejected our payment.
+    *
+    * Also used for [`UnknownRequiredFeatures`] and [`InvoiceRequestRejected`] when downgrading to
+    * version prior to 0.0.124.
+    *
+    * [`UnknownRequiredFeatures`]: Self::UnknownRequiredFeatures
+    * [`InvoiceRequestRejected`]: Self::InvoiceRequestRejected
     */
    LDKPaymentFailureReason_RecipientRejected,
    /**
@@ -686,7 +833,10 @@ typedef enum LDKPaymentFailureReason {
     * The payment expired while retrying, based on the provided
     * [`PaymentParameters::expiry_time`].
     *
+    * Also used for [`InvoiceRequestExpired`] when downgrading to version prior to 0.0.124.
+    *
     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
+    * [`InvoiceRequestExpired`]: Self::InvoiceRequestExpired
     */
    LDKPaymentFailureReason_PaymentExpired,
    /**
@@ -702,6 +852,20 @@ typedef enum LDKPaymentFailureReason {
     * your router.
     */
    LDKPaymentFailureReason_UnexpectedError,
+   /**
+    * An invoice was received that required unknown features.
+    */
+   LDKPaymentFailureReason_UnknownRequiredFeatures,
+   /**
+    * A [`Bolt12Invoice`] was not received in a reasonable amount of time.
+    */
+   LDKPaymentFailureReason_InvoiceRequestExpired,
+   /**
+    * An [`InvoiceRequest`] for the payment was rejected by the recipient.
+    *
+    * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+    */
+   LDKPaymentFailureReason_InvoiceRequestRejected,
    /**
     * Must be last for serialization purposes
     */
@@ -761,6 +925,14 @@ typedef enum LDKRetryableSendFailure {
     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
     */
    LDKRetryableSendFailure_DuplicatePayment,
+   /**
+    * The [`RecipientOnionFields::payment_metadata`], [`RecipientOnionFields::custom_tlvs`], or
+    * [`BlindedPaymentPath`]s provided are too large and caused us to exceed the maximum onion
+    * packet size of 1300 bytes.
+    *
+    * [`BlindedPaymentPath`]: crate::blinded_path::payment::BlindedPaymentPath
+    */
+   LDKRetryableSendFailure_OnionPacketSizeExceeded,
    /**
     * Must be last for serialization purposes
     */
@@ -815,6 +987,10 @@ typedef enum LDKSecp256k1Error {
     * The only valid parity values are 0 or 1.
     */
    LDKSecp256k1Error_InvalidParityValue,
+   /**
+    * Invalid Elligator Swift Value
+    */
+   LDKSecp256k1Error_InvalidEllSwift,
    /**
     * Must be last for serialization purposes
     */
@@ -1316,39 +1492,137 @@ typedef struct LDKCOption_u64Z {
 
 
 /**
- * Onion messages and payments can be sent and received to blinded paths, which serve to hide the
- * identity of the recipient.
+ * A blinded path to be used for sending or receiving a message, hiding the identity of the
+ * recipient.
  */
-typedef struct MUST_USE_STRUCT LDKBlindedPath {
+typedef struct MUST_USE_STRUCT LDKBlindedMessagePath {
    /**
     * 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.
     */
-   LDKnativeBlindedPath *inner;
+   LDKnativeBlindedMessagePath *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;
-} LDKBlindedPath;
+} LDKBlindedMessagePath;
 
 /**
- * A dynamically-allocated array of crate::lightning::blinded_path::BlindedPaths of arbitrary size.
+ * A dynamically-allocated array of crate::lightning::blinded_path::message::BlindedMessagePaths of arbitrary size.
  * This corresponds to std::vector in C++
  */
-typedef struct LDKCVec_BlindedPathZ {
+typedef struct LDKCVec_BlindedMessagePathZ {
    /**
     * The elements in the array.
     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
     */
-   struct LDKBlindedPath *data;
+   struct LDKBlindedMessagePath *data;
    /**
     * The number of elements pointed to by `data`.
     */
    uintptr_t datalen;
-} LDKCVec_BlindedPathZ;
+} LDKCVec_BlindedMessagePathZ;
+
+/**
+ * An error in decoding a message or struct.
+ */
+typedef enum LDKDecodeError_Tag {
+   /**
+    * A version byte specified something we don't know how to handle.
+    *
+    * Includes unknown realm byte in an onion hop data packet.
+    */
+   LDKDecodeError_UnknownVersion,
+   /**
+    * Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)
+    */
+   LDKDecodeError_UnknownRequiredFeature,
+   /**
+    * Value was invalid.
+    *
+    * For example, a byte which was supposed to be a bool was something other than a 0
+    * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
+    * syntactically incorrect, etc.
+    */
+   LDKDecodeError_InvalidValue,
+   /**
+    * The buffer to be read was too short.
+    */
+   LDKDecodeError_ShortRead,
+   /**
+    * A length descriptor in the packet didn't describe the later data correctly.
+    */
+   LDKDecodeError_BadLengthDescriptor,
+   /**
+    * Error from [`std::io`].
+    */
+   LDKDecodeError_Io,
+   /**
+    * The message included zlib-compressed values, which we don't support.
+    */
+   LDKDecodeError_UnsupportedCompression,
+   /**
+    * Value is validly encoded but is dangerous to use.
+    *
+    * This is used for things like [`ChannelManager`] deserialization where we want to ensure
+    * that we don't use a [`ChannelManager`] which is in out of sync with the [`ChannelMonitor`].
+    * This indicates that there is a critical implementation flaw in the storage implementation
+    * and it's unsafe to continue.
+    *
+    * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+    * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
+    */
+   LDKDecodeError_DangerousValue,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKDecodeError_Sentinel,
+} LDKDecodeError_Tag;
+
+typedef struct MUST_USE_STRUCT LDKDecodeError {
+   LDKDecodeError_Tag tag;
+   union {
+      struct {
+         enum LDKIOError io;
+      };
+   };
+} LDKDecodeError;
+
+/**
+ * The contents of CResult_RefundDecodeErrorZ
+ */
+typedef union LDKCResult_RefundDecodeErrorZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKRefund *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_RefundDecodeErrorZPtr;
+
+/**
+ * A CResult_RefundDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::offers::refund::Refund 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_RefundDecodeErrorZ {
+   /**
+    * The contents of this CResult_RefundDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_RefundDecodeErrorZPtr contents;
+   /**
+    * Whether this CResult_RefundDecodeErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_RefundDecodeErrorZ;
 
 
 
@@ -1440,71 +1714,6 @@ typedef struct MUST_USE_STRUCT LDKRetry {
    };
 } LDKRetry;
 
-/**
- * An error in decoding a message or struct.
- */
-typedef enum LDKDecodeError_Tag {
-   /**
-    * A version byte specified something we don't know how to handle.
-    *
-    * Includes unknown realm byte in an onion hop data packet.
-    */
-   LDKDecodeError_UnknownVersion,
-   /**
-    * Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)
-    */
-   LDKDecodeError_UnknownRequiredFeature,
-   /**
-    * Value was invalid.
-    *
-    * For example, a byte which was supposed to be a bool was something other than a 0
-    * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
-    * syntactically incorrect, etc.
-    */
-   LDKDecodeError_InvalidValue,
-   /**
-    * The buffer to be read was too short.
-    */
-   LDKDecodeError_ShortRead,
-   /**
-    * A length descriptor in the packet didn't describe the later data correctly.
-    */
-   LDKDecodeError_BadLengthDescriptor,
-   /**
-    * Error from [`std::io`].
-    */
-   LDKDecodeError_Io,
-   /**
-    * The message included zlib-compressed values, which we don't support.
-    */
-   LDKDecodeError_UnsupportedCompression,
-   /**
-    * Value is validly encoded but is dangerous to use.
-    *
-    * This is used for things like [`ChannelManager`] deserialization where we want to ensure
-    * that we don't use a [`ChannelManager`] which is in out of sync with the [`ChannelMonitor`].
-    * This indicates that there is a critical implementation flaw in the storage implementation
-    * and it's unsafe to continue.
-    *
-    * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
-    * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
-    */
-   LDKDecodeError_DangerousValue,
-   /**
-    * Must be last for serialization purposes
-    */
-   LDKDecodeError_Sentinel,
-} LDKDecodeError_Tag;
-
-typedef struct MUST_USE_STRUCT LDKDecodeError {
-   LDKDecodeError_Tag tag;
-   union {
-      struct {
-         enum LDKIOError io;
-      };
-   };
-} LDKDecodeError;
-
 /**
  * The contents of CResult_RetryDecodeErrorZ
  */
@@ -2061,6 +2270,22 @@ typedef struct LDKCResult_SchnorrSignatureNoneZ {
    bool result_ok;
 } LDKCResult_SchnorrSignatureNoneZ;
 
+/**
+ * A dynamically-allocated array of crate::c_types::Strs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_StrZ {
+   /**
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+    */
+   struct LDKStr *data;
+   /**
+    * The number of elements pointed to by `data`.
+    */
+   uintptr_t datalen;
+} LDKCVec_StrZ;
+
 /**
  * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
  * This corresponds to std::vector in C++
@@ -2280,58 +2505,38 @@ typedef struct LDKCResult_ThirtyTwoBytesNoneZ {
    bool result_ok;
 } LDKCResult_ThirtyTwoBytesNoneZ;
 
-
-
-/**
- * Information needed to route a payment across a [`BlindedPath`].
- */
-typedef struct MUST_USE_STRUCT LDKBlindedPayInfo {
-   /**
-    * A pointer to the opaque Rust object.
-    * Nearly everywhere, inner must be non-null, however in places where
-    * the Rust equivalent takes an Option, it may be set to null to indicate None.
-    */
-   LDKnativeBlindedPayInfo *inner;
-   /**
-    * Indicates that this is the only struct which contains the same pointer.
-    * Rust functions which take ownership of an object provided via an argument require
-    * this to be true and invalidate the object pointed to by inner.
-    */
-   bool is_owned;
-} LDKBlindedPayInfo;
-
 /**
- * The contents of CResult_BlindedPayInfoDecodeErrorZ
+ * The contents of CResult_Bolt12InvoiceDecodeErrorZ
  */
-typedef union LDKCResult_BlindedPayInfoDecodeErrorZPtr {
+typedef union LDKCResult_Bolt12InvoiceDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKBlindedPayInfo *result;
+   struct LDKBolt12Invoice *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_BlindedPayInfoDecodeErrorZPtr;
+} LDKCResult_Bolt12InvoiceDecodeErrorZPtr;
 
 /**
- * A CResult_BlindedPayInfoDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::offers::invoice::BlindedPayInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_Bolt12InvoiceDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::offers::invoice::Bolt12Invoice on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_BlindedPayInfoDecodeErrorZ {
+typedef struct LDKCResult_Bolt12InvoiceDecodeErrorZ {
    /**
-    * The contents of this CResult_BlindedPayInfoDecodeErrorZ, accessible via either
+    * The contents of this CResult_Bolt12InvoiceDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_BlindedPayInfoDecodeErrorZPtr contents;
+   union LDKCResult_Bolt12InvoiceDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_BlindedPayInfoDecodeErrorZ represents a success state.
+    * Whether this CResult_Bolt12InvoiceDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_BlindedPayInfoDecodeErrorZ;
+} LDKCResult_Bolt12InvoiceDecodeErrorZ;
 
 
 
@@ -2448,7 +2653,7 @@ typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
 /**
  * A reference to a transaction output.
  *
- * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
+ * Differs from bitcoin::transaction::OutPoint as the index is a u16 instead of u32
  * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
  */
 typedef struct MUST_USE_STRUCT LDKOutPoint {
@@ -2838,77 +3043,109 @@ typedef struct LDKCResult_HTLCDescriptorDecodeErrorZ {
 } LDKCResult_HTLCDescriptorDecodeErrorZ;
 
 /**
- * The contents of CResult_NoneNoneZ
+ * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
  */
-typedef union LDKCResult_NoneNoneZPtr {
+typedef struct LDKPublicKey {
    /**
-    * Note that this value is always NULL, as there are no contents in the OK variant
+    * The bytes of the public key
     */
-   void *result;
+   uint8_t compressed_form[33];
+} LDKPublicKey;
+
+/**
+ * The contents of CResult_PublicKeyNoneZ
+ */
+typedef union LDKCResult_PublicKeyNoneZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKPublicKey *result;
    /**
     * Note that this value is always NULL, as there are no contents in the Err variant
     */
    void *err;
-} LDKCResult_NoneNoneZPtr;
+} LDKCResult_PublicKeyNoneZPtr;
 
 /**
- * A CResult_NoneNoneZ represents the result of a fallible operation,
- * containing a () on success and a () on failure.
+ * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
+ * containing a crate::c_types::PublicKey on success and a () on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_NoneNoneZ {
+typedef struct LDKCResult_PublicKeyNoneZ {
    /**
-    * The contents of this CResult_NoneNoneZ, accessible via either
+    * The contents of this CResult_PublicKeyNoneZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_NoneNoneZPtr contents;
+   union LDKCResult_PublicKeyNoneZPtr contents;
    /**
-    * Whether this CResult_NoneNoneZ represents a success state.
+    * Whether this CResult_PublicKeyNoneZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_NoneNoneZ;
+} LDKCResult_PublicKeyNoneZ;
 
 /**
- * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
+ * The contents of CResult__u832NoneZ
  */
-typedef struct LDKPublicKey {
+typedef union LDKCResult__u832NoneZPtr {
    /**
-    * The bytes of the public key
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   uint8_t compressed_form[33];
-} LDKPublicKey;
+   struct LDKThirtyTwoBytes *result;
+   /**
+    * Note that this value is always NULL, as there are no contents in the Err variant
+    */
+   void *err;
+} LDKCResult__u832NoneZPtr;
 
 /**
- * The contents of CResult_PublicKeyNoneZ
+ * A CResult__u832NoneZ represents the result of a fallible operation,
+ * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef union LDKCResult_PublicKeyNoneZPtr {
+typedef struct LDKCResult__u832NoneZ {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * The contents of this CResult__u832NoneZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   struct LDKPublicKey *result;
+   union LDKCResult__u832NoneZPtr contents;
+   /**
+    * Whether this CResult__u832NoneZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult__u832NoneZ;
+
+/**
+ * The contents of CResult_NoneNoneZ
+ */
+typedef union LDKCResult_NoneNoneZPtr {
+   /**
+    * Note that this value is always NULL, as there are no contents in the OK variant
+    */
+   void *result;
    /**
     * Note that this value is always NULL, as there are no contents in the Err variant
     */
    void *err;
-} LDKCResult_PublicKeyNoneZPtr;
+} LDKCResult_NoneNoneZPtr;
 
 /**
- * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
- * containing a crate::c_types::PublicKey on success and a () on failure.
+ * 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_PublicKeyNoneZ {
+typedef struct LDKCResult_NoneNoneZ {
    /**
-    * The contents of this CResult_PublicKeyNoneZ, accessible via either
+    * The contents of this CResult_NoneNoneZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_PublicKeyNoneZPtr contents;
+   union LDKCResult_NoneNoneZPtr contents;
    /**
-    * Whether this CResult_PublicKeyNoneZ represents a success state.
+    * Whether this CResult_NoneNoneZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_PublicKeyNoneZ;
+} LDKCResult_NoneNoneZ;
 
 /**
  * An enum which can either contain a crate::c_types::BigEndianScalar or not
@@ -2937,29 +3174,6 @@ typedef struct LDKCOption_BigEndianScalarZ {
    };
 } LDKCOption_BigEndianScalarZ;
 
-/**
- * Integer in the range `0..32`
- */
-typedef struct LDKU5 {
-   uint8_t _0;
-} LDKU5;
-
-/**
- * A dynamically-allocated array of crate::c_types::U5s of arbitrary size.
- * This corresponds to std::vector in C++
- */
-typedef struct LDKCVec_U5Z {
-   /**
-    * The elements in the array.
-    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
-    */
-   struct LDKU5 *data;
-   /**
-    * The number of elements pointed to by `data`.
-    */
-   uintptr_t datalen;
-} LDKCVec_U5Z;
-
 /**
  * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
  * allows recovering the exact public key which created the signature given the message.
@@ -3300,6 +3514,10 @@ typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
 /**
  * A trait to handle Lightning channel key material without concretizing the channel type or
  * the signature mechanism.
+ *
+ * Several methods allow error types to be returned to support async signing. This feature
+ * is not yet complete, and panics may occur in certain situations when returning errors
+ * for these methods.
  */
 typedef struct LDKChannelSigner {
    /**
@@ -3311,8 +3529,13 @@ typedef struct LDKChannelSigner {
     * Gets the per-commitment point for a specific commitment number
     *
     * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
+    *
+    * If the signer returns `Err`, then the user is responsible for either force-closing the channel
+    * or calling `ChannelManager::signer_unblocked` (this method is only available when the
+    * `async_signing` cfg flag is enabled) once the signature is ready.
+    *
     */
-   struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
+   struct LDKCResult_PublicKeyNoneZ (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
    /**
     * Gets the commitment secret for a specific commitment number as part of the revocation process
     *
@@ -3323,7 +3546,7 @@ typedef struct LDKChannelSigner {
     *
     * 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);
+   struct LDKCResult__u832NoneZ (*release_commitment_secret)(const void *this_arg, uint64_t idx);
    /**
     * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
     *
@@ -3569,80 +3792,50 @@ typedef struct LDKEcdsaChannelSigner {
     */
    struct LDKChannelSigner ChannelSigner;
    /**
-    * 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);
-} LDKEcdsaChannelSigner;
-
-/**
- * A writeable signer.
- *
- * There will always be two instances of a signer per channel, one occupied by the
- * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
- *
- * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
- * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
- */
-typedef struct LDKWriteableEcdsaChannelSigner {
-   /**
-    * An opaque pointer which is passed to your function implementations as an argument.
-    * This has no meaning in the LDK, and can be NULL or any other value.
-    */
-   void *this_arg;
-   /**
-    * Implementation of EcdsaChannelSigner for this object.
-    */
-   struct LDKEcdsaChannelSigner EcdsaChannelSigner;
-   /**
-    * Serialize the object into a byte array
-    */
-   struct LDKCVec_u8Z (*write)(const void *this_arg);
-   /**
-    * Called, if set, after this WriteableEcdsaChannelSigner has been cloned into a duplicate object.
-    * The new WriteableEcdsaChannelSigner is provided, and should be mutated as needed to perform a
+    * Called, if set, after this EcdsaChannelSigner has been cloned into a duplicate object.
+    * The new EcdsaChannelSigner is provided, and should be mutated as needed to perform a
     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
     */
-   void (*cloned)(struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR new_WriteableEcdsaChannelSigner);
+   void (*cloned)(struct LDKEcdsaChannelSigner *NONNULL_PTR new_EcdsaChannelSigner);
    /**
     * 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);
-} LDKWriteableEcdsaChannelSigner;
+} LDKEcdsaChannelSigner;
 
 /**
- * The contents of CResult_WriteableEcdsaChannelSignerDecodeErrorZ
+ * The contents of CResult_EcdsaChannelSignerDecodeErrorZ
  */
-typedef union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr {
+typedef union LDKCResult_EcdsaChannelSignerDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKWriteableEcdsaChannelSigner *result;
+   struct LDKEcdsaChannelSigner *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_WriteableEcdsaChannelSignerDecodeErrorZPtr;
+} LDKCResult_EcdsaChannelSignerDecodeErrorZPtr;
 
 /**
- * A CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::sign::ecdsa::WriteableEcdsaChannelSigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_EcdsaChannelSignerDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::sign::ecdsa::EcdsaChannelSigner 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_WriteableEcdsaChannelSignerDecodeErrorZ {
+typedef struct LDKCResult_EcdsaChannelSignerDecodeErrorZ {
    /**
-    * The contents of this CResult_WriteableEcdsaChannelSignerDecodeErrorZ, accessible via either
+    * The contents of this CResult_EcdsaChannelSignerDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr contents;
+   union LDKCResult_EcdsaChannelSignerDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents a success state.
+    * Whether this CResult_EcdsaChannelSignerDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ;
+} LDKCResult_EcdsaChannelSignerDecodeErrorZ;
 
 /**
  * The contents of CResult_CVec_u8ZNoneZ
@@ -3797,7 +3990,7 @@ typedef struct LDKCResult_WitnessNoneZ {
 
 
 /**
- * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory.
+ * A simple implementation of [`EcdsaChannelSigner`] that just keeps the private keys in memory.
  *
  * This implementation performs no policy checks and is insufficient by itself as
  * a secure external signer.
@@ -3995,6 +4188,8 @@ typedef enum LDKCandidateRouteHop_Tag {
     *
     * This primarily exists to track that we need to included a blinded path at the end of our
     * [`Route`], even though it doesn't actually add an additional hop in the payment.
+    *
+    * [`BlindedPayInfo`]: crate::blinded_path::payment::BlindedPayInfo
     */
    LDKCandidateRouteHop_OneHopBlinded,
    /**
@@ -4280,8 +4475,89 @@ typedef struct LDKCResult_NoneIOErrorZ {
 
 
 
+/**
+ * Parameters needed to find a [`Route`].
+ *
+ * Passed to [`find_route`] and [`build_route_from_hops`].
+ */
+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;
+
+/**
+ * A tuple of 3 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ {
+   /**
+    * The element at position 0
+    */
+   struct LDKThirtyTwoBytes a;
+   /**
+    * The element at position 1
+    */
+   struct LDKRecipientOnionFields b;
+   /**
+    * The element at position 2
+    */
+   struct LDKRouteParameters c;
+} LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ;
+
+/**
+ * The contents of CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ
+ */
+typedef union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *result;
+   /**
+    * Note that this value is always NULL, as there are no contents in the Err variant
+    */
+   void *err;
+} LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr;
+
+/**
+ * A CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ {
+   /**
+    * The contents of this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr contents;
+   /**
+    * Whether this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ;
+
+
+
 /**
  * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
+ *
+ * Balances of a channel are available through [`ChainMonitor::get_claimable_balances`] and
+ * [`ChannelMonitor::get_claimable_balances`], calculated with respect to the corresponding on-chain
+ * transactions.
+ *
+ * [`ChannelManager::list_channels`]: crate::ln::channelmanager::ChannelManager::list_channels
+ * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
+ * [`ChainMonitor::get_claimable_balances`]: crate::chain::chainmonitor::ChainMonitor::get_claimable_balances
+ * [`ChannelMonitor::get_claimable_balances`]: crate::chain::channelmonitor::ChannelMonitor::get_claimable_balances
  */
 typedef struct MUST_USE_STRUCT LDKChannelDetails {
    /**
@@ -4299,7 +4575,7 @@ typedef struct MUST_USE_STRUCT LDKChannelDetails {
 } LDKChannelDetails;
 
 /**
- * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
+ * A dynamically-allocated array of crate::lightning::ln::channel_state::ChannelDetailss of arbitrary size.
  * This corresponds to std::vector in C++
  */
 typedef struct LDKCVec_ChannelDetailsZ {
@@ -4388,67 +4664,74 @@ typedef struct LDKCResult_RouteLightningErrorZ {
    bool result_ok;
 } LDKCResult_RouteLightningErrorZ;
 
+
+
 /**
- * A tuple of 2 elements. See the individual fields for the types contained.
+ * A blinded path to be used for sending or receiving a payment, hiding the identity of the
+ * recipient.
  */
-typedef struct LDKC2Tuple_BlindedPayInfoBlindedPathZ {
+typedef struct MUST_USE_STRUCT LDKBlindedPaymentPath {
    /**
-    * The element at position 0
+    * 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 LDKBlindedPayInfo a;
+   LDKnativeBlindedPaymentPath *inner;
    /**
-    * The element at position 1
+    * 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.
     */
-   struct LDKBlindedPath b;
-} LDKC2Tuple_BlindedPayInfoBlindedPathZ;
+   bool is_owned;
+} LDKBlindedPaymentPath;
 
 /**
- * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZs of arbitrary size.
+ * A dynamically-allocated array of crate::lightning::blinded_path::payment::BlindedPaymentPaths of arbitrary size.
  * This corresponds to std::vector in C++
  */
-typedef struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ {
+typedef struct LDKCVec_BlindedPaymentPathZ {
    /**
     * The elements in the array.
     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
     */
-   struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *data;
+   struct LDKBlindedPaymentPath *data;
    /**
     * The number of elements pointed to by `data`.
     */
    uintptr_t datalen;
-} LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ;
+} LDKCVec_BlindedPaymentPathZ;
 
 /**
- * The contents of CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ
+ * The contents of CResult_CVec_BlindedPaymentPathZNoneZ
  */
-typedef union LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr {
+typedef union LDKCResult_CVec_BlindedPaymentPathZNoneZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ *result;
+   struct LDKCVec_BlindedPaymentPathZ *result;
    /**
     * Note that this value is always NULL, as there are no contents in the Err variant
     */
    void *err;
-} LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr;
+} LDKCResult_CVec_BlindedPaymentPathZNoneZPtr;
 
 /**
- * A CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ represents the result of a fallible operation,
- * containing a crate::c_types::derived::CVec_C2Tuple_BlindedPayInfoBlindedPathZZ on success and a () on failure.
+ * A CResult_CVec_BlindedPaymentPathZNoneZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::CVec_BlindedPaymentPathZ on success and a () on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ {
+typedef struct LDKCResult_CVec_BlindedPaymentPathZNoneZ {
    /**
-    * The contents of this CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ, accessible via either
+    * The contents of this CResult_CVec_BlindedPaymentPathZNoneZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr contents;
+   union LDKCResult_CVec_BlindedPaymentPathZNoneZPtr contents;
    /**
-    * Whether this CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ represents a success state.
+    * Whether this CResult_CVec_BlindedPaymentPathZNoneZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ;
+} LDKCResult_CVec_BlindedPaymentPathZNoneZ;
 
 /**
  * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
@@ -4519,36 +4802,72 @@ typedef struct LDKCResult_OnionMessagePathNoneZ {
 } LDKCResult_OnionMessagePathNoneZ;
 
 /**
- * The contents of CResult_CVec_BlindedPathZNoneZ
+ * The contents of CResult_CVec_BlindedMessagePathZNoneZ
  */
-typedef union LDKCResult_CVec_BlindedPathZNoneZPtr {
+typedef union LDKCResult_CVec_BlindedMessagePathZNoneZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKCVec_BlindedPathZ *result;
+   struct LDKCVec_BlindedMessagePathZ *result;
    /**
     * Note that this value is always NULL, as there are no contents in the Err variant
     */
    void *err;
-} LDKCResult_CVec_BlindedPathZNoneZPtr;
+} LDKCResult_CVec_BlindedMessagePathZNoneZPtr;
 
 /**
- * A CResult_CVec_BlindedPathZNoneZ represents the result of a fallible operation,
- * containing a crate::c_types::derived::CVec_BlindedPathZ on success and a () on failure.
+ * A CResult_CVec_BlindedMessagePathZNoneZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::CVec_BlindedMessagePathZ on success and a () on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_CVec_BlindedPathZNoneZ {
+typedef struct LDKCResult_CVec_BlindedMessagePathZNoneZ {
    /**
-    * The contents of this CResult_CVec_BlindedPathZNoneZ, accessible via either
+    * The contents of this CResult_CVec_BlindedMessagePathZNoneZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_CVec_BlindedPathZNoneZPtr contents;
+   union LDKCResult_CVec_BlindedMessagePathZNoneZPtr contents;
    /**
-    * Whether this CResult_CVec_BlindedPathZNoneZ represents a success state.
+    * Whether this CResult_CVec_BlindedMessagePathZNoneZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_CVec_BlindedPathZNoneZ;
+} LDKCResult_CVec_BlindedMessagePathZNoneZ;
+
+
+
+/**
+ * An intermediate node, and possibly a short channel id leading to the next node.
+ */
+typedef struct MUST_USE_STRUCT LDKMessageForwardNode {
+   /**
+    * 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.
+    */
+   LDKnativeMessageForwardNode *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;
+} LDKMessageForwardNode;
+
+/**
+ * A dynamically-allocated array of crate::lightning::blinded_path::message::MessageForwardNodes of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_MessageForwardNodeZ {
+   /**
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+    */
+   struct LDKMessageForwardNode *data;
+   /**
+    * The number of elements pointed to by `data`.
+    */
+   uintptr_t datalen;
+} LDKCVec_MessageForwardNodeZ;
 
 
 
@@ -4817,28 +5136,6 @@ typedef struct LDKCResult_RouteDecodeErrorZ {
    bool result_ok;
 } LDKCResult_RouteDecodeErrorZ;
 
-
-
-/**
- * Parameters needed to find a [`Route`].
- *
- * Passed to [`find_route`] and [`build_route_from_hops`].
- */
-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
  */
@@ -4962,7 +5259,7 @@ typedef struct MUST_USE_STRUCT LDKRouteHint {
 } LDKRouteHint;
 
 /**
- * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
+ * A dynamically-allocated array of crate::lightning_types::routing::RouteHints of arbitrary size.
  * This corresponds to std::vector in C++
  */
 typedef struct LDKCVec_RouteHintZ {
@@ -4977,46 +5274,6 @@ typedef struct LDKCVec_RouteHintZ {
    uintptr_t datalen;
 } LDKCVec_RouteHintZ;
 
-
-
-/**
- * A channel descriptor for a hop along a payment path.
- *
- * While this generally comes from BOLT 11's `r` field, this struct includes more fields than are
- * available in BOLT 11. Thus, encoding and decoding this via `lightning-invoice` is lossy, as
- * fields not supported in BOLT 11 will be stripped.
- */
-typedef struct MUST_USE_STRUCT LDKRouteHintHop {
-   /**
-    * 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.
-    */
-   LDKnativeRouteHintHop *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;
-} LDKRouteHintHop;
-
-/**
- * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
- * This corresponds to std::vector in C++
- */
-typedef struct LDKCVec_RouteHintHopZ {
-   /**
-    * The elements in the array.
-    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
-    */
-   struct LDKRouteHintHop *data;
-   /**
-    * The number of elements pointed to by `data`.
-    */
-   uintptr_t datalen;
-} LDKCVec_RouteHintHopZ;
-
 /**
  * The contents of CResult_RouteHintDecodeErrorZ
  */
@@ -5035,7 +5292,7 @@ typedef union 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.
+ * containing a crate::lightning_types::routing::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 {
@@ -5050,6 +5307,30 @@ typedef struct LDKCResult_RouteHintDecodeErrorZ {
    bool result_ok;
 } LDKCResult_RouteHintDecodeErrorZ;
 
+
+
+/**
+ * A channel descriptor for a hop along a payment path.
+ *
+ * While this generally comes from BOLT 11's `r` field, this struct includes more fields than are
+ * available in BOLT 11. Thus, encoding and decoding this via `lightning-invoice` is lossy, as
+ * fields not supported in BOLT 11 will be stripped.
+ */
+typedef struct MUST_USE_STRUCT LDKRouteHintHop {
+   /**
+    * 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.
+    */
+   LDKnativeRouteHintHop *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;
+} LDKRouteHintHop;
+
 /**
  * The contents of CResult_RouteHintHopDecodeErrorZ
  */
@@ -5068,7 +5349,7 @@ typedef union 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.
+ * containing a crate::lightning_types::routing::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 {
@@ -5727,6 +6008,16 @@ typedef enum LDKClosureReason_Tag {
     * One of our HTLCs timed out in a channel, causing us to force close the channel.
     */
    LDKClosureReason_HTLCsTimedOut,
+   /**
+    * Our peer provided a feerate which violated our required minimum (fetched from our
+    * [`FeeEstimator`] either as [`ConfirmationTarget::MinAllowedAnchorChannelRemoteFee`] or
+    * [`ConfirmationTarget::MinAllowedNonAnchorChannelRemoteFee`]).
+    *
+    * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
+    * [`ConfirmationTarget::MinAllowedAnchorChannelRemoteFee`]: crate::chain::chaininterface::ConfirmationTarget::MinAllowedAnchorChannelRemoteFee
+    * [`ConfirmationTarget::MinAllowedNonAnchorChannelRemoteFee`]: crate::chain::chaininterface::ConfirmationTarget::MinAllowedNonAnchorChannelRemoteFee
+    */
+   LDKClosureReason_PeerFeerateTooLow,
    /**
     * Must be last for serialization purposes
     */
@@ -5746,6 +6037,24 @@ typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
    struct LDKUntrustedString peer_msg;
 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
 
+typedef struct LDKClosureReason_LDKHolderForceClosed_Body {
+   /**
+    * Whether or not the latest transaction was broadcasted when the channel was force
+    * closed.
+    *
+    * Channels closed using [`ChannelManager::force_close_broadcasting_latest_txn`] will have
+    * this field set to true, whereas channels closed using [`ChannelManager::force_close_without_broadcasting_txn`]
+    * or force-closed prior to being funded will have this field set to false.
+    *
+    * This will be `None` for objects generated or written by LDK 0.0.123 and
+    * earlier.
+    *
+    * [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn.
+    * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn.
+    */
+   struct LDKCOption_boolZ broadcasted_latest_txn;
+} LDKClosureReason_LDKHolderForceClosed_Body;
+
 typedef struct LDKClosureReason_LDKProcessingError_Body {
    /**
     * A developer-readable error message which we generated.
@@ -5753,11 +6062,26 @@ typedef struct LDKClosureReason_LDKProcessingError_Body {
    struct LDKStr err;
 } LDKClosureReason_LDKProcessingError_Body;
 
+typedef struct LDKClosureReason_LDKPeerFeerateTooLow_Body {
+   /**
+    * The feerate on our channel set by our peer.
+    */
+   uint32_t peer_feerate_sat_per_kw;
+   /**
+    * The required feerate we enforce, from our [`FeeEstimator`].
+    *
+    * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
+    */
+   uint32_t required_feerate_sat_per_kw;
+} LDKClosureReason_LDKPeerFeerateTooLow_Body;
+
 typedef struct MUST_USE_STRUCT LDKClosureReason {
    LDKClosureReason_Tag tag;
    union {
       LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
+      LDKClosureReason_LDKHolderForceClosed_Body holder_force_closed;
       LDKClosureReason_LDKProcessingError_Body processing_error;
+      LDKClosureReason_LDKPeerFeerateTooLow_Body peer_feerate_too_low;
    };
 } LDKClosureReason;
 
@@ -5959,7 +6283,7 @@ typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
 
 /**
  * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * containing a crate::lightning_types::features::InitFeatures 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_InitFeaturesDecodeErrorZ {
@@ -6012,7 +6336,7 @@ typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
 
 /**
  * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * containing a crate::lightning_types::features::ChannelFeatures 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_ChannelFeaturesDecodeErrorZ {
@@ -6065,7 +6389,7 @@ typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
 
 /**
  * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * containing a crate::lightning_types::features::NodeFeatures 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_NodeFeaturesDecodeErrorZ {
@@ -6118,7 +6442,7 @@ typedef union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr {
 
 /**
  * A CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::features::Bolt11InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * containing a crate::lightning_types::features::Bolt11InvoiceFeatures 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_Bolt11InvoiceFeaturesDecodeErrorZ {
@@ -6171,7 +6495,7 @@ typedef union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr {
 
 /**
  * A CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::features::Bolt12InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * containing a crate::lightning_types::features::Bolt12InvoiceFeatures 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_Bolt12InvoiceFeaturesDecodeErrorZ {
@@ -6224,7 +6548,7 @@ typedef union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr {
 
 /**
  * A CResult_BlindedHopFeaturesDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::features::BlindedHopFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * containing a crate::lightning_types::features::BlindedHopFeatures 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_BlindedHopFeaturesDecodeErrorZ {
@@ -6286,7 +6610,7 @@ typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
 
 /**
  * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * containing a crate::lightning_types::features::ChannelTypeFeatures 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_ChannelTypeFeaturesDecodeErrorZ {
@@ -6398,7 +6722,7 @@ typedef struct LDKCResult_NoneBolt12SemanticErrorZ {
  * Offers may be denominated in currency other than bitcoin but are ultimately paid using the
  * latter.
  *
- * Through the use of [`BlindedPath`]s, offers provide recipient privacy.
+ * Through the use of [`BlindedMessagePath`]s, offers provide recipient privacy.
  *
  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
@@ -6565,6 +6889,39 @@ typedef struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12Semantic
    bool result_ok;
 } LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ;
 
+/**
+ * The contents of CResult_OfferDecodeErrorZ
+ */
+typedef union LDKCResult_OfferDecodeErrorZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKOffer *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_OfferDecodeErrorZPtr;
+
+/**
+ * A CResult_OfferDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::offers::offer::Offer 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_OfferDecodeErrorZ {
+   /**
+    * The contents of this CResult_OfferDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_OfferDecodeErrorZPtr contents;
+   /**
+    * Whether this CResult_OfferDecodeErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_OfferDecodeErrorZ;
+
 /**
  * The contents of CResult_OfferBolt12ParseErrorZ
  */
@@ -6664,28 +7021,6 @@ typedef struct LDKCResult_PublicKeySecp256k1ErrorZ {
    bool result_ok;
 } LDKCResult_PublicKeySecp256k1ErrorZ;
 
-
-
-/**
- * A [`channel_update`] message to be sent to or received from a peer.
- *
- * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
- */
-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.
@@ -6693,11 +7028,6 @@ typedef struct MUST_USE_STRUCT LDKChannelUpdate {
  * [BOLT #4]: https://github.com/lightning/bolts/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 that a channel failed to route a payment, which should be applied via
     * [`NetworkGraph::channel_failed_permanent`] if permanent.
@@ -6714,13 +7044,6 @@ typedef enum LDKNetworkUpdate_Tag {
    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_LDKChannelFailure_Body {
    /**
     * The short channel id of the closed channel.
@@ -6748,7 +7071,6 @@ typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
    LDKNetworkUpdate_Tag tag;
    union {
-      LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
       LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
       LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
    };
@@ -7046,6 +7368,28 @@ typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
    bool is_owned;
 } LDKChannelAnnouncement;
 
+
+
+/**
+ * A [`channel_update`] message to be sent to or received from a peer.
+ *
+ * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
+ */
+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 tuple of 3 elements. See the individual fields for the types contained.
  */
@@ -7236,7 +7580,8 @@ typedef struct MUST_USE_STRUCT LDKFundingSigned {
 
 
 /**
- * An stfu (quiescence) message to be sent by or received from the stfu initiator.
+ * An `stfu` (quiescence) message to be sent by or received from the stfu initiator.
+ *
  */
 typedef struct MUST_USE_STRUCT LDKStfu {
    /**
@@ -7256,27 +7601,28 @@ typedef struct MUST_USE_STRUCT LDKStfu {
 
 
 /**
- * A splice message to be sent by or received from the stfu initiator (splice initiator).
+ * A `splice_init` message to be sent by or received from the stfu initiator (splice initiator).
+ *
  */
-typedef struct MUST_USE_STRUCT LDKSplice {
+typedef struct MUST_USE_STRUCT LDKSpliceInit {
    /**
     * 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.
     */
-   LDKnativeSplice *inner;
+   LDKnativeSpliceInit *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;
-} LDKSplice;
+} LDKSpliceInit;
 
 
 
 /**
- * A splice_ack message to be received by or sent to the splice initiator.
+ * A `splice_ack` message to be received by or sent to the splice initiator.
  *
  */
 typedef struct MUST_USE_STRUCT LDKSpliceAck {
@@ -7297,7 +7643,7 @@ typedef struct MUST_USE_STRUCT LDKSpliceAck {
 
 
 /**
- * A splice_locked message to be sent to or received from a peer.
+ * A `splice_locked` message to be sent to or received from a peer.
  *
  */
 typedef struct MUST_USE_STRUCT LDKSpliceLocked {
@@ -7965,9 +8311,9 @@ typedef enum LDKMessageSendEvent_Tag {
     */
    LDKMessageSendEvent_SendStfu,
    /**
-    * Used to indicate that a splice message should be sent to the peer with the given node id.
+    * Used to indicate that a splice_init message should be sent to the peer with the given node id.
     */
-   LDKMessageSendEvent_SendSplice,
+   LDKMessageSendEvent_SendSpliceInit,
    /**
     * Used to indicate that a splice_ack message should be sent to the peer with the given node id.
     */
@@ -8179,7 +8525,7 @@ typedef struct LDKMessageSendEvent_LDKSendStfu_Body {
    struct LDKStfu msg;
 } LDKMessageSendEvent_LDKSendStfu_Body;
 
-typedef struct LDKMessageSendEvent_LDKSendSplice_Body {
+typedef struct LDKMessageSendEvent_LDKSendSpliceInit_Body {
    /**
     * The node_id of the node which should receive this message
     */
@@ -8187,8 +8533,8 @@ typedef struct LDKMessageSendEvent_LDKSendSplice_Body {
    /**
     * The message which should be sent.
     */
-   struct LDKSplice msg;
-} LDKMessageSendEvent_LDKSendSplice_Body;
+   struct LDKSpliceInit msg;
+} LDKMessageSendEvent_LDKSendSpliceInit_Body;
 
 typedef struct LDKMessageSendEvent_LDKSendSpliceAck_Body {
    /**
@@ -8506,7 +8852,7 @@ typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
       LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
       LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
       LDKMessageSendEvent_LDKSendStfu_Body send_stfu;
-      LDKMessageSendEvent_LDKSendSplice_Body send_splice;
+      LDKMessageSendEvent_LDKSendSpliceInit_Body send_splice_init;
       LDKMessageSendEvent_LDKSendSpliceAck_Body send_splice_ack;
       LDKMessageSendEvent_LDKSendSpliceLocked_Body send_splice_locked;
       LDKMessageSendEvent_LDKSendTxAddInput_Body send_tx_add_input;
@@ -8699,7 +9045,7 @@ typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
 
 /**
  * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * containing a crate::lightning_types::routing::RoutingFees 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_RoutingFeesDecodeErrorZ {
@@ -8880,21 +9226,53 @@ typedef struct LDKCVec_SocketAddressZ {
 
 
 /**
- * Information received in the latest node_announcement from this node.
+ * Non-relayable information received in the latest node_announcement from this node.
  */
-typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
+typedef struct MUST_USE_STRUCT LDKNodeAnnouncementDetails {
    /**
     * 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.
     */
-   LDKnativeNodeAnnouncementInfo *inner;
+   LDKnativeNodeAnnouncementDetails *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;
+} LDKNodeAnnouncementDetails;
+
+/**
+ * Information received in the latest node_announcement from this node.
+ */
+typedef enum LDKNodeAnnouncementInfo_Tag {
+   /**
+    * An initial announcement of the node
+    * Everything else is useful only for sending out for initial routing sync.
+    * Not stored if contains excess data to prevent DoS.
+    */
+   LDKNodeAnnouncementInfo_Relayed,
+   /**
+    * Non-relayable information received in the latest node_announcement from this node.
+    */
+   LDKNodeAnnouncementInfo_Local,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKNodeAnnouncementInfo_Sentinel,
+} LDKNodeAnnouncementInfo_Tag;
+
+typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
+   LDKNodeAnnouncementInfo_Tag tag;
+   union {
+      struct {
+         struct LDKNodeAnnouncement relayed;
+      };
+      struct {
+         struct LDKNodeAnnouncementDetails local;
+      };
+   };
 } LDKNodeAnnouncementInfo;
 
 /**
@@ -8986,6 +9364,33 @@ typedef struct LDKCResult_NodeAliasDecodeErrorZ {
    bool result_ok;
 } LDKCResult_NodeAliasDecodeErrorZ;
 
+/**
+ * An enum which can either contain a crate::lightning::routing::gossip::NodeAnnouncementInfo or not
+ */
+typedef enum LDKCOption_NodeAnnouncementInfoZ_Tag {
+   /**
+    * When we're in this state, this COption_NodeAnnouncementInfoZ contains a crate::lightning::routing::gossip::NodeAnnouncementInfo
+    */
+   LDKCOption_NodeAnnouncementInfoZ_Some,
+   /**
+    * When we're in this state, this COption_NodeAnnouncementInfoZ contains nothing
+    */
+   LDKCOption_NodeAnnouncementInfoZ_None,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKCOption_NodeAnnouncementInfoZ_Sentinel,
+} LDKCOption_NodeAnnouncementInfoZ_Tag;
+
+typedef struct LDKCOption_NodeAnnouncementInfoZ {
+   LDKCOption_NodeAnnouncementInfoZ_Tag tag;
+   union {
+      struct {
+         struct LDKNodeAnnouncementInfo some;
+      };
+   };
+} LDKCOption_NodeAnnouncementInfoZ;
+
 
 
 /**
@@ -9490,10 +9895,9 @@ typedef struct MUST_USE_STRUCT LDKBolt12RefundContext {
 } LDKBolt12RefundContext;
 
 /**
- * The context of an inbound payment, which is included in a [`BlindedPath`] via [`ReceiveTlvs`]
- * and surfaced in [`PaymentPurpose`].
+ * The context of an inbound payment, which is included in a [`BlindedPaymentPath`] via
+ * [`ReceiveTlvs`] and surfaced in [`PaymentPurpose`].
  *
- * [`BlindedPath`]: crate::blinded_path::BlindedPath
  * [`PaymentPurpose`]: crate::events::PaymentPurpose
  */
 typedef enum LDKPaymentContext_Tag {
@@ -9602,33 +10006,6 @@ typedef struct LDKCOption_C2Tuple_u64u16ZZ {
    };
 } LDKCOption_C2Tuple_u64u16ZZ;
 
-/**
- * An enum which can either contain a crate::lightning::ln::channelmanager::ChannelShutdownState or not
- */
-typedef enum LDKCOption_ChannelShutdownStateZ_Tag {
-   /**
-    * When we're in this state, this COption_ChannelShutdownStateZ contains a crate::lightning::ln::channelmanager::ChannelShutdownState
-    */
-   LDKCOption_ChannelShutdownStateZ_Some,
-   /**
-    * When we're in this state, this COption_ChannelShutdownStateZ contains nothing
-    */
-   LDKCOption_ChannelShutdownStateZ_None,
-   /**
-    * Must be last for serialization purposes
-    */
-   LDKCOption_ChannelShutdownStateZ_Sentinel,
-} LDKCOption_ChannelShutdownStateZ_Tag;
-
-typedef struct LDKCOption_ChannelShutdownStateZ {
-   LDKCOption_ChannelShutdownStateZ_Tag tag;
-   union {
-      struct {
-         enum LDKChannelShutdownState some;
-      };
-   };
-} LDKCOption_ChannelShutdownStateZ;
-
 /**
  * The contents of CResult_ChannelIdAPIErrorZ
  */
@@ -10334,6 +10711,160 @@ typedef struct LDKCResult_ThirtyTwoBytesAPIErrorZ {
 
 
 
+/**
+ * A 128-bit number used only once.
+ *
+ * Needed when constructing [`Offer::metadata`] and deriving [`Offer::signing_pubkey`] from
+ * [`ExpandedKey`]. Must not be reused for any other derivation without first hashing.
+ *
+ * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
+ * [`Offer::signing_pubkey`]: crate::offers::offer::Offer::signing_pubkey
+ * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
+ */
+typedef struct MUST_USE_STRUCT LDKNonce {
+   /**
+    * 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.
+    */
+   LDKnativeNonce *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;
+} LDKNonce;
+
+/**
+ * Contains data specific to an [`OffersMessage`].
+ *
+ * [`OffersMessage`]: crate::onion_message::offers::OffersMessage
+ */
+typedef enum LDKOffersContext_Tag {
+   /**
+    * Context used by a [`BlindedMessagePath`] within an [`Offer`].
+    *
+    * This variant is intended to be received when handling an [`InvoiceRequest`].
+    *
+    * [`Offer`]: crate::offers::offer::Offer
+    * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+    */
+   LDKOffersContext_InvoiceRequest,
+   /**
+    * Context used by a [`BlindedMessagePath`] within a [`Refund`] or as a reply path for an
+    * [`InvoiceRequest`].
+    *
+    * This variant is intended to be received when handling a [`Bolt12Invoice`] or an
+    * [`InvoiceError`].
+    *
+    * [`Refund`]: crate::offers::refund::Refund
+    * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+    * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+    * [`InvoiceError`]: crate::offers::invoice_error::InvoiceError
+    */
+   LDKOffersContext_OutboundPayment,
+   /**
+    * Context used by a [`BlindedMessagePath`] as a reply path for a [`Bolt12Invoice`].
+    *
+    * This variant is intended to be received when handling an [`InvoiceError`].
+    *
+    * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+    * [`InvoiceError`]: crate::offers::invoice_error::InvoiceError
+    */
+   LDKOffersContext_InboundPayment,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKOffersContext_Sentinel,
+} LDKOffersContext_Tag;
+
+typedef struct LDKOffersContext_LDKInvoiceRequest_Body {
+   /**
+    * A nonce used for authenticating that an [`InvoiceRequest`] is for a valid [`Offer`] and
+    * for deriving the offer's signing keys.
+    *
+    * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+    * [`Offer`]: crate::offers::offer::Offer
+    */
+   struct LDKNonce nonce;
+} LDKOffersContext_LDKInvoiceRequest_Body;
+
+typedef struct LDKOffersContext_LDKOutboundPayment_Body {
+   /**
+    * Payment ID used when creating a [`Refund`] or [`InvoiceRequest`].
+    *
+    * [`Refund`]: crate::offers::refund::Refund
+    * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+    */
+   struct LDKThirtyTwoBytes payment_id;
+   /**
+    * A nonce used for authenticating that a [`Bolt12Invoice`] is for a valid [`Refund`] or
+    * [`InvoiceRequest`] and for deriving their signing keys.
+    *
+    * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+    * [`Refund`]: crate::offers::refund::Refund
+    * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+    */
+   struct LDKNonce nonce;
+   /**
+    * Authentication code for the [`PaymentId`], which should be checked when the context is
+    * used with an [`InvoiceError`].
+    *
+    * [`InvoiceError`]: crate::offers::invoice_error::InvoiceError
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    */
+   struct LDKThirtyTwoBytes hmac;
+} LDKOffersContext_LDKOutboundPayment_Body;
+
+typedef struct LDKOffersContext_LDKInboundPayment_Body {
+   /**
+    * The same payment hash as [`Bolt12Invoice::payment_hash`].
+    *
+    * [`Bolt12Invoice::payment_hash`]: crate::offers::invoice::Bolt12Invoice::payment_hash
+    */
+   struct LDKThirtyTwoBytes payment_hash;
+} LDKOffersContext_LDKInboundPayment_Body;
+
+typedef struct MUST_USE_STRUCT LDKOffersContext {
+   LDKOffersContext_Tag tag;
+   union {
+      LDKOffersContext_LDKInvoiceRequest_Body invoice_request;
+      LDKOffersContext_LDKOutboundPayment_Body outbound_payment;
+      LDKOffersContext_LDKInboundPayment_Body inbound_payment;
+   };
+} LDKOffersContext;
+
+/**
+ * An enum which can either contain a crate::lightning::blinded_path::message::OffersContext or not
+ */
+typedef enum LDKCOption_OffersContextZ_Tag {
+   /**
+    * When we're in this state, this COption_OffersContextZ contains a crate::lightning::blinded_path::message::OffersContext
+    */
+   LDKCOption_OffersContextZ_Some,
+   /**
+    * When we're in this state, this COption_OffersContextZ contains nothing
+    */
+   LDKCOption_OffersContextZ_None,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKCOption_OffersContextZ_Sentinel,
+} LDKCOption_OffersContextZ_Tag;
+
+typedef struct LDKCOption_OffersContextZ {
+   LDKCOption_OffersContextZ_Tag tag;
+   union {
+      struct {
+         struct LDKOffersContext some;
+      };
+   };
+} LDKCOption_OffersContextZ;
+
+
+
 /**
  * An `InvoiceRequest` is a request for a [`Bolt12Invoice`] formulated from an [`Offer`].
  *
@@ -10424,32 +10955,66 @@ typedef struct MUST_USE_STRUCT LDKOffersMessage {
    };
 } LDKOffersMessage;
 
+
+
+/**
+ * Instructions for how and where to send the response to an onion message.
+ */
+typedef struct MUST_USE_STRUCT LDKResponseInstruction {
+   /**
+    * 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.
+    */
+   LDKnativeResponseInstruction *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;
+} LDKResponseInstruction;
+
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple_OffersMessageResponseInstructionZ {
+   /**
+    * The element at position 0
+    */
+   struct LDKOffersMessage a;
+   /**
+    * The element at position 1
+    */
+   struct LDKResponseInstruction b;
+} LDKC2Tuple_OffersMessageResponseInstructionZ;
+
 /**
- * An enum which can either contain a crate::lightning::onion_message::offers::OffersMessage or not
+ * An enum which can either contain a crate::c_types::derived::C2Tuple_OffersMessageResponseInstructionZ or not
  */
-typedef enum LDKCOption_OffersMessageZ_Tag {
+typedef enum LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Tag {
    /**
-    * When we're in this state, this COption_OffersMessageZ contains a crate::lightning::onion_message::offers::OffersMessage
+    * When we're in this state, this COption_C2Tuple_OffersMessageResponseInstructionZZ contains a crate::c_types::derived::C2Tuple_OffersMessageResponseInstructionZ
     */
-   LDKCOption_OffersMessageZ_Some,
+   LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Some,
    /**
-    * When we're in this state, this COption_OffersMessageZ contains nothing
+    * When we're in this state, this COption_C2Tuple_OffersMessageResponseInstructionZZ contains nothing
     */
-   LDKCOption_OffersMessageZ_None,
+   LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_None,
    /**
     * Must be last for serialization purposes
     */
-   LDKCOption_OffersMessageZ_Sentinel,
-} LDKCOption_OffersMessageZ_Tag;
+   LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Sentinel,
+} LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Tag;
 
-typedef struct LDKCOption_OffersMessageZ {
-   LDKCOption_OffersMessageZ_Tag tag;
+typedef struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ {
+   LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ_Tag tag;
    union {
       struct {
-         struct LDKOffersMessage some;
+         struct LDKC2Tuple_OffersMessageResponseInstructionZ some;
       };
    };
-} LDKCOption_OffersMessageZ;
+} LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ;
 
 /**
  * The destination of an onion message.
@@ -10476,15 +11041,129 @@ typedef struct MUST_USE_STRUCT LDKDestination {
          struct LDKPublicKey node;
       };
       struct {
-         struct LDKBlindedPath blinded_path;
+         struct LDKBlindedMessagePath blinded_path;
       };
    };
 } LDKDestination;
 
 /**
- * A tuple of 3 elements. See the individual fields for the types contained.
+ * Additional data included by the recipient in a [`BlindedMessagePath`].
+ *
+ * This data is encrypted by the recipient and will be given to the corresponding message handler
+ * when handling a message sent over the [`BlindedMessagePath`]. The recipient can use this data to
+ * authenticate the message or for further processing if needed.
  */
-typedef struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ {
+typedef enum LDKMessageContext_Tag {
+   /**
+    * Context specific to an [`OffersMessage`].
+    *
+    * [`OffersMessage`]: crate::onion_message::offers::OffersMessage
+    */
+   LDKMessageContext_Offers,
+   /**
+    * Context specific to a [`CustomOnionMessageHandler::CustomMessage`].
+    *
+    * [`CustomOnionMessageHandler::CustomMessage`]: crate::onion_message::messenger::CustomOnionMessageHandler::CustomMessage
+    */
+   LDKMessageContext_Custom,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKMessageContext_Sentinel,
+} LDKMessageContext_Tag;
+
+typedef struct MUST_USE_STRUCT LDKMessageContext {
+   LDKMessageContext_Tag tag;
+   union {
+      struct {
+         struct LDKOffersContext offers;
+      };
+      struct {
+         struct LDKCVec_u8Z custom;
+      };
+   };
+} LDKMessageContext;
+
+/**
+ * Instructions for how and where to send a message.
+ */
+typedef enum LDKMessageSendInstructions_Tag {
+   /**
+    * Indicates that a message should be sent including the provided reply path for the recipient
+    * to respond.
+    */
+   LDKMessageSendInstructions_WithSpecifiedReplyPath,
+   /**
+    * Indicates that a message should be sent including a reply path for the recipient to
+    * respond.
+    */
+   LDKMessageSendInstructions_WithReplyPath,
+   /**
+    * Indicates that a message should be sent without including a reply path, preventing the
+    * recipient from responding.
+    */
+   LDKMessageSendInstructions_WithoutReplyPath,
+   /**
+    * Indicates that a message is being sent as a reply to a received message.
+    */
+   LDKMessageSendInstructions_ForReply,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKMessageSendInstructions_Sentinel,
+} LDKMessageSendInstructions_Tag;
+
+typedef struct LDKMessageSendInstructions_LDKWithSpecifiedReplyPath_Body {
+   /**
+    * The destination where we need to send our message.
+    */
+   struct LDKDestination destination;
+   /**
+    * The reply path which should be included in the message.
+    */
+   struct LDKBlindedMessagePath reply_path;
+} LDKMessageSendInstructions_LDKWithSpecifiedReplyPath_Body;
+
+typedef struct LDKMessageSendInstructions_LDKWithReplyPath_Body {
+   /**
+    * The destination where we need to send our message.
+    */
+   struct LDKDestination destination;
+   /**
+    * The context to include in the reply path we'll give the recipient so they can respond
+    * to us.
+    */
+   struct LDKMessageContext context;
+} LDKMessageSendInstructions_LDKWithReplyPath_Body;
+
+typedef struct LDKMessageSendInstructions_LDKWithoutReplyPath_Body {
+   /**
+    * The destination where we need to send our message.
+    */
+   struct LDKDestination destination;
+} LDKMessageSendInstructions_LDKWithoutReplyPath_Body;
+
+typedef struct LDKMessageSendInstructions_LDKForReply_Body {
+   /**
+    * The instructions provided by the [`Responder`].
+    */
+   struct LDKResponseInstruction instructions;
+} LDKMessageSendInstructions_LDKForReply_Body;
+
+typedef struct MUST_USE_STRUCT LDKMessageSendInstructions {
+   LDKMessageSendInstructions_Tag tag;
+   union {
+      LDKMessageSendInstructions_LDKWithSpecifiedReplyPath_Body with_specified_reply_path;
+      LDKMessageSendInstructions_LDKWithReplyPath_Body with_reply_path;
+      LDKMessageSendInstructions_LDKWithoutReplyPath_Body without_reply_path;
+      LDKMessageSendInstructions_LDKForReply_Body for_reply;
+   };
+} LDKMessageSendInstructions;
+
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ {
    /**
     * The element at position 0
     */
@@ -10492,168 +11171,170 @@ typedef struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ {
    /**
     * The element at position 1
     */
-   struct LDKDestination b;
-   /**
-    * The element at position 2
-    */
-   struct LDKBlindedPath c;
-} LDKC3Tuple_OffersMessageDestinationBlindedPathZ;
+   struct LDKMessageSendInstructions b;
+} LDKC2Tuple_OffersMessageMessageSendInstructionsZ;
 
 /**
- * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OffersMessageDestinationBlindedPathZs of arbitrary size.
+ * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OffersMessageMessageSendInstructionsZs of arbitrary size.
  * This corresponds to std::vector in C++
  */
-typedef struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ {
+typedef struct LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ {
    /**
     * The elements in the array.
     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
     */
-   struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *data;
+   struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ *data;
    /**
     * The number of elements pointed to by `data`.
     */
    uintptr_t datalen;
-} LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ;
+} LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ;
 
 
 
 /**
- * Information needed for constructing an invoice route hint for this channel.
+ * Releases the HTLC corresponding to an inbound [`HeldHtlcAvailable`] message.
  */
-typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
+typedef struct MUST_USE_STRUCT LDKReleaseHeldHtlc {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeCounterpartyForwardingInfo *inner;
+   LDKnativeReleaseHeldHtlc *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKCounterpartyForwardingInfo;
+} LDKReleaseHeldHtlc;
 
 /**
- * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
+ * A tuple of 2 elements. See the individual fields for the types contained.
  */
-typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
+typedef struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * The element at position 0
     */
-   struct LDKCounterpartyForwardingInfo *result;
+   struct LDKReleaseHeldHtlc a;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * The element at position 1
     */
-   struct LDKDecodeError *err;
-} LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
+   struct LDKResponseInstruction b;
+} LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ;
 
 /**
- * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ * An enum which can either contain a crate::c_types::derived::C2Tuple_ReleaseHeldHtlcResponseInstructionZ or not
  */
-typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
+typedef enum LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Tag {
    /**
-    * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * When we're in this state, this COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ contains a crate::c_types::derived::C2Tuple_ReleaseHeldHtlcResponseInstructionZ
     */
-   union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
+   LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Some,
    /**
-    * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
+    * When we're in this state, this COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ contains nothing
     */
-   bool result_ok;
-} LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
+   LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_None,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Sentinel,
+} LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Tag;
+
+typedef struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ {
+   LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_Tag tag;
+   union {
+      struct {
+         struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ some;
+      };
+   };
+} LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ;
 
 
 
 /**
- * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
- * to better separate parameters.
+ * An HTLC destined for the recipient of this message is being held upstream. The reply path
+ * accompanying this onion message should be used to send a [`ReleaseHeldHtlc`] response, which
+ * will cause the upstream HTLC to be released.
  */
-typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
+typedef struct MUST_USE_STRUCT LDKHeldHtlcAvailable {
    /**
     * 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;
+   LDKnativeHeldHtlcAvailable *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;
+} LDKHeldHtlcAvailable;
 
 /**
- * The contents of CResult_ChannelCounterpartyDecodeErrorZ
+ * Possible async payment messages sent and received via an [`OnionMessage`].
+ *
+ * [`OnionMessage`]: crate::ln::msgs::OnionMessage
  */
-typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
+typedef enum LDKAsyncPaymentsMessage_Tag {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * An HTLC is being held upstream for the often-offline recipient, to be released via
+    * [`ReleaseHeldHtlc`].
     */
-   struct LDKChannelCounterparty *result;
+   LDKAsyncPaymentsMessage_HeldHtlcAvailable,
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * Releases the HTLC corresponding to an inbound [`HeldHtlcAvailable`] message.
     */
-   struct LDKDecodeError *err;
-} LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
-
-/**
- * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
+   LDKAsyncPaymentsMessage_ReleaseHeldHtlc,
    /**
-    * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
-    */
-   union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
-   /**
-    * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
+    * Must be last for serialization purposes
     */
-   bool result_ok;
-} LDKCResult_ChannelCounterpartyDecodeErrorZ;
+   LDKAsyncPaymentsMessage_Sentinel,
+} LDKAsyncPaymentsMessage_Tag;
+
+typedef struct MUST_USE_STRUCT LDKAsyncPaymentsMessage {
+   LDKAsyncPaymentsMessage_Tag tag;
+   union {
+      struct {
+         struct LDKHeldHtlcAvailable held_htlc_available;
+      };
+      struct {
+         struct LDKReleaseHeldHtlc release_held_htlc;
+      };
+   };
+} LDKAsyncPaymentsMessage;
 
 /**
- * The contents of CResult_ChannelDetailsDecodeErrorZ
+ * A tuple of 2 elements. See the individual fields for the types contained.
  */
-typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
+typedef struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * The element at position 0
     */
-   struct LDKChannelDetails *result;
+   struct LDKAsyncPaymentsMessage a;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * The element at position 1
     */
-   struct LDKDecodeError *err;
-} LDKCResult_ChannelDetailsDecodeErrorZPtr;
+   struct LDKMessageSendInstructions b;
+} LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ;
 
 /**
- * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ * A dynamically-allocated array of crate::c_types::derived::C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZs of arbitrary size.
+ * This corresponds to std::vector in C++
  */
-typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
+typedef struct LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ {
    /**
-    * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
     */
-   union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
+   struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *data;
    /**
-    * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
+    * The number of elements pointed to by `data`.
     */
-   bool result_ok;
-} LDKCResult_ChannelDetailsDecodeErrorZ;
+   uintptr_t datalen;
+} LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ;
 
 
 
@@ -11053,39 +11734,6 @@ typedef struct LDKCResult_BlindedFailureDecodeErrorZ {
    bool result_ok;
 } LDKCResult_BlindedFailureDecodeErrorZ;
 
-/**
- * The contents of CResult_ChannelShutdownStateDecodeErrorZ
- */
-typedef union LDKCResult_ChannelShutdownStateDecodeErrorZPtr {
-   /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
-    */
-   enum LDKChannelShutdownState *result;
-   /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
-    */
-   struct LDKDecodeError *err;
-} LDKCResult_ChannelShutdownStateDecodeErrorZPtr;
-
-/**
- * A CResult_ChannelShutdownStateDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::channelmanager::ChannelShutdownState on success and a crate::lightning::ln::msgs::DecodeError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_ChannelShutdownStateDecodeErrorZ {
-   /**
-    * The contents of this CResult_ChannelShutdownStateDecodeErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
-    */
-   union LDKCResult_ChannelShutdownStateDecodeErrorZPtr contents;
-   /**
-    * Whether this CResult_ChannelShutdownStateDecodeErrorZ represents a success state.
-    */
-   bool result_ok;
-} LDKCResult_ChannelShutdownStateDecodeErrorZ;
-
 
 
 /**
@@ -11302,6 +11950,30 @@ typedef struct LDKEntropySource {
 
 
 
+/**
+ * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network,
+ * but without the signature information.
+ * Decoding and encoding should not lead to information loss but may lead to different hashes.
+ *
+ * For methods without docs see the corresponding methods in [`Bolt11Invoice`].
+ */
+typedef struct MUST_USE_STRUCT LDKRawBolt11Invoice {
+   /**
+    * 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.
+    */
+   LDKnativeRawBolt11Invoice *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;
+} LDKRawBolt11Invoice;
+
+
+
 /**
  * A semantically valid [`InvoiceRequest`] that hasn't been signed.
  *
@@ -11460,7 +12132,7 @@ typedef struct LDKNodeSigner {
     *
     * Errors if the [`Recipient`] variant is not supported by the implementation.
     */
-   struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient);
+   struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, const struct LDKRawBolt11Invoice *NONNULL_PTR invoice, enum LDKRecipient recipient);
    /**
     * Signs the [`TaggedHash`] of a BOLT 12 invoice request.
     *
@@ -11531,11 +12203,11 @@ typedef struct LDKSignerProvider {
     * re-derived from its `channel_keys_id`, which can be obtained through its trait method
     * [`ChannelSigner::channel_keys_id`].
     */
-   struct LDKWriteableEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
+   struct LDKEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
    /**
     * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
     * This is only called during deserialization of other objects which contain
-    * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
+    * [`EcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
     * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
     * contain no versioning scheme. You may wish to include your own version prefix and ensure
     * you've read all of the provided bytes to ensure no corruption occurred.
@@ -11547,7 +12219,7 @@ typedef struct LDKSignerProvider {
     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
     */
-   struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
+   struct LDKCResult_EcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
    /**
     * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
     *
@@ -11651,10 +12323,26 @@ typedef struct LDKMessageRouter {
     */
    struct LDKCResult_OnionMessagePathNoneZ (*find_path)(const void *this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination);
    /**
-    * Creates [`BlindedPath`]s to the `recipient` node. The nodes in `peers` are assumed to be
-    * direct peers with the `recipient`.
+    * Creates [`BlindedMessagePath`]s to the `recipient` node. The nodes in `peers` are assumed to
+    * be direct peers with the `recipient`.
     */
-   struct LDKCResult_CVec_BlindedPathZNoneZ (*create_blinded_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKCVec_PublicKeyZ peers);
+   struct LDKCResult_CVec_BlindedMessagePathZNoneZ (*create_blinded_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKMessageContext context, struct LDKCVec_PublicKeyZ peers);
+   /**
+    * Creates compact [`BlindedMessagePath`]s to the `recipient` node. The nodes in `peers` are
+    * assumed to be direct peers with the `recipient`.
+    *
+    * Compact blinded paths use short channel ids instead of pubkeys for a smaller serialization,
+    * which is beneficial when a QR code is used to transport the data. The SCID is passed using
+    * a [`MessageForwardNode`] but may be `None` for graceful degradation.
+    *
+    * Implementations using additional intermediate nodes are responsible for using a
+    * [`MessageForwardNode`] with `Some` short channel id, if possible. Similarly, implementations
+    * should call [`BlindedMessagePath::use_compact_introduction_node`].
+    *
+    * The provided implementation simply delegates to [`MessageRouter::create_blinded_paths`],
+    * ignoring the short channel ids.
+    */
+   struct LDKCResult_CVec_BlindedMessagePathZNoneZ (*create_compact_blinded_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKMessageContext context, struct LDKCVec_MessageForwardNodeZ peers);
    /**
     * 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.
@@ -11693,11 +12381,11 @@ typedef struct LDKRouter {
     */
    struct LDKCResult_RouteLightningErrorZ (*find_route_with_id)(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKInFlightHtlcs inflight_htlcs, struct LDKThirtyTwoBytes _payment_hash, struct LDKThirtyTwoBytes _payment_id);
    /**
-    * Creates [`BlindedPath`]s for payment to the `recipient` node. The channels in `first_hops`
+    * Creates [`BlindedPaymentPath`]s for payment to the `recipient` node. The channels in `first_hops`
     * are assumed to be with the `recipient`'s peers. The payment secret and any constraints are
     * given in `tlvs`.
     */
-   struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ (*create_blinded_payment_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKCVec_ChannelDetailsZ first_hops, struct LDKReceiveTlvs tlvs, uint64_t amount_msats);
+   struct LDKCResult_CVec_BlindedPaymentPathZNoneZ (*create_blinded_payment_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKCVec_ChannelDetailsZ first_hops, struct LDKReceiveTlvs tlvs, uint64_t amount_msats);
    /**
     * Implementation of MessageRouter for this object.
     */
@@ -11764,7 +12452,7 @@ typedef struct LDKRouter {
  *
  * ```
  * use bitcoin::BlockHash;
- * use bitcoin::network::constants::Network;
+ * use bitcoin::network::Network;
  * use lightning::chain::BestBlock;
  * # use lightning::chain::channelmonitor::ChannelMonitor;
  * use lightning::ln::channelmanager::{ChainParameters, ChannelManager, ChannelManagerReadArgs};
@@ -11899,35 +12587,38 @@ typedef struct LDKRouter {
  * }
  *
  * // On the event processing thread once the peer has responded
- * channel_manager.process_pending_events(&|event| match event {
- *     Event::FundingGenerationReady {
- *         temporary_channel_id, counterparty_node_id, channel_value_satoshis, output_script,
- *         user_channel_id, ..
- *     } => {
- *         assert_eq!(user_channel_id, 42);
- *         let funding_transaction = wallet.create_funding_transaction(
- *             channel_value_satoshis, output_script
- *         );
- *         match channel_manager.funding_transaction_generated(
- *             &temporary_channel_id, &counterparty_node_id, funding_transaction
- *         ) {
- *             Ok(()) => println!(\"Funding channel {}\", temporary_channel_id),
- *             Err(e) => println!(\"Error funding channel {}: {:?}\", temporary_channel_id, e),
- *         }
- *     },
- *     Event::ChannelPending { channel_id, user_channel_id, former_temporary_channel_id, .. } => {
- *         assert_eq!(user_channel_id, 42);
- *         println!(
- *             \"Channel {} now {} pending (funding transaction has been broadcasted)\", channel_id,
- *             former_temporary_channel_id.unwrap()
- *         );
- *     },
- *     Event::ChannelReady { channel_id, user_channel_id, .. } => {
- *         assert_eq!(user_channel_id, 42);
- *         println!(\"Channel {} ready\", channel_id);
- *     },
- *     // ...
- * #     _ => {},
+ * channel_manager.process_pending_events(&|event| {
+ *     match event {
+ *         Event::FundingGenerationReady {
+ *             temporary_channel_id, counterparty_node_id, channel_value_satoshis, output_script,
+ *             user_channel_id, ..
+ *         } => {
+ *             assert_eq!(user_channel_id, 42);
+ *             let funding_transaction = wallet.create_funding_transaction(
+ *                 channel_value_satoshis, output_script
+ *             );
+ *             match channel_manager.funding_transaction_generated(
+ *                 temporary_channel_id, counterparty_node_id, funding_transaction
+ *             ) {
+ *                 Ok(()) => println!(\"Funding channel {}\", temporary_channel_id),
+ *                 Err(e) => println!(\"Error funding channel {}: {:?}\", temporary_channel_id, e),
+ *             }
+ *         },
+ *         Event::ChannelPending { channel_id, user_channel_id, former_temporary_channel_id, .. } => {
+ *             assert_eq!(user_channel_id, 42);
+ *             println!(
+ *                 \"Channel {} now {} pending (funding transaction has been broadcasted)\", channel_id,
+ *                 former_temporary_channel_id.unwrap()
+ *             );
+ *         },
+ *         Event::ChannelReady { channel_id, user_channel_id, .. } => {
+ *             assert_eq!(user_channel_id, 42);
+ *             println!(\"Channel {} ready\", channel_id);
+ *         },
+ *         // ...
+ *     #     _ => {},
+ *     }
+ *     Ok(())
  * });
  * # }
  * ```
@@ -11950,28 +12641,32 @@ typedef struct LDKRouter {
  * #
  * # fn example<T: AChannelManager>(channel_manager: T) {
  * # let channel_manager = channel_manager.get_cm();
- * channel_manager.process_pending_events(&|event| match event {
- *     Event::OpenChannelRequest { temporary_channel_id, counterparty_node_id, ..  } => {
- *         if !is_trusted(counterparty_node_id) {
- *             match channel_manager.force_close_without_broadcasting_txn(
- *                 &temporary_channel_id, &counterparty_node_id
- *             ) {
- *                 Ok(()) => println!(\"Rejecting channel {}\", temporary_channel_id),
- *                 Err(e) => println!(\"Error rejecting channel {}: {:?}\", temporary_channel_id, e),
+ * # let error_message = \"Channel force-closed\";
+ * channel_manager.process_pending_events(&|event| {
+ *     match event {
+ *         Event::OpenChannelRequest { temporary_channel_id, counterparty_node_id, ..  } => {
+ *             if !is_trusted(counterparty_node_id) {
+ *                 match channel_manager.force_close_without_broadcasting_txn(
+ *                     &temporary_channel_id, &counterparty_node_id, error_message.to_string()
+ *                 ) {
+ *                     Ok(()) => println!(\"Rejecting channel {}\", temporary_channel_id),
+ *                     Err(e) => println!(\"Error rejecting channel {}: {:?}\", temporary_channel_id, e),
+ *                 }
+ *                 return Ok(());
  *             }
- *             return;
- *         }
  *
- *         let user_channel_id = 43;
- *         match channel_manager.accept_inbound_channel(
- *             &temporary_channel_id, &counterparty_node_id, user_channel_id
- *         ) {
- *             Ok(()) => println!(\"Accepting channel {}\", temporary_channel_id),
- *             Err(e) => println!(\"Error accepting channel {}: {:?}\", temporary_channel_id, e),
- *         }
- *     },
- *     // ...
- * #     _ => {},
+ *             let user_channel_id = 43;
+ *             match channel_manager.accept_inbound_channel(
+ *                 &temporary_channel_id, &counterparty_node_id, user_channel_id
+ *             ) {
+ *                 Ok(()) => println!(\"Accepting channel {}\", temporary_channel_id),
+ *                 Err(e) => println!(\"Error accepting channel {}: {:?}\", temporary_channel_id, e),
+ *             }
+ *         },
+ *         // ...
+ *     #     _ => {},
+ *     }
+ *     Ok(())
  * });
  * # }
  * ```
@@ -12000,13 +12695,16 @@ typedef struct LDKRouter {
  * }
  *
  * // On the event processing thread
- * channel_manager.process_pending_events(&|event| match event {
- *     Event::ChannelClosed { channel_id, user_channel_id, ..  } => {
- *         assert_eq!(user_channel_id, 42);
- *         println!(\"Channel {} closed\", channel_id);
- *     },
- *     // ...
- * #     _ => {},
+ * channel_manager.process_pending_events(&|event| {
+ *     match event {
+ *         Event::ChannelClosed { channel_id, user_channel_id, ..  } => {
+ *             assert_eq!(user_channel_id, 42);
+ *             println!(\"Channel {} closed\", channel_id);
+ *         },
+ *         // ...
+ *     #     _ => {},
+ *     }
+ *     Ok(())
  * });
  * # }
  * ```
@@ -12056,30 +12754,33 @@ typedef struct LDKRouter {
  * };
  *
  * // On the event processing thread
- * channel_manager.process_pending_events(&|event| match event {
- *     Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
- *         PaymentPurpose::Bolt11InvoicePayment { payment_preimage: Some(payment_preimage), .. } => {
- *             assert_eq!(payment_hash, known_payment_hash);
- *             println!(\"Claiming payment {}\", payment_hash);
- *             channel_manager.claim_funds(payment_preimage);
+ * channel_manager.process_pending_events(&|event| {
+ *     match event {
+ *         Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
+ *             PaymentPurpose::Bolt11InvoicePayment { payment_preimage: Some(payment_preimage), .. } => {
+ *                 assert_eq!(payment_hash, known_payment_hash);
+ *                 println!(\"Claiming payment {}\", payment_hash);
+ *                 channel_manager.claim_funds(payment_preimage);
+ *             },
+ *             PaymentPurpose::Bolt11InvoicePayment { payment_preimage: None, .. } => {
+ *                 println!(\"Unknown payment hash: {}\", payment_hash);
+ *             },
+ *             PaymentPurpose::SpontaneousPayment(payment_preimage) => {
+ *                 assert_ne!(payment_hash, known_payment_hash);
+ *                 println!(\"Claiming spontaneous payment {}\", payment_hash);
+ *                 channel_manager.claim_funds(payment_preimage);
+ *             },
+ *             // ...
+ * #           _ => {},
  *         },
- *         PaymentPurpose::Bolt11InvoicePayment { payment_preimage: None, .. } => {
- *             println!(\"Unknown payment hash: {}\", payment_hash);
- *         },
- *         PaymentPurpose::SpontaneousPayment(payment_preimage) => {
- *             assert_ne!(payment_hash, known_payment_hash);
- *             println!(\"Claiming spontaneous payment {}\", payment_hash);
- *             channel_manager.claim_funds(payment_preimage);
+ *         Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
+ *             assert_eq!(payment_hash, known_payment_hash);
+ *             println!(\"Claimed {} msats\", amount_msat);
  *         },
  *         // ...
- * #         _ => {},
- *     },
- *     Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
- *         assert_eq!(payment_hash, known_payment_hash);
- *         println!(\"Claimed {} msats\", amount_msat);
- *     },
- *     // ...
- * #     _ => {},
+ * #       _ => {},
+ *     }
+ *     Ok(())
  * });
  * # }
  * ```
@@ -12122,11 +12823,15 @@ typedef struct LDKRouter {
  * );
  *
  * // On the event processing thread
- * channel_manager.process_pending_events(&|event| match event {
- *     Event::PaymentSent { payment_hash, .. } => println!(\"Paid {}\", payment_hash),
- *     Event::PaymentFailed { payment_hash, .. } => println!(\"Failed paying {}\", payment_hash),
- *     // ...
- * #     _ => {},
+ * channel_manager.process_pending_events(&|event| {
+ *     match event {
+ *         Event::PaymentSent { payment_hash, .. } => println!(\"Paid {}\", payment_hash),
+ *         Event::PaymentFailed { payment_hash: Some(payment_hash), .. } =>
+ *             println!(\"Failed paying {}\", payment_hash),
+ *         // ...
+ *     #     _ => {},
+ *     }
+ *     Ok(())
  * });
  * # }
  * ```
@@ -12147,8 +12852,9 @@ typedef struct LDKRouter {
  * #
  * # fn example<T: AChannelManager>(channel_manager: T) -> Result<(), Bolt12SemanticError> {
  * # let channel_manager = channel_manager.get_cm();
+ * # let absolute_expiry = None;
  * let offer = channel_manager
- *     .create_offer_builder()?
+ *     .create_offer_builder(absolute_expiry)?
  * # ;
  * # // Needed for compiling for c_bindings
  * # let builder: lightning::offers::offer::OfferBuilder<_, _> = offer.into();
@@ -12159,31 +12865,32 @@ typedef struct LDKRouter {
  * let bech32_offer = offer.to_string();
  *
  * // On the event processing thread
- * channel_manager.process_pending_events(&|event| match event {
- *     Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
- *         PaymentPurpose::Bolt12OfferPayment { payment_preimage: Some(payment_preimage), .. } => {
- *             println!(\"Claiming payment {}\", payment_hash);
- *             channel_manager.claim_funds(payment_preimage);
+ * channel_manager.process_pending_events(&|event| {
+ *     match event {
+ *         Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
+ *             PaymentPurpose::Bolt12OfferPayment { payment_preimage: Some(payment_preimage), .. } => {
+ *                 println!(\"Claiming payment {}\", payment_hash);
+ *                 channel_manager.claim_funds(payment_preimage);
+ *             },
+ *             PaymentPurpose::Bolt12OfferPayment { payment_preimage: None, .. } => {
+ *                 println!(\"Unknown payment hash: {}\", payment_hash);
+ *             }
+ * #           _ => {},
  *         },
- *         PaymentPurpose::Bolt12OfferPayment { payment_preimage: None, .. } => {
- *             println!(\"Unknown payment hash: {}\", payment_hash);
+ *         Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
+ *             println!(\"Claimed {} msats\", amount_msat);
  *         },
  *         // ...
- * #         _ => {},
- *     },
- *     Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
- *         println!(\"Claimed {} msats\", amount_msat);
- *     },
- *     // ...
- * #     _ => {},
+ *     #     _ => {},
+ *     }
+ *     Ok(())
  * });
  * # Ok(())
  * # }
  * ```
  *
  * Use [`pay_for_offer`] to initiated payment, which sends an [`InvoiceRequest`] for an [`Offer`]
- * and pays the [`Bolt12Invoice`] response. In addition to success and failure events,
- * [`ChannelManager`] may also generate an [`Event::InvoiceRequestFailed`].
+ * and pays the [`Bolt12Invoice`] response.
  *
  * ```
  * # use lightning::events::{Event, EventsProvider};
@@ -12221,12 +12928,14 @@ typedef struct LDKRouter {
  * );
  *
  * // On the event processing thread
- * channel_manager.process_pending_events(&|event| match event {
- *     Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id),
- *     Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
- *     Event::InvoiceRequestFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
- *     // ...
- * #     _ => {},
+ * channel_manager.process_pending_events(&|event| {
+ *     match event {
+ *         Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id),
+ *         Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
+ *         // ...
+ *     #     _ => {},
+ *     }
+ *     Ok(())
  * });
  * # }
  * ```
@@ -12281,11 +12990,14 @@ typedef struct LDKRouter {
  * );
  *
  * // On the event processing thread
- * channel_manager.process_pending_events(&|event| match event {
- *     Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id),
- *     Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
- *     // ...
- * #     _ => {},
+ * channel_manager.process_pending_events(&|event| {
+ *     match event {
+ *         Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id),
+ *         Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
+ *         // ...
+ *     #     _ => {},
+ *     }
+ *     Ok(())
  * });
  * # Ok(())
  * # }
@@ -12311,18 +13023,19 @@ typedef struct LDKRouter {
  * };
  *
  * // On the event processing thread
- * channel_manager.process_pending_events(&|event| match event {
- *     Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
- *     \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: Some(payment_preimage), .. } => {
- *             assert_eq!(payment_hash, known_payment_hash);
- *             println!(\"Claiming payment {}\", payment_hash);
- *             channel_manager.claim_funds(payment_preimage);
- *         },
- *     \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: None, .. } => {
- *             println!(\"Unknown payment hash: {}\", payment_hash);
- *     \t},
- *         // ...
- * #         _ => {},
+ * channel_manager.process_pending_events(&|event| {
+ *     match event {
+ *         Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
+ *             PaymentPurpose::Bolt12RefundPayment { payment_preimage: Some(payment_preimage), .. } => {
+ *                 assert_eq!(payment_hash, known_payment_hash);
+ *                 println!(\"Claiming payment {}\", payment_hash);
+ *                 channel_manager.claim_funds(payment_preimage);
+ *             },
+ *             PaymentPurpose::Bolt12RefundPayment { payment_preimage: None, .. } => {
+ *                 println!(\"Unknown payment hash: {}\", payment_hash);
+ *             },
+ *             // ...
+ * #           _ => {},
  *     },
  *     Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
  *         assert_eq!(payment_hash, known_payment_hash);
@@ -12330,6 +13043,8 @@ typedef struct LDKRouter {
  *     },
  *     // ...
  * #     _ => {},
+ *     }
+ *     Ok(())
  * });
  * # }
  * ```
@@ -12503,17 +13218,17 @@ typedef enum LDKMaxDustHTLCExposure_Tag {
     */
    LDKMaxDustHTLCExposure_FixedLimitMsat,
    /**
-    * This sets a multiplier on the [`ConfirmationTarget::OnChainSweep`] feerate (in sats/KW) to
-    * determine the maximum allowed dust exposure. If this variant is used then the maximum dust
-    * exposure in millisatoshis is calculated as:
+    * This sets a multiplier on the [`ConfirmationTarget::MaximumFeeEstimate`] feerate (in
+    * sats/KW) to determine the maximum allowed dust exposure. If this variant is used then the
+    * maximum dust exposure in millisatoshis is calculated as:
     * `feerate_per_kw * value`. For example, with our default value
     * `FeeRateMultiplier(10_000)`:
     *
     * - For the minimum fee rate of 1 sat/vByte (250 sat/KW, although the minimum
-    * defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
-    * be 253 * 10_000 = 2,530,000 msats.
+    *   defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
+    *   be 253 * 10_000 = 2,530,000 msats.
     * - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be
-    * 7500 * 50_000 = 75,000,000 msats (0.00075 BTC).
+    *   7500 * 50_000 = 75,000,000 msats (0.00075 BTC).
     *
     * Note, if you're using a third-party fee estimator, this may leave you more exposed to a
     * fee griefing attack, where your fee estimator may purposely overestimate the fee rate,
@@ -12528,7 +13243,7 @@ typedef enum LDKMaxDustHTLCExposure_Tag {
     * by default this will be set to a [`Self::FixedLimitMsat`] of 5,000,000 msat.
     *
     * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
-    * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
+    * [`ConfirmationTarget::MaximumFeeEstimate`]: crate::chain::chaininterface::ConfirmationTarget::MaximumFeeEstimate
     */
    LDKMaxDustHTLCExposure_FeeRateMultiplier,
    /**
@@ -12923,6 +13638,62 @@ typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ {
    uintptr_t datalen;
 } LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ;
 
+
+
+/**
+ * An error type that may be returned to LDK in order to safely abort event handling if it can't
+ * currently succeed (e.g., due to a persistence failure).
+ *
+ * Depending on the type, LDK may ensure the event is persisted and will eventually be replayed.
+ * Please refer to the documentation of each [`Event`] variant for more details.
+ */
+typedef struct MUST_USE_STRUCT LDKReplayEvent {
+   /**
+    * 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.
+    */
+   LDKnativeReplayEvent *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;
+} LDKReplayEvent;
+
+/**
+ * The contents of CResult_NoneReplayEventZ
+ */
+typedef union LDKCResult_NoneReplayEventZPtr {
+   /**
+    * 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 LDKReplayEvent *err;
+} LDKCResult_NoneReplayEventZPtr;
+
+/**
+ * A CResult_NoneReplayEventZ represents the result of a fallible operation,
+ * containing a () on success and a crate::lightning::events::ReplayEvent on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_NoneReplayEventZ {
+   /**
+    * The contents of this CResult_NoneReplayEventZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_NoneReplayEventZPtr contents;
+   /**
+    * Whether this CResult_NoneReplayEventZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_NoneReplayEventZ;
+
 /**
  * A dynamically-allocated array of crate::lightning::ln::chan_utils::CommitmentTransactions of arbitrary size.
  * This corresponds to std::vector in C++
@@ -13059,6 +13830,59 @@ typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
     * required to do so.
     */
    uint64_t amount_satoshis;
+   /**
+    * The transaction fee we pay for the closing commitment transaction. This amount is not
+    * included in the [`Balance::ClaimableOnChannelClose::amount_satoshis`] value.
+    *
+    * Note that if this channel is inbound (and thus our counterparty pays the commitment
+    * transaction fee) this value will be zero. For [`ChannelMonitor`]s created prior to LDK
+    * 0.0.124, the channel is always treated as outbound (and thus this value is never zero).
+    */
+   uint64_t transaction_fee_satoshis;
+   /**
+    * The amount of millisatoshis which has been burned to fees from HTLCs which are outbound
+    * from us and are related to a payment which was sent by us. This is the sum of the
+    * millisatoshis part of all HTLCs which are otherwise represented by
+    * [`Balance::MaybeTimeoutClaimableHTLC`] with their
+    * [`Balance::MaybeTimeoutClaimableHTLC::outbound_payment`] flag set, as well as any dust
+    * HTLCs which would otherwise be represented the same.
+    *
+    * This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`.
+    */
+   uint64_t outbound_payment_htlc_rounded_msat;
+   /**
+    * The amount of millisatoshis which has been burned to fees from HTLCs which are outbound
+    * from us and are related to a forwarded HTLC. This is the sum of the millisatoshis part
+    * of all HTLCs which are otherwise represented by [`Balance::MaybeTimeoutClaimableHTLC`]
+    * with their [`Balance::MaybeTimeoutClaimableHTLC::outbound_payment`] flag *not* set, as
+    * well as any dust HTLCs which would otherwise be represented the same.
+    *
+    * This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`.
+    */
+   uint64_t outbound_forwarded_htlc_rounded_msat;
+   /**
+    * The amount of millisatoshis which has been burned to fees from HTLCs which are inbound
+    * to us and for which we know the preimage. This is the sum of the millisatoshis part of
+    * all HTLCs which would be represented by [`Balance::ContentiousClaimable`] on channel
+    * close, but whose current value is included in
+    * [`Balance::ClaimableOnChannelClose::amount_satoshis`], as well as any dust HTLCs which
+    * would otherwise be represented the same.
+    *
+    * This amount (rounded up to a whole satoshi value) will not be included in the counterparty's
+    * `amount_satoshis`.
+    */
+   uint64_t inbound_claiming_htlc_rounded_msat;
+   /**
+    * The amount of millisatoshis which has been burned to fees from HTLCs which are inbound
+    * to us and for which we do not know the preimage. This is the sum of the millisatoshis
+    * part of all HTLCs which would be represented by [`Balance::MaybePreimageClaimableHTLC`]
+    * on channel close, as well as any dust HTLCs which would otherwise be represented the
+    * same.
+    *
+    * This amount (rounded up to a whole satoshi value) will not be included in the counterparty's
+    * `amount_satoshis`.
+    */
+   uint64_t inbound_htlc_rounded_msat;
 } LDKBalance_LDKClaimableOnChannelClose_Body;
 
 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
@@ -13072,6 +13896,10 @@ typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
     * amount.
     */
    uint32_t confirmation_height;
+   /**
+    * Whether this balance is a result of cooperative close, a force-close, or an HTLC.
+    */
+   enum LDKBalanceSource source;
 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
 
 typedef struct LDKBalance_LDKContentiousClaimable_Body {
@@ -13110,6 +13938,12 @@ typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
     * The payment hash whose preimage our counterparty needs to claim this HTLC.
     */
    struct LDKThirtyTwoBytes payment_hash;
+   /**
+    * Whether this HTLC represents a payment which was sent outbound from us. Otherwise it
+    * represents an HTLC which was forwarded (and should, thus, have a corresponding inbound
+    * edge on another channel).
+    */
+   bool outbound_payment;
 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
 
 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
@@ -13280,36 +14114,6 @@ typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
    uintptr_t datalen;
 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
 
-/**
- * A tuple of 2 elements. See the individual fields for the types contained.
- */
-typedef struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ {
-   /**
-    * The element at position 0
-    */
-   struct LDKPublicKey a;
-   /**
-    * The element at position 1
-    */
-   struct LDKCVec_SocketAddressZ b;
-} LDKC2Tuple_PublicKeyCVec_SocketAddressZZ;
-
-/**
- * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCVec_SocketAddressZZs of arbitrary size.
- * This corresponds to std::vector in C++
- */
-typedef struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ {
-   /**
-    * The elements in the array.
-    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
-    */
-   struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *data;
-   /**
-    * The number of elements pointed to by `data`.
-    */
-   uintptr_t datalen;
-} LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ;
-
 /**
  * The contents of an onion message.
  */
@@ -13323,6 +14127,10 @@ typedef struct LDKOnionMessageContents {
     * Returns the TLV type identifying the message contents. MUST be >= 64.
     */
    uint64_t (*tlv_type)(const void *this_arg);
+   /**
+    * Returns the message type
+    */
+   struct LDKStr (*msg_type)(const void *this_arg);
    /**
     * Serialize the object into a byte array
     */
@@ -13344,6 +14152,47 @@ typedef struct LDKOnionMessageContents {
    void (*free)(void *this_arg);
 } LDKOnionMessageContents;
 
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ {
+   /**
+    * The element at position 0
+    */
+   struct LDKOnionMessageContents a;
+   /**
+    * The element at position 1
+    */
+   struct LDKResponseInstruction b;
+} LDKC2Tuple_OnionMessageContentsResponseInstructionZ;
+
+/**
+ * An enum which can either contain a crate::c_types::derived::C2Tuple_OnionMessageContentsResponseInstructionZ or not
+ */
+typedef enum LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Tag {
+   /**
+    * When we're in this state, this COption_C2Tuple_OnionMessageContentsResponseInstructionZZ contains a crate::c_types::derived::C2Tuple_OnionMessageContentsResponseInstructionZ
+    */
+   LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some,
+   /**
+    * When we're in this state, this COption_C2Tuple_OnionMessageContentsResponseInstructionZZ contains nothing
+    */
+   LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Sentinel,
+} LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Tag;
+
+typedef struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ {
+   LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Tag tag;
+   union {
+      struct {
+         struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ some;
+      };
+   };
+} LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ;
+
 /**
  * An enum which can either contain a crate::lightning::onion_message::packet::OnionMessageContents or not
  */
@@ -13405,9 +14254,9 @@ typedef struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ {
 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZ;
 
 /**
- * A tuple of 3 elements. See the individual fields for the types contained.
+ * A tuple of 2 elements. See the individual fields for the types contained.
  */
-typedef struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ {
+typedef struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ {
    /**
     * The element at position 0
     */
@@ -13415,28 +14264,24 @@ typedef struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ {
    /**
     * The element at position 1
     */
-   struct LDKDestination b;
-   /**
-    * The element at position 2
-    */
-   struct LDKBlindedPath c;
-} LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ;
+   struct LDKMessageSendInstructions b;
+} LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ;
 
 /**
- * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OnionMessageContentsDestinationBlindedPathZs of arbitrary size.
+ * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OnionMessageContentsMessageSendInstructionsZs of arbitrary size.
  * This corresponds to std::vector in C++
  */
-typedef struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ {
+typedef struct LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ {
    /**
     * The elements in the array.
     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
     */
-   struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *data;
+   struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *data;
    /**
     * The number of elements pointed to by `data`.
     */
    uintptr_t datalen;
-} LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ;
+} LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ;
 
 /**
  * An enum which can either contain a crate::lightning::ln::wire::Type or not
@@ -13779,22 +14624,6 @@ typedef struct LDKCResult_CVec_u8ZIOErrorZ {
    bool result_ok;
 } LDKCResult_CVec_u8ZIOErrorZ;
 
-/**
- * A dynamically-allocated array of crate::c_types::Strs of arbitrary size.
- * This corresponds to std::vector in C++
- */
-typedef struct LDKCVec_StrZ {
-   /**
-    * The elements in the array.
-    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
-    */
-   struct LDKStr *data;
-   /**
-    * The number of elements pointed to by `data`.
-    */
-   uintptr_t datalen;
-} LDKCVec_StrZ;
-
 /**
  * The contents of CResult_CVec_StrZIOErrorZ
  */
@@ -13976,43 +14805,6 @@ typedef struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ {
    bool result_ok;
 } LDKCResult_InvoiceRequestBolt12SemanticErrorZ;
 
-/**
- * Represents a valid secp256k1 secret key serialized as a 32 byte array.
- */
-typedef struct LDKSecretKey {
-   /**
-    * The bytes of the secret key
-    */
-   uint8_t bytes[32];
-} LDKSecretKey;
-
-/**
- * An enum which can either contain a crate::c_types::SecretKey or not
- */
-typedef enum LDKCOption_SecretKeyZ_Tag {
-   /**
-    * When we're in this state, this COption_SecretKeyZ contains a crate::c_types::SecretKey
-    */
-   LDKCOption_SecretKeyZ_Some,
-   /**
-    * When we're in this state, this COption_SecretKeyZ contains nothing
-    */
-   LDKCOption_SecretKeyZ_None,
-   /**
-    * Must be last for serialization purposes
-    */
-   LDKCOption_SecretKeyZ_Sentinel,
-} LDKCOption_SecretKeyZ_Tag;
-
-typedef struct LDKCOption_SecretKeyZ {
-   LDKCOption_SecretKeyZ_Tag tag;
-   union {
-      struct {
-         struct LDKSecretKey some;
-      };
-   };
-} LDKCOption_SecretKeyZ;
-
 
 
 /**
@@ -14077,8 +14869,9 @@ typedef struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticE
 
 
 /**
- * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify`] and exposes different
- * ways to respond depending on whether the signing keys were derived.
+ * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify_using_metadata`] or
+ * [`InvoiceRequest::verify_using_recipient_data`] and exposes different ways to respond depending
+ * on whether the signing keys were derived.
  */
 typedef struct MUST_USE_STRUCT LDKVerifiedInvoiceRequest {
    /**
@@ -14631,37 +15424,37 @@ typedef struct LDKCResult_StfuDecodeErrorZ {
 } LDKCResult_StfuDecodeErrorZ;
 
 /**
- * The contents of CResult_SpliceDecodeErrorZ
+ * The contents of CResult_SpliceInitDecodeErrorZ
  */
-typedef union LDKCResult_SpliceDecodeErrorZPtr {
+typedef union LDKCResult_SpliceInitDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKSplice *result;
+   struct LDKSpliceInit *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_SpliceDecodeErrorZPtr;
+} LDKCResult_SpliceInitDecodeErrorZPtr;
 
 /**
- * A CResult_SpliceDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::msgs::Splice on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_SpliceInitDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::SpliceInit on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_SpliceDecodeErrorZ {
+typedef struct LDKCResult_SpliceInitDecodeErrorZ {
    /**
-    * The contents of this CResult_SpliceDecodeErrorZ, accessible via either
+    * The contents of this CResult_SpliceInitDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_SpliceDecodeErrorZPtr contents;
+   union LDKCResult_SpliceInitDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_SpliceDecodeErrorZ represents a success state.
+    * Whether this CResult_SpliceInitDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_SpliceDecodeErrorZ;
+} LDKCResult_SpliceInitDecodeErrorZ;
 
 /**
  * The contents of CResult_SpliceAckDecodeErrorZ
@@ -15183,6 +15976,59 @@ typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
 
 
 
+/**
+ * Optional batch parameters for `commitment_signed` message.
+ */
+typedef struct MUST_USE_STRUCT LDKCommitmentSignedBatch {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeCommitmentSignedBatch *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKCommitmentSignedBatch;
+
+/**
+ * The contents of CResult_CommitmentSignedBatchDecodeErrorZ
+ */
+typedef union LDKCResult_CommitmentSignedBatchDecodeErrorZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKCommitmentSignedBatch *result;
+   /**
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
+    */
+   struct LDKDecodeError *err;
+} LDKCResult_CommitmentSignedBatchDecodeErrorZPtr;
+
+/**
+ * A CResult_CommitmentSignedBatchDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::CommitmentSignedBatch on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_CommitmentSignedBatchDecodeErrorZ {
+   /**
+    * The contents of this CResult_CommitmentSignedBatchDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_CommitmentSignedBatchDecodeErrorZPtr contents;
+   /**
+    * Whether this CResult_CommitmentSignedBatchDecodeErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_CommitmentSignedBatchDecodeErrorZ;
+
+
+
 /**
  * A [`commitment_signed`] message to be sent to or received from a peer.
  *
@@ -16394,8613 +17240,9763 @@ typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
 
 /**
- * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
- * This corresponds to std::vector in C++
- */
-typedef struct LDKCVec_PhantomRouteHintsZ {
-   /**
-    * The elements in the array.
-    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
-    */
-   struct LDKPhantomRouteHints *data;
-   /**
-    * The number of elements pointed to by `data`.
-    */
-   uintptr_t datalen;
-} LDKCVec_PhantomRouteHintsZ;
-
-
-
-/**
- * Represents a syntactically and semantically correct lightning BOLT11 invoice.
- *
- * There are three ways to construct a `Bolt11Invoice`:
- *  1. using [`InvoiceBuilder`]
- *  2. using [`Bolt11Invoice::from_signed`]
- *  3. using `str::parse::<Bolt11Invoice>(&str)` (see [`Bolt11Invoice::from_str`])
- *
- * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
- */
-typedef struct MUST_USE_STRUCT LDKBolt11Invoice {
-   /**
-    * A pointer to the opaque Rust object.
-    * Nearly everywhere, inner must be non-null, however in places where
-    * the Rust equivalent takes an Option, it may be set to null to indicate None.
-    */
-   LDKnativeBolt11Invoice *inner;
-   /**
-    * Indicates that this is the only struct which contains the same pointer.
-    * Rust functions which take ownership of an object provided via an argument require
-    * this to be true and invalidate the object pointed to by inner.
-    */
-   bool is_owned;
-} LDKBolt11Invoice;
-
-/**
- * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
- * may occur.
+ * An enum which can either contain a crate::lightning::ln::channel_state::InboundHTLCStateDetails or not
  */
-typedef enum LDKSignOrCreationError_Tag {
+typedef enum LDKCOption_InboundHTLCStateDetailsZ_Tag {
    /**
-    * An error occurred during signing
+    * When we're in this state, this COption_InboundHTLCStateDetailsZ contains a crate::lightning::ln::channel_state::InboundHTLCStateDetails
     */
-   LDKSignOrCreationError_SignError,
+   LDKCOption_InboundHTLCStateDetailsZ_Some,
    /**
-    * An error occurred while building the transaction
+    * When we're in this state, this COption_InboundHTLCStateDetailsZ contains nothing
     */
-   LDKSignOrCreationError_CreationError,
+   LDKCOption_InboundHTLCStateDetailsZ_None,
    /**
     * Must be last for serialization purposes
     */
-   LDKSignOrCreationError_Sentinel,
-} LDKSignOrCreationError_Tag;
+   LDKCOption_InboundHTLCStateDetailsZ_Sentinel,
+} LDKCOption_InboundHTLCStateDetailsZ_Tag;
 
-typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
-   LDKSignOrCreationError_Tag tag;
+typedef struct LDKCOption_InboundHTLCStateDetailsZ {
+   LDKCOption_InboundHTLCStateDetailsZ_Tag tag;
    union {
       struct {
-         enum LDKCreationError creation_error;
+         enum LDKInboundHTLCStateDetails some;
       };
    };
-} LDKSignOrCreationError;
+} LDKCOption_InboundHTLCStateDetailsZ;
 
 /**
- * The contents of CResult_Bolt11InvoiceSignOrCreationErrorZ
+ * The contents of CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ
  */
-typedef union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr {
+typedef union LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKBolt11Invoice *result;
+   struct LDKCOption_InboundHTLCStateDetailsZ *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKSignOrCreationError *err;
-} LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr;
+   struct LDKDecodeError *err;
+} LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZPtr;
 
 /**
- * A CResult_Bolt11InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
- * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
+ * A CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_InboundHTLCStateDetailsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ {
+typedef struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ {
    /**
-    * The contents of this CResult_Bolt11InvoiceSignOrCreationErrorZ, accessible via either
+    * The contents of this CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr contents;
+   union LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_Bolt11InvoiceSignOrCreationErrorZ represents a success state.
+    * Whether this CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_Bolt11InvoiceSignOrCreationErrorZ;
+} LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ;
 
 
 
 /**
- * A simple future which can complete once, and calls some callback(s) when it does so.
+ * Exposes details around pending inbound HTLCs.
  */
-typedef struct MUST_USE_STRUCT LDKFuture {
+typedef struct MUST_USE_STRUCT LDKInboundHTLCDetails {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeFuture *inner;
+   LDKnativeInboundHTLCDetails *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKFuture;
-
-/**
- * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
- * This corresponds to std::vector in C++
- */
-typedef struct LDKCVec_FutureZ {
-   /**
-    * The elements in the array.
-    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
-    */
-   struct LDKFuture *data;
-   /**
-    * The number of elements pointed to by `data`.
-    */
-   uintptr_t datalen;
-} LDKCVec_FutureZ;
+} LDKInboundHTLCDetails;
 
 /**
- * The contents of CResult_OffersMessageDecodeErrorZ
+ * The contents of CResult_InboundHTLCDetailsDecodeErrorZ
  */
-typedef union LDKCResult_OffersMessageDecodeErrorZPtr {
+typedef union LDKCResult_InboundHTLCDetailsDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKOffersMessage *result;
+   struct LDKInboundHTLCDetails *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_OffersMessageDecodeErrorZPtr;
+} LDKCResult_InboundHTLCDetailsDecodeErrorZPtr;
 
 /**
- * A CResult_OffersMessageDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::onion_message::offers::OffersMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_InboundHTLCDetailsDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_state::InboundHTLCDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_OffersMessageDecodeErrorZ {
+typedef struct LDKCResult_InboundHTLCDetailsDecodeErrorZ {
    /**
-    * The contents of this CResult_OffersMessageDecodeErrorZ, accessible via either
+    * The contents of this CResult_InboundHTLCDetailsDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_OffersMessageDecodeErrorZPtr contents;
+   union LDKCResult_InboundHTLCDetailsDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_OffersMessageDecodeErrorZ represents a success state.
+    * Whether this CResult_InboundHTLCDetailsDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_OffersMessageDecodeErrorZ;
+} LDKCResult_InboundHTLCDetailsDecodeErrorZ;
 
 /**
- * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
+ * An enum which can either contain a crate::lightning::ln::channel_state::OutboundHTLCStateDetails or not
  */
-typedef enum LDKCOption_HTLCClaimZ_Tag {
+typedef enum LDKCOption_OutboundHTLCStateDetailsZ_Tag {
    /**
-    * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
+    * When we're in this state, this COption_OutboundHTLCStateDetailsZ contains a crate::lightning::ln::channel_state::OutboundHTLCStateDetails
     */
-   LDKCOption_HTLCClaimZ_Some,
+   LDKCOption_OutboundHTLCStateDetailsZ_Some,
    /**
-    * When we're in this state, this COption_HTLCClaimZ contains nothing
+    * When we're in this state, this COption_OutboundHTLCStateDetailsZ contains nothing
     */
-   LDKCOption_HTLCClaimZ_None,
+   LDKCOption_OutboundHTLCStateDetailsZ_None,
    /**
     * Must be last for serialization purposes
     */
-   LDKCOption_HTLCClaimZ_Sentinel,
-} LDKCOption_HTLCClaimZ_Tag;
+   LDKCOption_OutboundHTLCStateDetailsZ_Sentinel,
+} LDKCOption_OutboundHTLCStateDetailsZ_Tag;
 
-typedef struct LDKCOption_HTLCClaimZ {
-   LDKCOption_HTLCClaimZ_Tag tag;
+typedef struct LDKCOption_OutboundHTLCStateDetailsZ {
+   LDKCOption_OutboundHTLCStateDetailsZ_Tag tag;
    union {
       struct {
-         enum LDKHTLCClaim some;
+         enum LDKOutboundHTLCStateDetails some;
       };
    };
-} LDKCOption_HTLCClaimZ;
-
-
-
-/**
- * Implements the per-commitment secret storage scheme from
- * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
- *
- * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
- * or so.
- */
-typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
-   /**
-    * A pointer to the opaque Rust object.
-    * Nearly everywhere, inner must be non-null, however in places where
-    * the Rust equivalent takes an Option, it may be set to null to indicate None.
-    */
-   LDKnativeCounterpartyCommitmentSecrets *inner;
-   /**
-    * Indicates that this is the only struct which contains the same pointer.
-    * Rust functions which take ownership of an object provided via an argument require
-    * this to be true and invalidate the object pointed to by inner.
-    */
-   bool is_owned;
-} LDKCounterpartyCommitmentSecrets;
+} LDKCOption_OutboundHTLCStateDetailsZ;
 
 /**
- * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
+ * The contents of CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ
  */
-typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
+typedef union LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKCounterpartyCommitmentSecrets *result;
+   struct LDKCOption_OutboundHTLCStateDetailsZ *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
+} LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZPtr;
 
 /**
- * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_OutboundHTLCStateDetailsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
+typedef struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ {
    /**
-    * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
+    * The contents of this CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
+   union LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
+    * Whether this CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
+} LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ;
 
 
 
 /**
- * The set of public keys which are used in the creation of one commitment transaction.
- * These are derived from the channel base keys and per-commitment data.
- *
- * A broadcaster key is provided from potential broadcaster of the computed transaction.
- * A countersignatory key is coming from a protocol participant unable to broadcast the
- * transaction.
- *
- * These keys are assumed to be good, either because the code derived them from
- * channel basepoints via the new function, or they were obtained via
- * CommitmentTransaction.trust().keys() because we trusted the source of the
- * pre-calculated keys.
+ * Exposes details around pending outbound HTLCs.
  */
-typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
+typedef struct MUST_USE_STRUCT LDKOutboundHTLCDetails {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeTxCreationKeys *inner;
+   LDKnativeOutboundHTLCDetails *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKTxCreationKeys;
+} LDKOutboundHTLCDetails;
 
 /**
- * The contents of CResult_TxCreationKeysDecodeErrorZ
+ * The contents of CResult_OutboundHTLCDetailsDecodeErrorZ
  */
-typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
+typedef union LDKCResult_OutboundHTLCDetailsDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKTxCreationKeys *result;
+   struct LDKOutboundHTLCDetails *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_TxCreationKeysDecodeErrorZPtr;
+} LDKCResult_OutboundHTLCDetailsDecodeErrorZPtr;
 
 /**
- * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_OutboundHTLCDetailsDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_state::OutboundHTLCDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
+typedef struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ {
    /**
-    * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
+    * The contents of this CResult_OutboundHTLCDetailsDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
+   union LDKCResult_OutboundHTLCDetailsDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
+    * Whether this CResult_OutboundHTLCDetailsDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_TxCreationKeysDecodeErrorZ;
+} LDKCResult_OutboundHTLCDetailsDecodeErrorZ;
+
 
-/**
- * The contents of CResult_ChannelPublicKeysDecodeErrorZ
- */
-typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
-   /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
-    */
-   struct LDKChannelPublicKeys *result;
-   /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
-    */
-   struct LDKDecodeError *err;
-} LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
 
 /**
- * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ * Information needed for constructing an invoice route hint for this channel.
  */
-typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
+typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
    /**
-    * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * 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.
     */
-   union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
+   LDKnativeCounterpartyForwardingInfo *inner;
    /**
-    * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
+    * 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 result_ok;
-} LDKCResult_ChannelPublicKeysDecodeErrorZ;
+   bool is_owned;
+} LDKCounterpartyForwardingInfo;
 
 /**
- * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
+ * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
  */
-typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
+typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKHTLCOutputInCommitment *result;
+   struct LDKCounterpartyForwardingInfo *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
+} LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
 
 /**
- * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_state::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
+typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
    /**
-    * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
+    * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
+   union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
+    * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
+} LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
 
 
 
 /**
- * Late-bound per-channel counterparty data used to build transactions.
+ * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
+ * to better separate parameters.
  */
-typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
+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.
     */
-   LDKnativeCounterpartyChannelTransactionParameters *inner;
+   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;
-} LDKCounterpartyChannelTransactionParameters;
+} LDKChannelCounterparty;
 
 /**
- * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
+ * The contents of CResult_ChannelCounterpartyDecodeErrorZ
  */
-typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
+typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKCounterpartyChannelTransactionParameters *result;
+   struct LDKChannelCounterparty *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
+} LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
 
 /**
- * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_state::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
+typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
    /**
-    * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
+    * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
+   union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
+    * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
+} LDKCResult_ChannelCounterpartyDecodeErrorZ;
 
 /**
- * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
+ * An enum which can either contain a crate::lightning::ln::channel_state::ChannelShutdownState or not
  */
-typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
+typedef enum LDKCOption_ChannelShutdownStateZ_Tag {
    /**
-    * 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_ChannelShutdownStateZ contains a crate::lightning::ln::channel_state::ChannelShutdownState
     */
-   struct LDKChannelTransactionParameters *result;
+   LDKCOption_ChannelShutdownStateZ_Some,
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * When we're in this state, this COption_ChannelShutdownStateZ contains nothing
     */
-   struct LDKDecodeError *err;
-} LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
-
-/**
- * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
+   LDKCOption_ChannelShutdownStateZ_None,
    /**
-    * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * Must be last for serialization purposes
     */
-   union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
-   /**
-    * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
+   LDKCOption_ChannelShutdownStateZ_Sentinel,
+} LDKCOption_ChannelShutdownStateZ_Tag;
+
+typedef struct LDKCOption_ChannelShutdownStateZ {
+   LDKCOption_ChannelShutdownStateZ_Tag tag;
+   union {
+      struct {
+         enum LDKChannelShutdownState some;
+      };
+   };
+} LDKCOption_ChannelShutdownStateZ;
+
+/**
+ * A dynamically-allocated array of crate::lightning::ln::channel_state::InboundHTLCDetailss of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_InboundHTLCDetailsZ {
+   /**
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
     */
-   bool result_ok;
-} LDKCResult_ChannelTransactionParametersDecodeErrorZ;
+   struct LDKInboundHTLCDetails *data;
+   /**
+    * The number of elements pointed to by `data`.
+    */
+   uintptr_t datalen;
+} LDKCVec_InboundHTLCDetailsZ;
 
 /**
- * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
+ * A dynamically-allocated array of crate::lightning::ln::channel_state::OutboundHTLCDetailss of arbitrary size.
+ * This corresponds to std::vector in C++
  */
-typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
+typedef struct LDKCVec_OutboundHTLCDetailsZ {
+   /**
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+    */
+   struct LDKOutboundHTLCDetails *data;
+   /**
+    * The number of elements pointed to by `data`.
+    */
+   uintptr_t datalen;
+} LDKCVec_OutboundHTLCDetailsZ;
+
+/**
+ * The contents of CResult_ChannelDetailsDecodeErrorZ
+ */
+typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKHolderCommitmentTransaction *result;
+   struct LDKChannelDetails *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
+} LDKCResult_ChannelDetailsDecodeErrorZPtr;
 
 /**
- * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_state::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
+typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
    /**
-    * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
+    * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
+   union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
+    * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
-
-
-
-/**
- * A pre-built Bitcoin commitment transaction and its txid.
- */
-typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
-   /**
-    * A pointer to the opaque Rust object.
-    * Nearly everywhere, inner must be non-null, however in places where
-    * the Rust equivalent takes an Option, it may be set to null to indicate None.
-    */
-   LDKnativeBuiltCommitmentTransaction *inner;
-   /**
-    * Indicates that this is the only struct which contains the same pointer.
-    * Rust functions which take ownership of an object provided via an argument require
-    * this to be true and invalidate the object pointed to by inner.
-    */
-   bool is_owned;
-} LDKBuiltCommitmentTransaction;
+} LDKCResult_ChannelDetailsDecodeErrorZ;
 
 /**
- * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
+ * The contents of CResult_ChannelShutdownStateDecodeErrorZ
  */
-typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
+typedef union LDKCResult_ChannelShutdownStateDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKBuiltCommitmentTransaction *result;
+   enum LDKChannelShutdownState *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
+} LDKCResult_ChannelShutdownStateDecodeErrorZPtr;
 
 /**
- * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_ChannelShutdownStateDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_state::ChannelShutdownState on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
+typedef struct LDKCResult_ChannelShutdownStateDecodeErrorZ {
    /**
-    * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
+    * The contents of this CResult_ChannelShutdownStateDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
+   union LDKCResult_ChannelShutdownStateDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
+    * Whether this CResult_ChannelShutdownStateDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
+} LDKCResult_ChannelShutdownStateDecodeErrorZ;
 
 
 
 /**
- * A wrapper on ClosingTransaction indicating that the built bitcoin
- * transaction is trusted.
- *
- * See trust() and verify() functions on CommitmentTransaction.
- *
- * This structure implements Deref.
+ * A simple future which can complete once, and calls some callback(s) when it does so.
  */
-typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
+typedef struct MUST_USE_STRUCT LDKFuture {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeTrustedClosingTransaction *inner;
+   LDKnativeFuture *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKTrustedClosingTransaction;
+} LDKFuture;
 
 /**
- * The contents of CResult_TrustedClosingTransactionNoneZ
+ * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
+ * This corresponds to std::vector in C++
  */
-typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
+typedef struct LDKCVec_FutureZ {
+   /**
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+    */
+   struct LDKFuture *data;
+   /**
+    * The number of elements pointed to by `data`.
+    */
+   uintptr_t datalen;
+} LDKCVec_FutureZ;
+
+/**
+ * The contents of CResult_HeldHtlcAvailableDecodeErrorZ
+ */
+typedef union LDKCResult_HeldHtlcAvailableDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKTrustedClosingTransaction *result;
+   struct LDKHeldHtlcAvailable *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_TrustedClosingTransactionNoneZPtr;
+   struct LDKDecodeError *err;
+} LDKCResult_HeldHtlcAvailableDecodeErrorZPtr;
 
 /**
- * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
+ * A CResult_HeldHtlcAvailableDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::onion_message::async_payments::HeldHtlcAvailable on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
+typedef struct LDKCResult_HeldHtlcAvailableDecodeErrorZ {
    /**
-    * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
+    * The contents of this CResult_HeldHtlcAvailableDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
+   union LDKCResult_HeldHtlcAvailableDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
+    * Whether this CResult_HeldHtlcAvailableDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_TrustedClosingTransactionNoneZ;
+} LDKCResult_HeldHtlcAvailableDecodeErrorZ;
 
 /**
- * The contents of CResult_CommitmentTransactionDecodeErrorZ
+ * The contents of CResult_ReleaseHeldHtlcDecodeErrorZ
  */
-typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
+typedef union LDKCResult_ReleaseHeldHtlcDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKCommitmentTransaction *result;
+   struct LDKReleaseHeldHtlc *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_CommitmentTransactionDecodeErrorZPtr;
+} LDKCResult_ReleaseHeldHtlcDecodeErrorZPtr;
 
 /**
- * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_ReleaseHeldHtlcDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::onion_message::async_payments::ReleaseHeldHtlc on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
+typedef struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ {
    /**
-    * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
+    * The contents of this CResult_ReleaseHeldHtlcDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
+   union LDKCResult_ReleaseHeldHtlcDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
+    * Whether this CResult_ReleaseHeldHtlcDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_CommitmentTransactionDecodeErrorZ;
-
-
-
-/**
- * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
- * transaction and the transaction creation keys) are trusted.
- *
- * See trust() and verify() functions on CommitmentTransaction.
- *
- * This structure implements Deref.
- */
-typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
-   /**
-    * A pointer to the opaque Rust object.
-    * Nearly everywhere, inner must be non-null, however in places where
-    * the Rust equivalent takes an Option, it may be set to null to indicate None.
-    */
-   LDKnativeTrustedCommitmentTransaction *inner;
-   /**
-    * Indicates that this is the only struct which contains the same pointer.
-    * Rust functions which take ownership of an object provided via an argument require
-    * this to be true and invalidate the object pointed to by inner.
-    */
-   bool is_owned;
-} LDKTrustedCommitmentTransaction;
+} LDKCResult_ReleaseHeldHtlcDecodeErrorZ;
 
 /**
- * The contents of CResult_TrustedCommitmentTransactionNoneZ
+ * The contents of CResult_AsyncPaymentsMessageDecodeErrorZ
  */
-typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
+typedef union LDKCResult_AsyncPaymentsMessageDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKTrustedCommitmentTransaction *result;
+   struct LDKAsyncPaymentsMessage *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_TrustedCommitmentTransactionNoneZPtr;
+   struct LDKDecodeError *err;
+} LDKCResult_AsyncPaymentsMessageDecodeErrorZPtr;
 
 /**
- * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
+ * A CResult_AsyncPaymentsMessageDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::onion_message::async_payments::AsyncPaymentsMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
+typedef struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ {
    /**
-    * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
+    * The contents of this CResult_AsyncPaymentsMessageDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
+   union LDKCResult_AsyncPaymentsMessageDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
+    * Whether this CResult_AsyncPaymentsMessageDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_TrustedCommitmentTransactionNoneZ;
+} LDKCResult_AsyncPaymentsMessageDecodeErrorZ;
 
 /**
- * The contents of CResult_CVec_ECDSASignatureZNoneZ
+ * The contents of CResult_OffersMessageDecodeErrorZ
  */
-typedef union LDKCResult_CVec_ECDSASignatureZNoneZPtr {
+typedef union LDKCResult_OffersMessageDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKCVec_ECDSASignatureZ *result;
+   struct LDKOffersMessage *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_CVec_ECDSASignatureZNoneZPtr;
+   struct LDKDecodeError *err;
+} LDKCResult_OffersMessageDecodeErrorZPtr;
 
 /**
- * A CResult_CVec_ECDSASignatureZNoneZ represents the result of a fallible operation,
- * containing a crate::c_types::derived::CVec_ECDSASignatureZ on success and a () on failure.
+ * A CResult_OffersMessageDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::onion_message::offers::OffersMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_CVec_ECDSASignatureZNoneZ {
+typedef struct LDKCResult_OffersMessageDecodeErrorZ {
    /**
-    * The contents of this CResult_CVec_ECDSASignatureZNoneZ, accessible via either
+    * The contents of this CResult_OffersMessageDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_CVec_ECDSASignatureZNoneZPtr contents;
+   union LDKCResult_OffersMessageDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_CVec_ECDSASignatureZNoneZ represents a success state.
+    * Whether this CResult_OffersMessageDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_CVec_ECDSASignatureZNoneZ;
+} LDKCResult_OffersMessageDecodeErrorZ;
 
 /**
- * An enum which can either contain a usize or not
+ * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
  */
-typedef enum LDKCOption_usizeZ_Tag {
+typedef enum LDKCOption_HTLCClaimZ_Tag {
    /**
-    * When we're in this state, this COption_usizeZ contains a usize
+    * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
     */
-   LDKCOption_usizeZ_Some,
+   LDKCOption_HTLCClaimZ_Some,
    /**
-    * When we're in this state, this COption_usizeZ contains nothing
+    * When we're in this state, this COption_HTLCClaimZ contains nothing
     */
-   LDKCOption_usizeZ_None,
+   LDKCOption_HTLCClaimZ_None,
    /**
     * Must be last for serialization purposes
     */
-   LDKCOption_usizeZ_Sentinel,
-} LDKCOption_usizeZ_Tag;
+   LDKCOption_HTLCClaimZ_Sentinel,
+} LDKCOption_HTLCClaimZ_Tag;
 
-typedef struct LDKCOption_usizeZ {
-   LDKCOption_usizeZ_Tag tag;
+typedef struct LDKCOption_HTLCClaimZ {
+   LDKCOption_HTLCClaimZ_Tag tag;
    union {
       struct {
-         uintptr_t some;
+         enum LDKHTLCClaim some;
       };
    };
-} LDKCOption_usizeZ;
+} LDKCOption_HTLCClaimZ;
+
+
 
 /**
- * The contents of CResult_ShutdownScriptDecodeErrorZ
+ * Implements the per-commitment secret storage scheme from
+ * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
+ *
+ * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
+ * or so.
  */
-typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
+typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeCounterpartyCommitmentSecrets *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKCounterpartyCommitmentSecrets;
+
+/**
+ * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
+ */
+typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKShutdownScript *result;
+   struct LDKCounterpartyCommitmentSecrets *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_ShutdownScriptDecodeErrorZPtr;
+} LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
 
 /**
- * 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.
+ * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
+typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
    /**
-    * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
+    * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
+   union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
+    * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_ShutdownScriptDecodeErrorZ;
+} LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
 
 
 
 /**
- * An error occurring when converting from [`ScriptBuf`] to [`ShutdownScript`].
+ * The set of public keys which are used in the creation of one commitment transaction.
+ * These are derived from the channel base keys and per-commitment data.
+ *
+ * A broadcaster key is provided from potential broadcaster of the computed transaction.
+ * A countersignatory key is coming from a protocol participant unable to broadcast the
+ * transaction.
+ *
+ * These keys are assumed to be good, either because the code derived them from
+ * channel basepoints via the new function, or they were obtained via
+ * CommitmentTransaction.trust().keys() because we trusted the source of the
+ * pre-calculated keys.
  */
-typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
+typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeInvalidShutdownScript *inner;
+   LDKnativeTxCreationKeys *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKInvalidShutdownScript;
+} LDKTxCreationKeys;
 
 /**
- * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
+ * The contents of CResult_TxCreationKeysDecodeErrorZ
  */
-typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
+typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKShutdownScript *result;
+   struct LDKTxCreationKeys *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;
+   struct LDKDecodeError *err;
+} LDKCResult_TxCreationKeysDecodeErrorZPtr;
 
 /**
- * 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.
+ * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
+typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
    /**
-    * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
+    * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
+   union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
+    * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
+} LDKCResult_TxCreationKeysDecodeErrorZ;
 
 /**
- * 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.
+ * The contents of CResult_ChannelPublicKeysDecodeErrorZ
  */
-typedef enum LDKPaymentPurpose_Tag {
-   /**
-    * A payment for a BOLT 11 invoice.
-    */
-   LDKPaymentPurpose_Bolt11InvoicePayment,
-   /**
-    * A payment for a BOLT 12 [`Offer`].
-    *
-    * [`Offer`]: crate::offers::offer::Offer
-    */
-   LDKPaymentPurpose_Bolt12OfferPayment,
-   /**
-    * A payment for a BOLT 12 [`Refund`].
-    *
-    * [`Refund`]: crate::offers::refund::Refund
-    */
-   LDKPaymentPurpose_Bolt12RefundPayment,
-   /**
-    * Because this is a spontaneous payment, the payer generated their own preimage rather than us
-    * (the payee) providing a preimage.
-    */
-   LDKPaymentPurpose_SpontaneousPayment,
-   /**
-    * Must be last for serialization purposes
-    */
-   LDKPaymentPurpose_Sentinel,
-} LDKPaymentPurpose_Tag;
-
-typedef struct LDKPaymentPurpose_LDKBolt11InvoicePayment_Body {
-   /**
-    * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
-    * [`ChannelManager::create_inbound_payment`]. When handling [`Event::PaymentClaimable`],
-    * this can be passed directly to [`ChannelManager::claim_funds`] to claim the payment. No
-    * action is needed when seen in [`Event::PaymentClaimed`].
-    *
-    * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
-    * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
-    */
-   struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
-   /**
-    * The \"payment secret\". This authenticates the sender to the recipient, preventing a
-    * number of deanonymization attacks during the routing process.
-    * It is provided here for your reference, however its accuracy is enforced directly by
-    * [`ChannelManager`] using the values you previously provided to
-    * [`ChannelManager::create_inbound_payment`] or
-    * [`ChannelManager::create_inbound_payment_for_hash`].
-    *
-    * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
-    * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
-    * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
-    */
-   struct LDKThirtyTwoBytes payment_secret;
-} LDKPaymentPurpose_LDKBolt11InvoicePayment_Body;
-
-typedef struct LDKPaymentPurpose_LDKBolt12OfferPayment_Body {
-   /**
-    * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
-    * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
-    * when seen in [`Event::PaymentClaimed`].
-    *
-    * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
-    */
-   struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
+typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
    /**
-    * The secret used to authenticate the sender to the recipient, preventing a number of
-    * de-anonymization attacks while routing a payment.
-    *
-    * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKThirtyTwoBytes payment_secret;
+   struct LDKChannelPublicKeys *result;
    /**
-    * The context of the payment such as information about the corresponding [`Offer`] and
-    * [`InvoiceRequest`].
-    *
-    * [`Offer`]: crate::offers::offer::Offer
-    * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKBolt12OfferContext payment_context;
-} LDKPaymentPurpose_LDKBolt12OfferPayment_Body;
+   struct LDKDecodeError *err;
+} LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
 
-typedef struct LDKPaymentPurpose_LDKBolt12RefundPayment_Body {
-   /**
-    * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
-    * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
-    * when seen in [`Event::PaymentClaimed`].
-    *
-    * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
-    */
-   struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
+/**
+ * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
    /**
-    * The secret used to authenticate the sender to the recipient, preventing a number of
-    * de-anonymization attacks while routing a payment.
-    *
-    * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
+    * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   struct LDKThirtyTwoBytes payment_secret;
+   union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
    /**
-    * The context of the payment such as information about the corresponding [`Refund`].
-    *
-    * [`Refund`]: crate::offers::refund::Refund
+    * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
     */
-   struct LDKBolt12RefundContext payment_context;
-} LDKPaymentPurpose_LDKBolt12RefundPayment_Body;
-
-typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
-   LDKPaymentPurpose_Tag tag;
-   union {
-      LDKPaymentPurpose_LDKBolt11InvoicePayment_Body bolt11_invoice_payment;
-      LDKPaymentPurpose_LDKBolt12OfferPayment_Body bolt12_offer_payment;
-      LDKPaymentPurpose_LDKBolt12RefundPayment_Body bolt12_refund_payment;
-      struct {
-         struct LDKThirtyTwoBytes spontaneous_payment;
-      };
-   };
-} LDKPaymentPurpose;
+   bool result_ok;
+} LDKCResult_ChannelPublicKeysDecodeErrorZ;
 
 /**
- * The contents of CResult_PaymentPurposeDecodeErrorZ
+ * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
  */
-typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
+typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKPaymentPurpose *result;
+   struct LDKHTLCOutputInCommitment *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_PaymentPurposeDecodeErrorZPtr;
+} LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
 
 /**
- * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
+typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
    /**
-    * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
+    * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
+   union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
+    * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_PaymentPurposeDecodeErrorZ;
+} LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
 
 
 
 /**
- * Information about an HTLC that is part of a payment that can be claimed.
+ * Late-bound per-channel counterparty data used to build transactions.
  */
-typedef struct MUST_USE_STRUCT LDKClaimedHTLC {
+typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeClaimedHTLC *inner;
+   LDKnativeCounterpartyChannelTransactionParameters *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKClaimedHTLC;
+} LDKCounterpartyChannelTransactionParameters;
 
 /**
- * The contents of CResult_ClaimedHTLCDecodeErrorZ
+ * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
  */
-typedef union LDKCResult_ClaimedHTLCDecodeErrorZPtr {
+typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKClaimedHTLC *result;
+   struct LDKCounterpartyChannelTransactionParameters *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_ClaimedHTLCDecodeErrorZPtr;
+} LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
 
 /**
- * A CResult_ClaimedHTLCDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::events::ClaimedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_ClaimedHTLCDecodeErrorZ {
+typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
    /**
-    * The contents of this CResult_ClaimedHTLCDecodeErrorZ, accessible via either
+    * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_ClaimedHTLCDecodeErrorZPtr contents;
+   union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_ClaimedHTLCDecodeErrorZ represents a success state.
+    * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_ClaimedHTLCDecodeErrorZ;
+} LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
 
 /**
- * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
- * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
- *
- * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
- * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
+ * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
  */
-typedef enum LDKPathFailure_Tag {
+typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
    /**
-    * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
-    * error.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   LDKPathFailure_InitialSend,
+   struct LDKChannelTransactionParameters *result;
    /**
-    * A hop on the path failed to forward our payment.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   LDKPathFailure_OnPath,
+   struct LDKDecodeError *err;
+} LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
+
+/**
+ * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
    /**
-    * Must be last for serialization purposes
+    * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   LDKPathFailure_Sentinel,
-} LDKPathFailure_Tag;
-
-typedef struct LDKPathFailure_LDKInitialSend_Body {
+   union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
    /**
-    * The error surfaced from initial send.
+    * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
     */
-   struct LDKAPIError err;
-} LDKPathFailure_LDKInitialSend_Body;
+   bool result_ok;
+} LDKCResult_ChannelTransactionParametersDecodeErrorZ;
 
-typedef struct LDKPathFailure_LDKOnPath_Body {
+/**
+ * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
+ */
+typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
    /**
-    * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
-    * decisions can take into account the update.
-    *
-    * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
-    * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKCOption_NetworkUpdateZ network_update;
-} LDKPathFailure_LDKOnPath_Body;
-
-typedef struct MUST_USE_STRUCT LDKPathFailure {
-   LDKPathFailure_Tag tag;
-   union {
-      LDKPathFailure_LDKInitialSend_Body initial_send;
-      LDKPathFailure_LDKOnPath_Body on_path;
-   };
-} LDKPathFailure;
+   struct LDKHolderCommitmentTransaction *result;
+   /**
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
+    */
+   struct LDKDecodeError *err;
+} LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
 
 /**
- * An enum which can either contain a crate::lightning::events::PathFailure or not
+ * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef enum LDKCOption_PathFailureZ_Tag {
+typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
    /**
-    * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
+    * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   LDKCOption_PathFailureZ_Some,
+   union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
    /**
-    * When we're in this state, this COption_PathFailureZ contains nothing
+    * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
     */
-   LDKCOption_PathFailureZ_None,
+   bool result_ok;
+} LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
+
+
+
+/**
+ * A pre-built Bitcoin commitment transaction and its txid.
+ */
+typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
    /**
-    * Must be last for serialization purposes
+    * 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.
     */
-   LDKCOption_PathFailureZ_Sentinel,
-} LDKCOption_PathFailureZ_Tag;
-
-typedef struct LDKCOption_PathFailureZ {
-   LDKCOption_PathFailureZ_Tag tag;
-   union {
-      struct {
-         struct LDKPathFailure some;
-      };
-   };
-} LDKCOption_PathFailureZ;
+   LDKnativeBuiltCommitmentTransaction *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKBuiltCommitmentTransaction;
 
 /**
- * The contents of CResult_COption_PathFailureZDecodeErrorZ
+ * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
  */
-typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
+typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKCOption_PathFailureZ *result;
+   struct LDKBuiltCommitmentTransaction *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_COption_PathFailureZDecodeErrorZPtr;
+} LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
 
 /**
- * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
+typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
    /**
-    * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
+    * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
+   union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
+    * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_COption_PathFailureZDecodeErrorZ;
+} LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
+
+
 
 /**
- * An enum which can either contain a crate::lightning::events::ClosureReason or not
+ * A wrapper on ClosingTransaction indicating that the built bitcoin
+ * transaction is trusted.
+ *
+ * See trust() and verify() functions on CommitmentTransaction.
+ *
+ * This structure implements Deref.
  */
-typedef enum LDKCOption_ClosureReasonZ_Tag {
+typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
    /**
-    * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
+    * 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.
     */
-   LDKCOption_ClosureReasonZ_Some,
+   LDKnativeTrustedClosingTransaction *inner;
    /**
-    * When we're in this state, this COption_ClosureReasonZ contains nothing
+    * 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.
     */
-   LDKCOption_ClosureReasonZ_None,
+   bool is_owned;
+} LDKTrustedClosingTransaction;
+
+/**
+ * The contents of CResult_TrustedClosingTransactionNoneZ
+ */
+typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
    /**
-    * Must be last for serialization purposes
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   LDKCOption_ClosureReasonZ_Sentinel,
-} LDKCOption_ClosureReasonZ_Tag;
+   struct LDKTrustedClosingTransaction *result;
+   /**
+    * Note that this value is always NULL, as there are no contents in the Err variant
+    */
+   void *err;
+} LDKCResult_TrustedClosingTransactionNoneZPtr;
 
-typedef struct LDKCOption_ClosureReasonZ {
-   LDKCOption_ClosureReasonZ_Tag tag;
-   union {
-      struct {
-         struct LDKClosureReason some;
-      };
-   };
-} LDKCOption_ClosureReasonZ;
+/**
+ * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
+   /**
+    * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
+   /**
+    * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_TrustedClosingTransactionNoneZ;
 
 /**
- * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
+ * The contents of CResult_CommitmentTransactionDecodeErrorZ
  */
-typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
+typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKCOption_ClosureReasonZ *result;
+   struct LDKCommitmentTransaction *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
+} LDKCResult_CommitmentTransactionDecodeErrorZPtr;
 
 /**
- * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
+typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
    /**
-    * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
+    * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
+   union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
+    * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_COption_ClosureReasonZDecodeErrorZ;
+} LDKCResult_CommitmentTransactionDecodeErrorZ;
+
+
 
 /**
- * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
+ * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
+ * transaction and the transaction creation keys) are trusted.
+ *
+ * See trust() and verify() functions on CommitmentTransaction.
+ *
+ * This structure implements Deref.
  */
-typedef enum LDKHTLCDestination_Tag {
+typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
    /**
-    * We tried forwarding to a channel but failed to do so. An example of such an instance is when
-    * there is insufficient capacity in our outbound channel.
+    * 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.
     */
-   LDKHTLCDestination_NextHopChannel,
+   LDKnativeTrustedCommitmentTransaction *inner;
    /**
-    * Scenario where we are unsure of the next node to forward the HTLC to.
+    * 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.
     */
-   LDKHTLCDestination_UnknownNextHop,
+   bool is_owned;
+} LDKTrustedCommitmentTransaction;
+
+/**
+ * The contents of CResult_TrustedCommitmentTransactionNoneZ
+ */
+typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
    /**
-    * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
-    * intercept HTLC.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   LDKHTLCDestination_InvalidForward,
+   struct LDKTrustedCommitmentTransaction *result;
    /**
-    * We couldn't decode the incoming onion to obtain the forwarding details.
+    * Note that this value is always NULL, as there are no contents in the Err variant
     */
-   LDKHTLCDestination_InvalidOnion,
+   void *err;
+} LDKCResult_TrustedCommitmentTransactionNoneZPtr;
+
+/**
+ * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
    /**
-    * Failure scenario where an HTLC may have been forwarded to be intended for us,
-    * but is invalid for some reason, so we reject it.
-    *
-    * Some of the reasons may include:
-    * * HTLC Timeouts
-    * * Excess HTLCs for a payment that we have already fully received, over-paying for the
-    *   payment,
-    * * The counterparty node modified the HTLC in transit,
-    * * A probing attack where an intermediary node is trying to detect if we are the ultimate
-    *   recipient for a payment.
+    * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   LDKHTLCDestination_FailedPayment,
+   union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
    /**
-    * Must be last for serialization purposes
+    * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
     */
-   LDKHTLCDestination_Sentinel,
-} LDKHTLCDestination_Tag;
+   bool result_ok;
+} LDKCResult_TrustedCommitmentTransactionNoneZ;
 
-typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
-   /**
-    * The `node_id` of the next node. For backwards compatibility, this field is
-    * marked as optional, versions prior to 0.0.110 may not always be able to provide
-    * counterparty node information.
-    *
-    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
-    */
-   struct LDKPublicKey node_id;
+/**
+ * The contents of CResult_CVec_ECDSASignatureZNoneZ
+ */
+typedef union LDKCResult_CVec_ECDSASignatureZNoneZPtr {
    /**
-    * The outgoing `channel_id` between us and the next node.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKChannelId channel_id;
-} LDKHTLCDestination_LDKNextHopChannel_Body;
-
-typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
+   struct LDKCVec_ECDSASignatureZ *result;
    /**
-    * Short channel id we are requesting to forward an HTLC to.
+    * Note that this value is always NULL, as there are no contents in the Err variant
     */
-   uint64_t requested_forward_scid;
-} LDKHTLCDestination_LDKUnknownNextHop_Body;
+   void *err;
+} LDKCResult_CVec_ECDSASignatureZNoneZPtr;
 
-typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
+/**
+ * A CResult_CVec_ECDSASignatureZNoneZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::CVec_ECDSASignatureZ on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_CVec_ECDSASignatureZNoneZ {
    /**
-    * Short channel id we are requesting to forward an HTLC to.
+    * The contents of this CResult_CVec_ECDSASignatureZNoneZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   uint64_t requested_forward_scid;
-} LDKHTLCDestination_LDKInvalidForward_Body;
-
-typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
+   union LDKCResult_CVec_ECDSASignatureZNoneZPtr contents;
    /**
-    * The payment hash of the payment we attempted to process.
+    * Whether this CResult_CVec_ECDSASignatureZNoneZ represents a success state.
     */
-   struct LDKThirtyTwoBytes payment_hash;
-} LDKHTLCDestination_LDKFailedPayment_Body;
-
-typedef struct MUST_USE_STRUCT LDKHTLCDestination {
-   LDKHTLCDestination_Tag tag;
-   union {
-      LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
-      LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
-      LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
-      LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
-   };
-} LDKHTLCDestination;
+   bool result_ok;
+} LDKCResult_CVec_ECDSASignatureZNoneZ;
 
 /**
- * An enum which can either contain a crate::lightning::events::HTLCDestination or not
+ * An enum which can either contain a usize or not
  */
-typedef enum LDKCOption_HTLCDestinationZ_Tag {
+typedef enum LDKCOption_usizeZ_Tag {
    /**
-    * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
+    * When we're in this state, this COption_usizeZ contains a usize
     */
-   LDKCOption_HTLCDestinationZ_Some,
+   LDKCOption_usizeZ_Some,
    /**
-    * When we're in this state, this COption_HTLCDestinationZ contains nothing
+    * When we're in this state, this COption_usizeZ contains nothing
     */
-   LDKCOption_HTLCDestinationZ_None,
+   LDKCOption_usizeZ_None,
    /**
     * Must be last for serialization purposes
     */
-   LDKCOption_HTLCDestinationZ_Sentinel,
-} LDKCOption_HTLCDestinationZ_Tag;
+   LDKCOption_usizeZ_Sentinel,
+} LDKCOption_usizeZ_Tag;
 
-typedef struct LDKCOption_HTLCDestinationZ {
-   LDKCOption_HTLCDestinationZ_Tag tag;
+typedef struct LDKCOption_usizeZ {
+   LDKCOption_usizeZ_Tag tag;
    union {
       struct {
-         struct LDKHTLCDestination some;
+         uintptr_t some;
       };
    };
-} LDKCOption_HTLCDestinationZ;
+} LDKCOption_usizeZ;
 
 /**
- * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
+ * The contents of CResult_ShutdownScriptDecodeErrorZ
  */
-typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
+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 LDKCOption_HTLCDestinationZ *result;
+   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_COption_HTLCDestinationZDecodeErrorZPtr;
+} LDKCResult_ShutdownScriptDecodeErrorZPtr;
 
 /**
- * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * 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_COption_HTLCDestinationZDecodeErrorZ {
+typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
    /**
-    * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
+    * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
+   union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
+    * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
+} LDKCResult_ShutdownScriptDecodeErrorZ;
+
+
+
+/**
+ * An error occurring when converting from [`ScriptBuf`] to [`ShutdownScript`].
+ */
+typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeInvalidShutdownScript *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKInvalidShutdownScript;
 
 /**
- * The contents of CResult_PaymentFailureReasonDecodeErrorZ
+ * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
  */
-typedef union LDKCResult_PaymentFailureReasonDecodeErrorZPtr {
+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.
     */
-   enum LDKPaymentFailureReason *result;
+   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_PaymentFailureReasonDecodeErrorZPtr;
+   struct LDKInvalidShutdownScript *err;
+} LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
 
 /**
- * A CResult_PaymentFailureReasonDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::events::PaymentFailureReason on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * 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_PaymentFailureReasonDecodeErrorZ {
+typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
    /**
-    * The contents of this CResult_PaymentFailureReasonDecodeErrorZ, accessible via either
+    * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_PaymentFailureReasonDecodeErrorZPtr contents;
+   union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
    /**
-    * Whether this CResult_PaymentFailureReasonDecodeErrorZ represents a success state.
+    * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_PaymentFailureReasonDecodeErrorZ;
+} LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
 
 /**
- * An enum which can either contain a crate::c_types::U128 or not
+ * `FundingInfo` holds information about a channel's funding transaction.
+ *
+ * When LDK is set to manual propagation of the funding transaction
+ * (via [`ChannelManager::unsafe_manual_funding_transaction_generated`),
+ * LDK does not have the full transaction data. Instead, the `OutPoint`
+ * for the funding is provided here.
+ *
+ * [`ChannelManager::unsafe_manual_funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::unsafe_manual_funding_transaction_generated
  */
-typedef enum LDKCOption_U128Z_Tag {
+typedef enum LDKFundingInfo_Tag {
    /**
-    * When we're in this state, this COption_U128Z contains a crate::c_types::U128
+    * The full funding `Transaction`.
     */
-   LDKCOption_U128Z_Some,
+   LDKFundingInfo_Tx,
    /**
-    * When we're in this state, this COption_U128Z contains nothing
+    * The `OutPoint` of the funding.
     */
-   LDKCOption_U128Z_None,
+   LDKFundingInfo_OutPoint,
    /**
     * Must be last for serialization purposes
     */
-   LDKCOption_U128Z_Sentinel,
-} LDKCOption_U128Z_Tag;
+   LDKFundingInfo_Sentinel,
+} LDKFundingInfo_Tag;
 
-typedef struct LDKCOption_U128Z {
-   LDKCOption_U128Z_Tag tag;
+typedef struct LDKFundingInfo_LDKTx_Body {
+   /**
+    * The funding transaction
+    */
+   struct LDKTransaction transaction;
+} LDKFundingInfo_LDKTx_Body;
+
+typedef struct LDKFundingInfo_LDKOutPoint_Body {
+   /**
+    * The outpoint of the funding
+    */
+   struct LDKOutPoint outpoint;
+} LDKFundingInfo_LDKOutPoint_Body;
+
+typedef struct MUST_USE_STRUCT LDKFundingInfo {
+   LDKFundingInfo_Tag tag;
    union {
-      struct {
-         struct LDKU128 some;
-      };
+      LDKFundingInfo_LDKTx_Body tx;
+      LDKFundingInfo_LDKOutPoint_Body out_point;
    };
-} LDKCOption_U128Z;
+} LDKFundingInfo;
 
 /**
- * A dynamically-allocated array of crate::lightning::events::ClaimedHTLCs of arbitrary size.
- * This corresponds to std::vector in C++
+ * The contents of CResult_FundingInfoDecodeErrorZ
  */
-typedef struct LDKCVec_ClaimedHTLCZ {
+typedef union LDKCResult_FundingInfoDecodeErrorZPtr {
    /**
-    * 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 LDKClaimedHTLC *data;
+   struct LDKFundingInfo *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_ClaimedHTLCZ;
+   struct LDKDecodeError *err;
+} LDKCResult_FundingInfoDecodeErrorZPtr;
 
 /**
- * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
+ * A CResult_FundingInfoDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::events::FundingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
-   /**
-    * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
-    */
-   LDKCOption_PaymentFailureReasonZ_Some,
+typedef struct LDKCResult_FundingInfoDecodeErrorZ {
    /**
-    * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
+    * The contents of this CResult_FundingInfoDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   LDKCOption_PaymentFailureReasonZ_None,
+   union LDKCResult_FundingInfoDecodeErrorZPtr contents;
    /**
-    * Must be last for serialization purposes
+    * Whether this CResult_FundingInfoDecodeErrorZ represents a success state.
     */
-   LDKCOption_PaymentFailureReasonZ_Sentinel,
-} LDKCOption_PaymentFailureReasonZ_Tag;
-
-typedef struct LDKCOption_PaymentFailureReasonZ {
-   LDKCOption_PaymentFailureReasonZ_Tag tag;
-   union {
-      struct {
-         enum LDKPaymentFailureReason some;
-      };
-   };
-} LDKCOption_PaymentFailureReasonZ;
-
-
+   bool result_ok;
+} LDKCResult_FundingInfoDecodeErrorZ;
 
 /**
- * A descriptor used to sign for a commitment transaction's anchor output.
+ * 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 struct MUST_USE_STRUCT LDKAnchorDescriptor {
+typedef enum LDKPaymentPurpose_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.
+    * A payment for a BOLT 11 invoice.
     */
-   LDKnativeAnchorDescriptor *inner;
+   LDKPaymentPurpose_Bolt11InvoicePayment,
    /**
-    * 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 payment for a BOLT 12 [`Offer`].
+    *
+    * [`Offer`]: crate::offers::offer::Offer
     */
-   bool is_owned;
-} LDKAnchorDescriptor;
-
-/**
- * Represents the different types of transactions, originating from LDK, to be bumped.
- */
-typedef enum LDKBumpTransactionEvent_Tag {
+   LDKPaymentPurpose_Bolt12OfferPayment,
    /**
-    * Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
-    * commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
-    * they may need additional fees to be attached through a child transaction using the popular
-    * [Child-Pays-For-Parent](https://bitcoinops.org/en/topics/cpfp) fee bumping technique. This
-    * child transaction must include the anchor input described within `anchor_descriptor` along
-    * with additional inputs to meet the target feerate. Failure to meet the target feerate
-    * decreases the confirmation odds of the transaction package (which includes the commitment
-    * and child anchor transactions), possibly resulting in a loss of funds. Once the transaction
-    * is constructed, it must be fully signed for and broadcast by the consumer of the event
-    * along with the `commitment_tx` enclosed. Note that the `commitment_tx` must always be
-    * broadcast first, as the child anchor transaction depends on it.
-    *
-    * The consumer should be able to sign for any of the additional inputs included within the
-    * child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
-    * re-derived through [`AnchorDescriptor::derive_channel_signer`]. The anchor input signature
-    * can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
-    * provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
-    * full witness required to spend.
-    *
-    * It is possible to receive more than one instance of this event if a valid child anchor
-    * transaction is never broadcast or is but not with a sufficient fee to be mined. Care should
-    * be taken by the consumer of the event to ensure any future iterations of the child anchor
-    * transaction adhere to the [Replace-By-Fee
-    * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
-    * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
-    * these events is not user-controlled, users may ignore/drop the event if they are no longer
-    * able to commit external confirmed funds to the child anchor transaction.
-    *
-    * The set of `pending_htlcs` on the commitment transaction to be broadcast can be inspected to
-    * determine whether a significant portion of the channel's funds are allocated to HTLCs,
-    * enabling users to make their own decisions regarding the importance of the commitment
-    * transaction's confirmation. Note that this is not required, but simply exists as an option
-    * for users to override LDK's behavior. On commitments with no HTLCs (indicated by those with
-    * an empty `pending_htlcs`), confirmation of the commitment transaction can be considered to
-    * be not urgent.
+    * A payment for a BOLT 12 [`Refund`].
     *
-    * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
-    * [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_anchor_input
-    * [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness
+    * [`Refund`]: crate::offers::refund::Refund
     */
-   LDKBumpTransactionEvent_ChannelClose,
+   LDKPaymentPurpose_Bolt12RefundPayment,
    /**
-    * Indicates that a channel featuring anchor outputs has unilaterally closed on-chain by a
-    * holder commitment transaction and its HTLC(s) need to be resolved on-chain. With the
-    * zero-HTLC-transaction-fee variant of anchor outputs, the pre-signed HTLC
-    * transactions have a zero fee, thus requiring additional inputs and/or outputs to be attached
-    * for a timely confirmation within the chain. These additional inputs and/or outputs must be
-    * appended to the resulting HTLC transaction to meet the target feerate. Failure to meet the
-    * target feerate decreases the confirmation odds of the transaction, possibly resulting in a
-    * loss of funds. Once the transaction meets the target feerate, it must be signed for and
-    * broadcast by the consumer of the event.
-    *
-    * The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
-    * HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
-    * through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
-    * computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
-    * provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
-    * to spend.
-    *
-    * It is possible to receive more than one instance of this event if a valid HTLC transaction
-    * is never broadcast or is but not with a sufficient fee to be mined. Care should be taken by
-    * the consumer of the event to ensure any future iterations of the HTLC transaction adhere to
-    * the [Replace-By-Fee
-    * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
-    * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
-    * these events is not user-controlled, users may ignore/drop the event if either they are no
-    * longer able to commit external confirmed funds to the HTLC transaction or the fee committed
-    * to the HTLC transaction is greater in value than the HTLCs being claimed.
-    *
-    * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
-    * [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_htlc_transaction
+    * Because this is a spontaneous payment, the payer generated their own preimage rather than us
+    * (the payee) providing a preimage.
     */
-   LDKBumpTransactionEvent_HTLCResolution,
+   LDKPaymentPurpose_SpontaneousPayment,
    /**
     * Must be last for serialization purposes
     */
-   LDKBumpTransactionEvent_Sentinel,
-} LDKBumpTransactionEvent_Tag;
+   LDKPaymentPurpose_Sentinel,
+} LDKPaymentPurpose_Tag;
 
-typedef struct LDKBumpTransactionEvent_LDKChannelClose_Body {
+typedef struct LDKPaymentPurpose_LDKBolt11InvoicePayment_Body {
    /**
-    * The `channel_id` of the channel which has been closed.
+    * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
+    * [`ChannelManager::create_inbound_payment`]. When handling [`Event::PaymentClaimable`],
+    * this can be passed directly to [`ChannelManager::claim_funds`] to claim the payment. No
+    * action is needed when seen in [`Event::PaymentClaimed`].
+    *
+    * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
+    * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
     */
-   struct LDKChannelId channel_id;
+   struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
    /**
-    * Counterparty in the closed channel.
+    * 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 LDKPublicKey counterparty_node_id;
+   struct LDKThirtyTwoBytes payment_secret;
+} LDKPaymentPurpose_LDKBolt11InvoicePayment_Body;
+
+typedef struct LDKPaymentPurpose_LDKBolt12OfferPayment_Body {
    /**
-    * The unique identifier for the claim of the anchor output in the commitment transaction.
+    * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
+    * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
+    * when seen in [`Event::PaymentClaimed`].
     *
-    * The identifier must map to the set of external UTXOs assigned to the claim, such that
-    * they can be reused when a new claim with the same identifier needs to be made, resulting
-    * in a fee-bumping attempt.
+    * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
     */
-   struct LDKThirtyTwoBytes claim_id;
+   struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
    /**
-    * The target feerate that the transaction package, which consists of the commitment
-    * transaction and the to-be-crafted child anchor transaction, must meet.
+    * The secret used to authenticate the sender to the recipient, preventing a number of
+    * de-anonymization attacks while routing a payment.
+    *
+    * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
     */
-   uint32_t package_target_feerate_sat_per_1000_weight;
+   struct LDKThirtyTwoBytes payment_secret;
    /**
-    * The channel's commitment transaction to bump the fee of. This transaction should be
-    * broadcast along with the anchor transaction constructed as a result of consuming this
-    * event.
+    * The context of the payment such as information about the corresponding [`Offer`] and
+    * [`InvoiceRequest`].
+    *
+    * [`Offer`]: crate::offers::offer::Offer
+    * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
     */
-   struct LDKTransaction commitment_tx;
+   struct LDKBolt12OfferContext payment_context;
+} LDKPaymentPurpose_LDKBolt12OfferPayment_Body;
+
+typedef struct LDKPaymentPurpose_LDKBolt12RefundPayment_Body {
    /**
-    * The absolute fee in satoshis of the commitment transaction. This can be used along the
-    * with weight of the commitment transaction to determine its feerate.
+    * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
+    * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
+    * when seen in [`Event::PaymentClaimed`].
+    *
+    * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
     */
-   uint64_t commitment_tx_fee_satoshis;
+   struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
    /**
-    * The descriptor to sign the anchor input of the anchor transaction constructed as a
-    * result of consuming this event.
+    * The secret used to authenticate the sender to the recipient, preventing a number of
+    * de-anonymization attacks while routing a payment.
+    *
+    * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
     */
-   struct LDKAnchorDescriptor anchor_descriptor;
+   struct LDKThirtyTwoBytes payment_secret;
    /**
-    * The set of pending HTLCs on the commitment transaction that need to be resolved once the
-    * commitment transaction confirms.
+    * The context of the payment such as information about the corresponding [`Refund`].
+    *
+    * [`Refund`]: crate::offers::refund::Refund
     */
-   struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs;
-} LDKBumpTransactionEvent_LDKChannelClose_Body;
+   struct LDKBolt12RefundContext payment_context;
+} LDKPaymentPurpose_LDKBolt12RefundPayment_Body;
 
-typedef struct LDKBumpTransactionEvent_LDKHTLCResolution_Body {
+typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
+   LDKPaymentPurpose_Tag tag;
+   union {
+      LDKPaymentPurpose_LDKBolt11InvoicePayment_Body bolt11_invoice_payment;
+      LDKPaymentPurpose_LDKBolt12OfferPayment_Body bolt12_offer_payment;
+      LDKPaymentPurpose_LDKBolt12RefundPayment_Body bolt12_refund_payment;
+      struct {
+         struct LDKThirtyTwoBytes spontaneous_payment;
+      };
+   };
+} LDKPaymentPurpose;
+
+/**
+ * The contents of CResult_PaymentPurposeDecodeErrorZ
+ */
+typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
    /**
-    * The `channel_id` of the channel which has been closed.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKChannelId channel_id;
+   struct LDKPaymentPurpose *result;
    /**
-    * Counterparty in the closed channel.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKPublicKey counterparty_node_id;
+   struct LDKDecodeError *err;
+} LDKCResult_PaymentPurposeDecodeErrorZPtr;
+
+/**
+ * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
    /**
-    * The unique identifier for the claim of the HTLCs in the confirmed commitment
-    * transaction.
-    *
-    * The identifier must map to the set of external UTXOs assigned to the claim, such that
-    * they can be reused when a new claim with the same identifier needs to be made, resulting
-    * in a fee-bumping attempt.
+    * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   struct LDKThirtyTwoBytes claim_id;
+   union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
    /**
-    * The target feerate that the resulting HTLC transaction must meet.
+    * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
     */
-   uint32_t target_feerate_sat_per_1000_weight;
+   bool result_ok;
+} LDKCResult_PaymentPurposeDecodeErrorZ;
+
+
+
+/**
+ * Information about an HTLC that is part of a payment that can be claimed.
+ */
+typedef struct MUST_USE_STRUCT LDKClaimedHTLC {
    /**
-    * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably
-    * by the same transaction.
+    * 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_HTLCDescriptorZ htlc_descriptors;
+   LDKnativeClaimedHTLC *inner;
    /**
-    * The locktime required for the resulting HTLC transaction.
+    * 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.
     */
-   uint32_t tx_lock_time;
-} LDKBumpTransactionEvent_LDKHTLCResolution_Body;
-
-typedef struct MUST_USE_STRUCT LDKBumpTransactionEvent {
-   LDKBumpTransactionEvent_Tag tag;
-   union {
-      LDKBumpTransactionEvent_LDKChannelClose_Body channel_close;
-      LDKBumpTransactionEvent_LDKHTLCResolution_Body htlc_resolution;
-   };
-} LDKBumpTransactionEvent;
+   bool is_owned;
+} LDKClaimedHTLC;
 
 /**
- * An Event which you should probably take some action in response to.
- *
- * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
- * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
- * written as it makes no sense to respond to it after reconnecting to peers).
+ * The contents of CResult_ClaimedHTLCDecodeErrorZ
  */
-typedef enum LDKEvent_Tag {
+typedef union LDKCResult_ClaimedHTLCDecodeErrorZPtr {
    /**
-    * Used to indicate that the client should generate a funding transaction with the given
-    * parameters and then call [`ChannelManager::funding_transaction_generated`].
-    * Generated in [`ChannelManager`] message handling.
-    * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
-    * counterparty can steal your funds!
-    *
-    * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
-    * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   LDKEvent_FundingGenerationReady,
+   struct LDKClaimedHTLC *result;
    /**
-    * Indicates that we've been offered a payment and it needs to be claimed via calling
-    * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
-    *
-    * Note that if the preimage is not known, you should call
-    * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
-    * to free up resources for this HTLC and avoid network congestion.
-    *
-    * If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes custom TLVs with even type
-    * numbers, you should use [`ChannelManager::fail_htlc_backwards_with_reason`] with
-    * [`FailureCode::InvalidOnionPayload`] if you fail to understand and handle the contents, or
-    * [`ChannelManager::claim_funds_with_known_custom_tlvs`] upon successful handling.
-    * If you don't intend to check for custom TLVs, you can simply use
-    * [`ChannelManager::claim_funds`], which will automatically fail back even custom TLVs.
-    *
-    * If you fail to call [`ChannelManager::claim_funds`],
-    * [`ChannelManager::claim_funds_with_known_custom_tlvs`],
-    * [`ChannelManager::fail_htlc_backwards`], or
-    * [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will
-    * be automatically failed.
-    *
-    * # Note
-    * LDK will not stop an inbound payment from being paid multiple times, so multiple
-    * `PaymentClaimable` events may be generated for the same payment. In such a case it is
-    * polite (and required in the lightning specification) to fail the payment the second time
-    * and give the sender their money back rather than accepting double payment.
-    *
-    * # Note
-    * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
-    *
-    * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
-    * [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs
-    * [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload
-    * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
-    * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   LDKEvent_PaymentClaimable,
+   struct LDKDecodeError *err;
+} LDKCResult_ClaimedHTLCDecodeErrorZPtr;
+
+/**
+ * A CResult_ClaimedHTLCDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::events::ClaimedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ClaimedHTLCDecodeErrorZ {
    /**
-    * Indicates a payment has been claimed and we've received money!
-    *
-    * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
-    * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
-    * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
-    * [`Event::PaymentClaimable`] event.
-    *
-    * # Note
-    * LDK will not stop an inbound payment from being paid multiple times, so multiple
-    * `PaymentClaimable` events may be generated for the same payment. If you then call
-    * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
-    * multiple `PaymentClaimed` events.
-    *
-    * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+    * The contents of this CResult_ClaimedHTLCDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   LDKEvent_PaymentClaimed,
+   union LDKCResult_ClaimedHTLCDecodeErrorZPtr contents;
    /**
-    * Indicates that a peer connection with a node is needed in order to send an [`OnionMessage`].
-    *
-    * Typically, this happens when a [`MessageRouter`] is unable to find a complete path to a
-    * [`Destination`]. Once a connection is established, any messages buffered by an
-    * [`OnionMessageHandler`] may be sent.
-    *
-    * This event will not be generated for onion message forwards; only for sends including
-    * replies. Handlers should connect to the node otherwise any buffered messages may be lost.
-    *
-    * [`OnionMessage`]: msgs::OnionMessage
-    * [`MessageRouter`]: crate::onion_message::messenger::MessageRouter
-    * [`Destination`]: crate::onion_message::messenger::Destination
-    * [`OnionMessageHandler`]: crate::ln::msgs::OnionMessageHandler
+    * Whether this CResult_ClaimedHTLCDecodeErrorZ represents a success state.
     */
-   LDKEvent_ConnectionNeeded,
+   bool result_ok;
+} LDKCResult_ClaimedHTLCDecodeErrorZ;
+
+/**
+ * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
+ * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
+ *
+ * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
+ * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
+ */
+typedef enum LDKPathFailure_Tag {
    /**
-    * Indicates a request for an invoice failed to yield a response in a reasonable amount of time
-    * or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an
-    * [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed.
-    *
-    * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
-    * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
-    * [`Offer`]: crate::offers::offer::Offer
-    * [`Refund`]: crate::offers::refund::Refund
+    * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
+    * error.
     */
-   LDKEvent_InvoiceRequestFailed,
+   LDKPathFailure_InitialSend,
    /**
-    * 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.
+    * A hop on the path failed to forward our payment.
     */
-   LDKEvent_PaymentSent,
+   LDKPathFailure_OnPath,
    /**
-    * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
-    * provide failure information for each path attempt in the payment, including retries.
-    *
-    * This event is provided once there are no further pending HTLCs for the payment and the
-    * payment is no longer retryable, due either to the [`Retry`] provided or
-    * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
-    *
-    * In exceedingly rare cases, it is possible that an [`Event::PaymentFailed`] is generated for
-    * a payment after an [`Event::PaymentSent`] event for this same payment has already been
-    * received and processed. In this case, the [`Event::PaymentFailed`] event MUST be ignored,
-    * and the payment MUST be treated as having succeeded.
-    *
-    * [`Retry`]: crate::ln::channelmanager::Retry
-    * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+    * Must be last for serialization purposes
     */
-   LDKEvent_PaymentFailed,
+   LDKPathFailure_Sentinel,
+} LDKPathFailure_Tag;
+
+typedef struct LDKPathFailure_LDKInitialSend_Body {
    /**
-    * Indicates that a path for an outbound payment was successful.
-    *
-    * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
-    * [`Event::PaymentSent`] for obtaining the payment preimage.
+    * The error surfaced from initial send.
     */
-   LDKEvent_PaymentPathSuccessful,
+   struct LDKAPIError err;
+} LDKPathFailure_LDKInitialSend_Body;
+
+typedef struct LDKPathFailure_LDKOnPath_Body {
    /**
-    * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
-    * handle the HTLC.
-    *
-    * Note that this does *not* indicate that all paths for an MPP payment have failed, see
-    * [`Event::PaymentFailed`].
-    *
-    * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
-    * been exhausted.
+    * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
+    * decisions can take into account the update.
     *
-    * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+    * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
+    * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
     */
-   LDKEvent_PaymentPathFailed,
+   struct LDKCOption_NetworkUpdateZ network_update;
+} LDKPathFailure_LDKOnPath_Body;
+
+typedef struct MUST_USE_STRUCT LDKPathFailure {
+   LDKPathFailure_Tag tag;
+   union {
+      LDKPathFailure_LDKInitialSend_Body initial_send;
+      LDKPathFailure_LDKOnPath_Body on_path;
+   };
+} LDKPathFailure;
+
+/**
+ * An enum which can either contain a crate::lightning::events::PathFailure or not
+ */
+typedef enum LDKCOption_PathFailureZ_Tag {
    /**
-    * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
+    * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
     */
-   LDKEvent_ProbeSuccessful,
+   LDKCOption_PathFailureZ_Some,
    /**
-    * Indicates that a probe payment we sent failed at an intermediary node on the path.
+    * When we're in this state, this COption_PathFailureZ contains nothing
     */
-   LDKEvent_ProbeFailed,
+   LDKCOption_PathFailureZ_None,
    /**
-    * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
-    * a time in the future.
-    *
-    * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
+    * Must be last for serialization purposes
     */
-   LDKEvent_PendingHTLCsForwardable,
+   LDKCOption_PathFailureZ_Sentinel,
+} LDKCOption_PathFailureZ_Tag;
+
+typedef struct LDKCOption_PathFailureZ {
+   LDKCOption_PathFailureZ_Tag tag;
+   union {
+      struct {
+         struct LDKPathFailure some;
+      };
+   };
+} LDKCOption_PathFailureZ;
+
+/**
+ * The contents of CResult_COption_PathFailureZDecodeErrorZ
+ */
+typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
    /**
-    * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
-    * you've encoded an intercept scid in the receiver's invoice route hints using
-    * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
-    *
-    * [`ChannelManager::forward_intercepted_htlc`] or
-    * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
-    * their docs for more information.
-    *
-    * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
-    * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
-    * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
-    * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   LDKEvent_HTLCIntercepted,
+   struct LDKCOption_PathFailureZ *result;
    /**
-    * Used to indicate that an output which you should know how to spend was confirmed on chain
-    * and is now spendable.
-    *
-    * Such an output will *never* be spent directly by LDK, and are not at risk of your
-    * counterparty spending them due to some kind of timeout. Thus, you need to store them
-    * somewhere and spend them when you create on-chain transactions.
-    *
-    * You may hand them to the [`OutputSweeper`] utility which will store and (re-)generate spending
-    * transactions for you.
-    *
-    * [`OutputSweeper`]: crate::util::sweep::OutputSweeper
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   LDKEvent_SpendableOutputs,
+   struct LDKDecodeError *err;
+} LDKCResult_COption_PathFailureZDecodeErrorZPtr;
+
+/**
+ * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
    /**
-    * This event is generated when a payment has been successfully forwarded through us and a
-    * forwarding fee earned.
+    * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   LDKEvent_PaymentForwarded,
+   union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
    /**
-    * Used to indicate that a channel with the given `channel_id` is being opened and pending
-    * confirmation on-chain.
-    *
-    * This event is emitted when the funding transaction has been signed and is broadcast to the
-    * network. For 0conf channels it will be immediately followed by the corresponding
-    * [`Event::ChannelReady`] event.
+    * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
     */
-   LDKEvent_ChannelPending,
+   bool result_ok;
+} LDKCResult_COption_PathFailureZDecodeErrorZ;
+
+/**
+ * An enum which can either contain a crate::lightning::events::ClosureReason or not
+ */
+typedef enum LDKCOption_ClosureReasonZ_Tag {
    /**
-    * Used to indicate that a channel with the given `channel_id` is ready to
-    * be used. This event is emitted either when the funding transaction has been confirmed
-    * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
-    * establishment.
+    * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
     */
-   LDKEvent_ChannelReady,
+   LDKCOption_ClosureReasonZ_Some,
    /**
-    * Used to indicate that a channel that got past the initial handshake with the given `channel_id` is in the
-    * process of closure. This includes previously opened channels, and channels that time out from not being funded.
-    *
-    * Note that this event is only triggered for accepted channels: if the
-    * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true and the channel is
-    * rejected, no `ChannelClosed` event will be sent.
-    *
-    * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
-    * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+    * When we're in this state, this COption_ClosureReasonZ contains nothing
     */
-   LDKEvent_ChannelClosed,
+   LDKCOption_ClosureReasonZ_None,
    /**
-    * Used to indicate to the user that they can abandon the funding transaction and recycle the
-    * inputs for another purpose.
-    *
-    * This event is not guaranteed to be generated for channels that are closed due to a restart.
+    * Must be last for serialization purposes
     */
-   LDKEvent_DiscardFunding,
+   LDKCOption_ClosureReasonZ_Sentinel,
+} LDKCOption_ClosureReasonZ_Tag;
+
+typedef struct LDKCOption_ClosureReasonZ {
+   LDKCOption_ClosureReasonZ_Tag tag;
+   union {
+      struct {
+         struct LDKClosureReason some;
+      };
+   };
+} LDKCOption_ClosureReasonZ;
+
+/**
+ * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
+ */
+typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
    /**
-    * Indicates a request to open a new channel by a peer.
-    *
-    * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
-    * call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
-    * event will _not_ be triggered if the channel is rejected.
-    *
-    * The event is only triggered when a new open channel request is received and the
-    * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
-    *
-    * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
-    * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
-    * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   LDKEvent_OpenChannelRequest,
+   struct LDKCOption_ClosureReasonZ *result;
    /**
-    * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
-    * forward it.
-    *
-    * Some scenarios where this event may be sent include:
-    * * Insufficient capacity in the outbound channel
-    * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
-    * * When an unknown SCID is requested for forwarding a payment.
-    * * Expected MPP amount has already been reached
-    * * The HTLC has timed out
-    *
-    * This event, however, does not get generated if an HTLC fails to meet the forwarding
-    * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   LDKEvent_HTLCHandlingFailed,
+   struct LDKDecodeError *err;
+} LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
+
+/**
+ * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
    /**
-    * Indicates that a transaction originating from LDK needs to have its fee bumped. This event
-    * requires confirmed external funds to be readily available to spend.
-    *
-    * LDK does not currently generate this event unless the
-    * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true.
-    * It is limited to the scope of channels with anchor outputs.
-    *
-    * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
+    * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   LDKEvent_BumpTransaction,
+   union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
    /**
-    * Must be last for serialization purposes
+    * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
     */
-   LDKEvent_Sentinel,
-} LDKEvent_Tag;
+   bool result_ok;
+} LDKCResult_COption_ClosureReasonZDecodeErrorZ;
 
-typedef struct LDKEvent_LDKFundingGenerationReady_Body {
+/**
+ * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
+ */
+typedef enum LDKHTLCDestination_Tag {
    /**
-    * The random channel_id we picked which you'll need to pass into
-    * [`ChannelManager::funding_transaction_generated`].
-    *
-    * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
+    * We tried forwarding to a channel but failed to do so. An example of such an instance is when
+    * there is insufficient capacity in our outbound channel.
     */
-   struct LDKChannelId temporary_channel_id;
+   LDKHTLCDestination_NextHopChannel,
    /**
-    * The counterparty's node_id, which you'll need to pass back into
-    * [`ChannelManager::funding_transaction_generated`].
-    *
-    * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
+    * Scenario where we are unsure of the next node to forward the HTLC to.
     */
-   struct LDKPublicKey counterparty_node_id;
+   LDKHTLCDestination_UnknownNextHop,
    /**
-    * The value, in satoshis, that the output should have.
+    * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
+    * intercept HTLC.
     */
-   uint64_t channel_value_satoshis;
+   LDKHTLCDestination_InvalidForward,
    /**
-    * The script which should be used in the transaction output.
+    * We couldn't decode the incoming onion to obtain the forwarding details.
     */
-   struct LDKCVec_u8Z output_script;
+   LDKHTLCDestination_InvalidOnion,
    /**
-    * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
-    * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
-    * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
-    * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
-    * serialized with LDK versions prior to 0.0.113.
+    * Failure scenario where an HTLC may have been forwarded to be intended for us,
+    * but is invalid for some reason, so we reject it.
     *
-    * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
-    * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
-    * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+    * Some of the reasons may include:
+    * * HTLC Timeouts
+    * * Excess HTLCs for a payment that we have already fully received, over-paying for the
+    *   payment,
+    * * The counterparty node modified the HTLC in transit,
+    * * A probing attack where an intermediary node is trying to detect if we are the ultimate
+    *   recipient for a payment.
     */
-   struct LDKU128 user_channel_id;
-} LDKEvent_LDKFundingGenerationReady_Body;
+   LDKHTLCDestination_FailedPayment,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKHTLCDestination_Sentinel,
+} LDKHTLCDestination_Tag;
 
-typedef struct LDKEvent_LDKPaymentClaimable_Body {
+typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
    /**
-    * The node that will receive the payment after it has been claimed.
-    * This is useful to identify payments received via [phantom nodes].
-    * This field will always be filled in when the event was generated by LDK versions
-    * 0.0.113 and above.
-    *
-    * [phantom nodes]: crate::sign::PhantomKeysManager
+    * The `node_id` of the next node. For backwards compatibility, this field is
+    * marked as optional, versions prior to 0.0.110 may not always be able to provide
+    * counterparty node information.
     *
     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   struct LDKPublicKey receiver_node_id;
+   struct LDKPublicKey node_id;
    /**
-    * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
-    * not stop you from registering duplicate payment hashes for inbound payments.
+    * The outgoing `channel_id` between us and the next node.
     */
-   struct LDKThirtyTwoBytes payment_hash;
+   struct LDKChannelId channel_id;
+} LDKHTLCDestination_LDKNextHopChannel_Body;
+
+typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
    /**
-    * The fields in the onion which were received with each HTLC. Only fields which were
-    * identical in each HTLC involved in the payment will be included here.
-    *
-    * Payments received on LDK versions prior to 0.0.115 will have this field unset.
-    *
-    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * Short channel id we are requesting to forward an HTLC to.
     */
-   struct LDKRecipientOnionFields onion_fields;
+   uint64_t requested_forward_scid;
+} LDKHTLCDestination_LDKUnknownNextHop_Body;
+
+typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
    /**
-    * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
-    * than the invoice amount.
-    *
-    * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
-    * and the previous hop took an extra fee.
-    *
-    * # Note
-    * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
-    * field, you may lose money!
-    *
-    * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
+    * Short channel id we are requesting to forward an HTLC to.
     */
-   uint64_t amount_msat;
+   uint64_t requested_forward_scid;
+} LDKHTLCDestination_LDKInvalidForward_Body;
+
+typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
    /**
-    * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
-    * taken by our channel counterparty.
-    *
-    * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
-    *
-    * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
+    * The payment hash of the payment we attempted to process.
     */
-   uint64_t counterparty_skimmed_fee_msat;
+   struct LDKThirtyTwoBytes payment_hash;
+} LDKHTLCDestination_LDKFailedPayment_Body;
+
+typedef struct MUST_USE_STRUCT LDKHTLCDestination {
+   LDKHTLCDestination_Tag tag;
+   union {
+      LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
+      LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
+      LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
+      LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
+   };
+} LDKHTLCDestination;
+
+/**
+ * An enum which can either contain a crate::lightning::events::HTLCDestination or not
+ */
+typedef enum LDKCOption_HTLCDestinationZ_Tag {
    /**
-    * 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.
+    * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
     */
-   struct LDKPaymentPurpose purpose;
+   LDKCOption_HTLCDestinationZ_Some,
    /**
-    * The `channel_id` indicating over which channel we received the payment.
-    *
-    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * When we're in this state, this COption_HTLCDestinationZ contains nothing
     */
-   struct LDKChannelId via_channel_id;
+   LDKCOption_HTLCDestinationZ_None,
    /**
-    * The `user_channel_id` indicating over which channel we received the payment.
+    * Must be last for serialization purposes
     */
-   struct LDKCOption_U128Z via_user_channel_id;
+   LDKCOption_HTLCDestinationZ_Sentinel,
+} LDKCOption_HTLCDestinationZ_Tag;
+
+typedef struct LDKCOption_HTLCDestinationZ {
+   LDKCOption_HTLCDestinationZ_Tag tag;
+   union {
+      struct {
+         struct LDKHTLCDestination some;
+      };
+   };
+} LDKCOption_HTLCDestinationZ;
+
+/**
+ * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
+ */
+typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
    /**
-    * The block height at which this payment will be failed back and will no longer be
-    * eligible for claiming.
-    *
-    * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
-    * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
-    *
-    * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKCOption_u32Z claim_deadline;
-} LDKEvent_LDKPaymentClaimable_Body;
-
-typedef struct LDKEvent_LDKPaymentClaimed_Body {
+   struct LDKCOption_HTLCDestinationZ *result;
    /**
-    * The node that received the payment.
-    * This is useful to identify payments which were received via [phantom nodes].
-    * This field will always be filled in when the event was generated by LDK versions
-    * 0.0.113 and above.
-    *
-    * [phantom nodes]: crate::sign::PhantomKeysManager
-    *
-    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKPublicKey receiver_node_id;
+   struct LDKDecodeError *err;
+} LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
+
+/**
+ * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
    /**
-    * The payment hash of the claimed payment. Note that LDK will not stop you from
-    * registering duplicate payment hashes for inbound payments.
+    * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   struct LDKThirtyTwoBytes payment_hash;
+   union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
    /**
-    * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
-    * invoice amount.
+    * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
     */
-   uint64_t amount_msat;
+   bool result_ok;
+} LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
+
+/**
+ * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
+ */
+typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
    /**
-    * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
-    * spontaneous payment.
+    * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
     */
-   struct LDKPaymentPurpose purpose;
+   LDKCOption_PaymentFailureReasonZ_Some,
    /**
-    * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
-    * to LDK version 0.0.117.
+    * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
     */
-   struct LDKCVec_ClaimedHTLCZ htlcs;
+   LDKCOption_PaymentFailureReasonZ_None,
    /**
-    * The sender-intended sum total of all the MPP parts. This will be `None` for events
-    * serialized prior to LDK version 0.0.117.
+    * Must be last for serialization purposes
     */
-   struct LDKCOption_u64Z sender_intended_total_msat;
-} LDKEvent_LDKPaymentClaimed_Body;
+   LDKCOption_PaymentFailureReasonZ_Sentinel,
+} LDKCOption_PaymentFailureReasonZ_Tag;
 
-typedef struct LDKEvent_LDKConnectionNeeded_Body {
+typedef struct LDKCOption_PaymentFailureReasonZ {
+   LDKCOption_PaymentFailureReasonZ_Tag tag;
+   union {
+      struct {
+         enum LDKPaymentFailureReason some;
+      };
+   };
+} LDKCOption_PaymentFailureReasonZ;
+
+/**
+ * The contents of CResult_COption_PaymentFailureReasonZDecodeErrorZ
+ */
+typedef union LDKCResult_COption_PaymentFailureReasonZDecodeErrorZPtr {
    /**
-    * The node id for the node needing a connection.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKPublicKey node_id;
+   struct LDKCOption_PaymentFailureReasonZ *result;
    /**
-    * Sockets for connecting to the node.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKCVec_SocketAddressZ addresses;
-} LDKEvent_LDKConnectionNeeded_Body;
+   struct LDKDecodeError *err;
+} LDKCResult_COption_PaymentFailureReasonZDecodeErrorZPtr;
 
-typedef struct LDKEvent_LDKInvoiceRequestFailed_Body {
+/**
+ * A CResult_COption_PaymentFailureReasonZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_PaymentFailureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ {
    /**
-    * The `payment_id` to have been associated with payment for the requested invoice.
+    * The contents of this CResult_COption_PaymentFailureReasonZDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   struct LDKThirtyTwoBytes payment_id;
-} LDKEvent_LDKInvoiceRequestFailed_Body;
-
-typedef struct LDKEvent_LDKPaymentSent_Body {
+   union LDKCResult_COption_PaymentFailureReasonZDecodeErrorZPtr contents;
    /**
-    * The `payment_id` passed to [`ChannelManager::send_payment`].
-    *
-    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    * Whether this CResult_COption_PaymentFailureReasonZDecodeErrorZ represents a success state.
     */
-   struct LDKCOption_ThirtyTwoBytesZ payment_id;
+   bool result_ok;
+} LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ;
+
+/**
+ * An enum which can either contain a crate::c_types::U128 or not
+ */
+typedef enum LDKCOption_U128Z_Tag {
    /**
-    * 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!
+    * When we're in this state, this COption_U128Z contains a crate::c_types::U128
     */
-   struct LDKThirtyTwoBytes payment_preimage;
+   LDKCOption_U128Z_Some,
    /**
-    * The hash that was given to [`ChannelManager::send_payment`].
-    *
-    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    * When we're in this state, this COption_U128Z contains nothing
     */
-   struct LDKThirtyTwoBytes payment_hash;
+   LDKCOption_U128Z_None,
    /**
-    * 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
+    * Must be last for serialization purposes
     */
-   struct LDKCOption_u64Z fee_paid_msat;
-} LDKEvent_LDKPaymentSent_Body;
+   LDKCOption_U128Z_Sentinel,
+} LDKCOption_U128Z_Tag;
 
-typedef struct LDKEvent_LDKPaymentFailed_Body {
+typedef struct LDKCOption_U128Z {
+   LDKCOption_U128Z_Tag tag;
+   union {
+      struct {
+         struct LDKU128 some;
+      };
+   };
+} LDKCOption_U128Z;
+
+/**
+ * A dynamically-allocated array of crate::lightning::events::ClaimedHTLCs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_ClaimedHTLCZ {
    /**
-    * The `payment_id` passed to [`ChannelManager::send_payment`].
-    *
-    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
     */
-   struct LDKThirtyTwoBytes payment_id;
+   struct LDKClaimedHTLC *data;
    /**
-    * The hash that was given to [`ChannelManager::send_payment`].
-    *
-    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    * The number of elements pointed to by `data`.
     */
-   struct LDKThirtyTwoBytes payment_hash;
+   uintptr_t datalen;
+} LDKCVec_ClaimedHTLCZ;
+
+
+
+/**
+ * The `Responder` struct creates an appropriate [`ResponseInstruction`] for responding to a
+ * message.
+ */
+typedef struct MUST_USE_STRUCT LDKResponder {
    /**
-    * The reason the payment failed. This is only `None` for events generated or serialized
-    * by versions prior to 0.0.115.
+    * 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 LDKCOption_PaymentFailureReasonZ reason;
-} LDKEvent_LDKPaymentFailed_Body;
-
-typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
+   LDKnativeResponder *inner;
    /**
-    * The `payment_id` passed to [`ChannelManager::send_payment`].
-    *
-    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    * 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.
     */
-   struct LDKThirtyTwoBytes payment_id;
+   bool is_owned;
+} LDKResponder;
+
+
+
+/**
+ * A subset of [`CommonOpenChannelFields`], containing various parameters which are set by the
+ * channel initiator and which are not part of the channel funding transaction.
+ */
+typedef struct MUST_USE_STRUCT LDKChannelParameters {
    /**
-    * The hash that was given to [`ChannelManager::send_payment`].
-    *
-    * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
-    *
-    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    * 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 LDKCOption_ThirtyTwoBytesZ payment_hash;
+   LDKnativeChannelParameters *inner;
    /**
-    * The payment path that was successful.
-    *
-    * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
+    * 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.
     */
-   struct LDKPath path;
-} LDKEvent_LDKPaymentPathSuccessful_Body;
+   bool is_owned;
+} LDKChannelParameters;
 
-typedef struct LDKEvent_LDKPaymentPathFailed_Body {
+
+
+/**
+ * A descriptor used to sign for a commitment transaction's anchor output.
+ */
+typedef struct MUST_USE_STRUCT LDKAnchorDescriptor {
    /**
-    * The `payment_id` passed to [`ChannelManager::send_payment`].
-    *
-    * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
-    *
-    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
-    * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+    * 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 LDKCOption_ThirtyTwoBytesZ payment_id;
+   LDKnativeAnchorDescriptor *inner;
    /**
-    * The hash that was given to [`ChannelManager::send_payment`].
-    *
-    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    * 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.
     */
-   struct LDKThirtyTwoBytes payment_hash;
+   bool is_owned;
+} LDKAnchorDescriptor;
+
+/**
+ * Represents the different types of transactions, originating from LDK, to be bumped.
+ */
+typedef enum LDKBumpTransactionEvent_Tag {
    /**
-    * Indicates the payment was rejected for some reason by the recipient. This implies that
-    * the payment has failed, not just the route in question. If this is not set, the payment may
-    * be retried via a different route.
+    * Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
+    * commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
+    * they may need additional fees to be attached through a child transaction using the popular
+    * [Child-Pays-For-Parent](https://bitcoinops.org/en/topics/cpfp) fee bumping technique. This
+    * child transaction must include the anchor input described within `anchor_descriptor` along
+    * with additional inputs to meet the target feerate. Failure to meet the target feerate
+    * decreases the confirmation odds of the transaction package (which includes the commitment
+    * and child anchor transactions), possibly resulting in a loss of funds. Once the transaction
+    * is constructed, it must be fully signed for and broadcast by the consumer of the event
+    * along with the `commitment_tx` enclosed. Note that the `commitment_tx` must always be
+    * broadcast first, as the child anchor transaction depends on it.
+    *
+    * The consumer should be able to sign for any of the additional inputs included within the
+    * child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
+    * re-derived through [`AnchorDescriptor::derive_channel_signer`]. The anchor input signature
+    * can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
+    * provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
+    * full witness required to spend.
+    *
+    * It is possible to receive more than one instance of this event if a valid child anchor
+    * transaction is never broadcast or is but not with a sufficient fee to be mined. Care should
+    * be taken by the consumer of the event to ensure any future iterations of the child anchor
+    * transaction adhere to the [Replace-By-Fee
+    * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
+    * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
+    * these events is not user-controlled, users may ignore/drop the event if they are no longer
+    * able to commit external confirmed funds to the child anchor transaction.
+    *
+    * The set of `pending_htlcs` on the commitment transaction to be broadcast can be inspected to
+    * determine whether a significant portion of the channel's funds are allocated to HTLCs,
+    * enabling users to make their own decisions regarding the importance of the commitment
+    * transaction's confirmation. Note that this is not required, but simply exists as an option
+    * for users to override LDK's behavior. On commitments with no HTLCs (indicated by those with
+    * an empty `pending_htlcs`), confirmation of the commitment transaction can be considered to
+    * be not urgent.
+    *
+    * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
+    * [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_anchor_input
+    * [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness
     */
-   bool payment_failed_permanently;
+   LDKBumpTransactionEvent_ChannelClose,
    /**
-    * Extra error details based on the failure type. May contain an update that needs to be
-    * applied to the [`NetworkGraph`].
+    * Indicates that a channel featuring anchor outputs has unilaterally closed on-chain by a
+    * holder commitment transaction and its HTLC(s) need to be resolved on-chain. With the
+    * zero-HTLC-transaction-fee variant of anchor outputs, the pre-signed HTLC
+    * transactions have a zero fee, thus requiring additional inputs and/or outputs to be attached
+    * for a timely confirmation within the chain. These additional inputs and/or outputs must be
+    * appended to the resulting HTLC transaction to meet the target feerate. Failure to meet the
+    * target feerate decreases the confirmation odds of the transaction, possibly resulting in a
+    * loss of funds. Once the transaction meets the target feerate, it must be signed for and
+    * broadcast by the consumer of the event.
     *
-    * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
+    * The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
+    * HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
+    * through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
+    * computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
+    * provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
+    * to spend.
+    *
+    * It is possible to receive more than one instance of this event if a valid HTLC transaction
+    * is never broadcast or is but not with a sufficient fee to be mined. Care should be taken by
+    * the consumer of the event to ensure any future iterations of the HTLC transaction adhere to
+    * the [Replace-By-Fee
+    * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
+    * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
+    * these events is not user-controlled, users may ignore/drop the event if either they are no
+    * longer able to commit external confirmed funds to the HTLC transaction or the fee committed
+    * to the HTLC transaction is greater in value than the HTLCs being claimed.
+    *
+    * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
+    * [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_htlc_transaction
     */
-   struct LDKPathFailure failure;
+   LDKBumpTransactionEvent_HTLCResolution,
    /**
-    * The payment path that failed.
+    * Must be last for serialization purposes
     */
-   struct LDKPath path;
+   LDKBumpTransactionEvent_Sentinel,
+} LDKBumpTransactionEvent_Tag;
+
+typedef struct LDKBumpTransactionEvent_LDKChannelClose_Body {
    /**
-    * The channel responsible for the failed payment path.
-    *
-    * Note that for route hints or for the first hop in a path this may be an SCID alias and
-    * may not refer to a channel in the public network graph. These aliases may also collide
-    * with channels in the public network graph.
-    *
-    * If this is `Some`, then the corresponding channel should be avoided when the payment is
-    * retried. May be `None` for older [`Event`] serializations.
+    * The `channel_id` of the channel which has been closed.
     */
-   struct LDKCOption_u64Z short_channel_id;
-} LDKEvent_LDKPaymentPathFailed_Body;
-
-typedef struct LDKEvent_LDKProbeSuccessful_Body {
+   struct LDKChannelId channel_id;
    /**
-    * The id returned by [`ChannelManager::send_probe`].
-    *
-    * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
+    * Counterparty in the closed channel.
     */
-   struct LDKThirtyTwoBytes payment_id;
+   struct LDKPublicKey counterparty_node_id;
    /**
-    * The hash generated by [`ChannelManager::send_probe`].
+    * The unique identifier for the claim of the anchor output in the commitment transaction.
     *
-    * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
+    * The identifier must map to the set of external UTXOs assigned to the claim, such that
+    * they can be reused when a new claim with the same identifier needs to be made, resulting
+    * in a fee-bumping attempt.
     */
-   struct LDKThirtyTwoBytes payment_hash;
+   struct LDKThirtyTwoBytes claim_id;
    /**
-    * The payment path that was successful.
+    * The target feerate that the transaction package, which consists of the commitment
+    * transaction and the to-be-crafted child anchor transaction, must meet.
     */
-   struct LDKPath path;
-} LDKEvent_LDKProbeSuccessful_Body;
-
-typedef struct LDKEvent_LDKProbeFailed_Body {
+   uint32_t package_target_feerate_sat_per_1000_weight;
    /**
-    * The id returned by [`ChannelManager::send_probe`].
-    *
-    * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
+    * The channel's commitment transaction to bump the fee of. This transaction should be
+    * broadcast along with the anchor transaction constructed as a result of consuming this
+    * event.
     */
-   struct LDKThirtyTwoBytes payment_id;
+   struct LDKTransaction commitment_tx;
    /**
-    * The hash generated by [`ChannelManager::send_probe`].
-    *
-    * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
+    * The absolute fee in satoshis of the commitment transaction. This can be used along the
+    * with weight of the commitment transaction to determine its feerate.
     */
-   struct LDKThirtyTwoBytes payment_hash;
+   uint64_t commitment_tx_fee_satoshis;
    /**
-    * The payment path that failed.
+    * The descriptor to sign the anchor input of the anchor transaction constructed as a
+    * result of consuming this event.
     */
-   struct LDKPath path;
+   struct LDKAnchorDescriptor anchor_descriptor;
    /**
-    * The channel responsible for the failed probe.
-    *
-    * Note that for route hints or for the first hop in a path this may be an SCID alias and
-    * may not refer to a channel in the public network graph. These aliases may also collide
-    * with channels in the public network graph.
+    * The set of pending HTLCs on the commitment transaction that need to be resolved once the
+    * commitment transaction confirms.
     */
-   struct LDKCOption_u64Z short_channel_id;
-} LDKEvent_LDKProbeFailed_Body;
+   struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs;
+} LDKBumpTransactionEvent_LDKChannelClose_Body;
 
-typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
+typedef struct LDKBumpTransactionEvent_LDKHTLCResolution_Body {
    /**
-    * The minimum amount of time that should be waited prior to calling
-    * process_pending_htlc_forwards. To increase the effort required to correlate payments,
-    * you should wait a random amount of time in roughly the range (now + time_forwardable,
-    * now + 5*time_forwardable).
+    * The `channel_id` of the channel which has been closed.
     */
-   uint64_t time_forwardable;
-} LDKEvent_LDKPendingHTLCsForwardable_Body;
-
-typedef struct LDKEvent_LDKHTLCIntercepted_Body {
+   struct LDKChannelId channel_id;
    /**
-    * An id to help LDK identify which HTLC is being forwarded or failed.
+    * Counterparty in the closed channel.
     */
-   struct LDKThirtyTwoBytes intercept_id;
+   struct LDKPublicKey counterparty_node_id;
    /**
-    * The fake scid that was programmed as the next hop's scid, generated using
-    * [`ChannelManager::get_intercept_scid`].
+    * The unique identifier for the claim of the HTLCs in the confirmed commitment
+    * transaction.
     *
-    * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
+    * The identifier must map to the set of external UTXOs assigned to the claim, such that
+    * they can be reused when a new claim with the same identifier needs to be made, resulting
+    * in a fee-bumping attempt.
     */
-   uint64_t requested_next_hop_scid;
+   struct LDKThirtyTwoBytes claim_id;
    /**
-    * The payment hash used for this HTLC.
+    * The target feerate that the resulting HTLC transaction must meet.
     */
-   struct LDKThirtyTwoBytes payment_hash;
+   uint32_t target_feerate_sat_per_1000_weight;
    /**
-    * How many msats were received on the inbound edge of this HTLC.
+    * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably
+    * by the same transaction.
     */
-   uint64_t inbound_amount_msat;
+   struct LDKCVec_HTLCDescriptorZ htlc_descriptors;
    /**
-    * How many msats the payer intended to route to the next node. Depending on the reason you are
-    * intercepting this payment, you might take a fee by forwarding less than this amount.
-    * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
-    *
-    * Note that LDK will NOT check that expected fees were factored into this value. You MUST
-    * check that whatever fee you want has been included here or subtract it as required. Further,
-    * LDK will not stop you from forwarding more than you received.
+    * The locktime required for the resulting HTLC transaction.
     */
-   uint64_t expected_outbound_amount_msat;
-} LDKEvent_LDKHTLCIntercepted_Body;
+   uint32_t tx_lock_time;
+} LDKBumpTransactionEvent_LDKHTLCResolution_Body;
 
-typedef struct LDKEvent_LDKSpendableOutputs_Body {
-   /**
-    * The outputs which you should store as spendable by you.
-    */
-   struct LDKCVec_SpendableOutputDescriptorZ outputs;
+typedef struct MUST_USE_STRUCT LDKBumpTransactionEvent {
+   LDKBumpTransactionEvent_Tag tag;
+   union {
+      LDKBumpTransactionEvent_LDKChannelClose_Body channel_close;
+      LDKBumpTransactionEvent_LDKHTLCResolution_Body htlc_resolution;
+   };
+} LDKBumpTransactionEvent;
+
+/**
+ * An Event which you should probably take some action in response to.
+ *
+ * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
+ * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
+ * written as it makes no sense to respond to it after reconnecting to peers).
+ */
+typedef enum LDKEvent_Tag {
    /**
-    * The `channel_id` indicating which channel the spendable outputs belong to.
+    * Used to indicate that the client should generate a funding transaction with the given
+    * parameters and then call [`ChannelManager::funding_transaction_generated`].
+    * Generated in [`ChannelManager`] message handling.
+    * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
+    * counterparty can steal your funds!
     *
-    * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`), but won't be persisted across restarts.
     *
-    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+    * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
     */
-   struct LDKChannelId channel_id;
-} LDKEvent_LDKSpendableOutputs_Body;
-
-typedef struct LDKEvent_LDKPaymentForwarded_Body {
+   LDKEvent_FundingGenerationReady,
    /**
-    * The channel id of the incoming channel between the previous node and us.
+    * Used to indicate that the counterparty node has provided the signature(s) required to
+    * recover our funds in case they go offline.
     *
-    * This is only `None` for events generated or serialized by versions prior to 0.0.107.
+    * It is safe (and your responsibility) to broadcast the funding transaction upon receiving this
+    * event.
     *
-    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * This event is only emitted if you called
+    * [`ChannelManager::unsafe_manual_funding_transaction_generated`] instead of
+    * [`ChannelManager::funding_transaction_generated`].
+    *
+    * [`ChannelManager::unsafe_manual_funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::unsafe_manual_funding_transaction_generated
+    * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
     */
-   struct LDKChannelId prev_channel_id;
+   LDKEvent_FundingTxBroadcastSafe,
    /**
-    * The channel id of the outgoing channel between the next node and us.
+    * Indicates that we've been offered a payment and it needs to be claimed via calling
+    * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
     *
-    * This is only `None` for events generated or serialized by versions prior to 0.0.107.
+    * Note that if the preimage is not known, you should call
+    * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
+    * to free up resources for this HTLC and avoid network congestion.
     *
-    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
-    */
-   struct LDKChannelId next_channel_id;
-   /**
-    * The `user_channel_id` of the incoming channel between the previous node and us.
+    * If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes custom TLVs with even type
+    * numbers, you should use [`ChannelManager::fail_htlc_backwards_with_reason`] with
+    * [`FailureCode::InvalidOnionPayload`] if you fail to understand and handle the contents, or
+    * [`ChannelManager::claim_funds_with_known_custom_tlvs`] upon successful handling.
+    * If you don't intend to check for custom TLVs, you can simply use
+    * [`ChannelManager::claim_funds`], which will automatically fail back even custom TLVs.
     *
-    * This is only `None` for events generated or serialized by versions prior to 0.0.122.
-    */
-   struct LDKCOption_U128Z prev_user_channel_id;
-   /**
-    * The `user_channel_id` of the outgoing channel between the next node and us.
+    * If you fail to call [`ChannelManager::claim_funds`],
+    * [`ChannelManager::claim_funds_with_known_custom_tlvs`],
+    * [`ChannelManager::fail_htlc_backwards`], or
+    * [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will
+    * be automatically failed.
     *
-    * This will be `None` if the payment was settled via an on-chain transaction. See the
-    * caveat described for the `total_fee_earned_msat` field. Moreover it will be `None` for
-    * events generated or serialized by versions prior to 0.0.122.
+    * # Note
+    * LDK will not stop an inbound payment from being paid multiple times, so multiple
+    * `PaymentClaimable` events may be generated for the same payment. In such a case it is
+    * polite (and required in the lightning specification) to fail the payment the second time
+    * and give the sender their money back rather than accepting double payment.
+    *
+    * # Note
+    * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+    *
+    * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+    * [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs
+    * [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload
+    * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
+    * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
     */
-   struct LDKCOption_U128Z next_user_channel_id;
+   LDKEvent_PaymentClaimable,
    /**
-    * The total fee, in milli-satoshis, which was earned as a result of the payment.
+    * Indicates a payment has been claimed and we've received money!
     *
-    * 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.
+    * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
+    * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
+    * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
+    * [`Event::PaymentClaimable`] event.
     *
-    * If the channel which sent us the payment has been force-closed, we will claim the funds
-    * via an on-chain transaction. In that case we do not yet know the on-chain transaction
-    * fees which we will spend and will instead set this to `None`. It is possible duplicate
-    * `PaymentForwarded` events are generated for the same payment iff `total_fee_earned_msat` is
-    * `None`.
+    * # Note
+    * LDK will not stop an inbound payment from being paid multiple times, so multiple
+    * `PaymentClaimable` events may be generated for the same payment. If you then call
+    * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
+    * multiple `PaymentClaimed` events.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+    *
+    * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
     */
-   struct LDKCOption_u64Z total_fee_earned_msat;
+   LDKEvent_PaymentClaimed,
    /**
-    * The share of the total fee, in milli-satoshis, which was withheld in addition to the
-    * forwarding fee.
+    * Indicates that a peer connection with a node is needed in order to send an [`OnionMessage`].
     *
-    * This will only be `Some` if we forwarded an intercepted HTLC with less than the
-    * expected amount. This means our counterparty accepted to receive less than the invoice
-    * amount, e.g., by claiming the payment featuring a corresponding
-    * [`PaymentClaimable::counterparty_skimmed_fee_msat`].
+    * Typically, this happens when a [`MessageRouter`] is unable to find a complete path to a
+    * [`Destination`]. Once a connection is established, any messages buffered by an
+    * [`OnionMessageHandler`] may be sent.
     *
-    * Will also always be `None` for events serialized with LDK prior to version 0.0.122.
+    * This event will not be generated for onion message forwards; only for sends including
+    * replies. Handlers should connect to the node otherwise any buffered messages may be lost.
     *
-    * The caveat described above the `total_fee_earned_msat` field applies here as well.
+    * # Failure Behavior and Persistence
+    * This event won't be replayed after failures-to-handle
+    * (i.e., the event handler returning `Err(ReplayEvent ())`), and also won't be persisted
+    * across restarts.
     *
-    * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: Self::PaymentClaimable::counterparty_skimmed_fee_msat
+    * [`OnionMessage`]: msgs::OnionMessage
+    * [`MessageRouter`]: crate::onion_message::messenger::MessageRouter
+    * [`Destination`]: crate::onion_message::messenger::Destination
+    * [`OnionMessageHandler`]: crate::ln::msgs::OnionMessageHandler
     */
-   struct LDKCOption_u64Z skimmed_fee_msat;
+   LDKEvent_ConnectionNeeded,
    /**
-    * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
-    * transaction.
+    * Indicates a [`Bolt12Invoice`] in response to an [`InvoiceRequest`] or a [`Refund`] was
+    * received.
+    *
+    * This event will only be generated if [`UserConfig::manually_handle_bolt12_invoices`] is set.
+    * Use [`ChannelManager::send_payment_for_bolt12_invoice`] to pay the invoice or
+    * [`ChannelManager::abandon_payment`] to abandon the associated payment. See those docs for
+    * further details.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+    *
+    * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+    * [`Refund`]: crate::offers::refund::Refund
+    * [`UserConfig::manually_handle_bolt12_invoices`]: crate::util::config::UserConfig::manually_handle_bolt12_invoices
+    * [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice
+    * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
     */
-   bool claim_from_onchain_tx;
+   LDKEvent_InvoiceReceived,
    /**
-    * The final amount forwarded, in milli-satoshis, after the fee is deducted.
+    * 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).
     *
-    * The caveat described above the `total_fee_earned_msat` field applies here as well.
+    * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
+    * event. In this situation, you SHOULD treat this payment as having succeeded.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
     */
-   struct LDKCOption_u64Z outbound_amount_forwarded_msat;
-} LDKEvent_LDKPaymentForwarded_Body;
-
-typedef struct LDKEvent_LDKChannelPending_Body {
+   LDKEvent_PaymentSent,
    /**
-    * The `channel_id` of the channel that is pending confirmation.
+    * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
+    * provide failure information for each path attempt in the payment, including retries.
+    *
+    * This event is provided once there are no further pending HTLCs for the payment and the
+    * payment is no longer retryable, due either to the [`Retry`] provided or
+    * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
+    *
+    * In exceedingly rare cases, it is possible that an [`Event::PaymentFailed`] is generated for
+    * a payment after an [`Event::PaymentSent`] event for this same payment has already been
+    * received and processed. In this case, the [`Event::PaymentFailed`] event MUST be ignored,
+    * and the payment MUST be treated as having succeeded.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+    *
+    * [`Retry`]: crate::ln::channelmanager::Retry
+    * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
     */
-   struct LDKChannelId channel_id;
+   LDKEvent_PaymentFailed,
    /**
-    * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
-    * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
-    * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
-    * `user_channel_id` will be randomized for an inbound channel.
+    * Indicates that a path for an outbound payment was successful.
     *
-    * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
-    * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
-    * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+    * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
+    * [`Event::PaymentSent`] for obtaining the payment preimage.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
     */
-   struct LDKU128 user_channel_id;
+   LDKEvent_PaymentPathSuccessful,
    /**
-    * The `temporary_channel_id` this channel used to be known by during channel establishment.
+    * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
+    * handle the HTLC.
     *
-    * Will be `None` for channels created prior to LDK version 0.0.115.
+    * Note that this does *not* indicate that all paths for an MPP payment have failed, see
+    * [`Event::PaymentFailed`].
     *
-    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
+    * been exhausted.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+    *
+    * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
     */
-   struct LDKChannelId former_temporary_channel_id;
+   LDKEvent_PaymentPathFailed,
    /**
-    * The `node_id` of the channel counterparty.
+    * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
     */
-   struct LDKPublicKey counterparty_node_id;
+   LDKEvent_ProbeSuccessful,
    /**
-    * The outpoint of the channel's funding transaction.
+    * Indicates that a probe payment we sent failed at an intermediary node on the path.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
     */
-   struct LDKOutPoint funding_txo;
+   LDKEvent_ProbeFailed,
    /**
-    * The features that this channel will operate with.
+    * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
+    * a time in the future.
     *
-    * Will be `None` for channels created prior to LDK version 0.0.122.
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be regenerated after restarts.
     *
-    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
     */
-   struct LDKChannelTypeFeatures channel_type;
-} LDKEvent_LDKChannelPending_Body;
-
-typedef struct LDKEvent_LDKChannelReady_Body {
+   LDKEvent_PendingHTLCsForwardable,
    /**
-    * The `channel_id` of the channel that is ready.
+    * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
+    * you've encoded an intercept scid in the receiver's invoice route hints using
+    * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
+    *
+    * [`ChannelManager::forward_intercepted_htlc`] or
+    * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
+    * their docs for more information.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+    *
+    * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
+    * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
+    * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
+    * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
     */
-   struct LDKChannelId channel_id;
+   LDKEvent_HTLCIntercepted,
    /**
-    * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
-    * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
-    * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
-    * `user_channel_id` will be randomized for an inbound channel.
+    * Used to indicate that an output which you should know how to spend was confirmed on chain
+    * and is now spendable.
     *
-    * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
-    * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
-    * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+    * Such an output will *never* be spent directly by LDK, and are not at risk of your
+    * counterparty spending them due to some kind of timeout. Thus, you need to store them
+    * somewhere and spend them when you create on-chain transactions.
+    *
+    * You may hand them to the [`OutputSweeper`] utility which will store and (re-)generate spending
+    * transactions for you.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+    *
+    * [`OutputSweeper`]: crate::util::sweep::OutputSweeper
     */
-   struct LDKU128 user_channel_id;
+   LDKEvent_SpendableOutputs,
    /**
-    * The `node_id` of the channel counterparty.
+    * This event is generated when a payment has been successfully forwarded through us and a
+    * forwarding fee earned.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
     */
-   struct LDKPublicKey counterparty_node_id;
+   LDKEvent_PaymentForwarded,
    /**
-    * The features that this channel will operate with.
+    * Used to indicate that a channel with the given `channel_id` is being opened and pending
+    * confirmation on-chain.
+    *
+    * This event is emitted when the funding transaction has been signed and is broadcast to the
+    * network. For 0conf channels it will be immediately followed by the corresponding
+    * [`Event::ChannelReady`] event.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
     */
-   struct LDKChannelTypeFeatures channel_type;
-} LDKEvent_LDKChannelReady_Body;
-
-typedef struct LDKEvent_LDKChannelClosed_Body {
+   LDKEvent_ChannelPending,
    /**
-    * The `channel_id` of the channel which has been closed. Note that on-chain transactions
-    * resolving the channel are likely still awaiting confirmation.
+    * Used to indicate that a channel with the given `channel_id` is ready to
+    * be used. This event is emitted either when the funding transaction has been confirmed
+    * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
+    * establishment.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
     */
-   struct LDKChannelId channel_id;
+   LDKEvent_ChannelReady,
    /**
-    * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
-    * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
-    * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
-    * `user_channel_id` will be randomized for inbound channels.
-    * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
-    * zero for objects serialized with LDK versions prior to 0.0.102.
+    * Used to indicate that a channel that got past the initial handshake with the given `channel_id` is in the
+    * process of closure. This includes previously opened channels, and channels that time out from not being funded.
+    *
+    * Note that this event is only triggered for accepted channels: if the
+    * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true and the channel is
+    * rejected, no `ChannelClosed` event will be sent.
     *
-    * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
     */
-   struct LDKU128 user_channel_id;
+   LDKEvent_ChannelClosed,
    /**
-    * The reason the channel was closed.
+    * Used to indicate to the user that they can abandon the funding transaction and recycle the
+    * inputs for another purpose.
+    *
+    * This event is not guaranteed to be generated for channels that are closed due to a restart.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
     */
-   struct LDKClosureReason reason;
+   LDKEvent_DiscardFunding,
    /**
-    * Counterparty in the closed channel.
+    * Indicates a request to open a new channel by a peer.
     *
-    * This field will be `None` for objects serialized prior to LDK 0.0.117.
+    * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
+    * call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
+    * event will _not_ be triggered if the channel is rejected.
     *
-    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * The event is only triggered when a new open channel request is received and the
+    * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+    *
+    * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+    * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
+    * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
     */
-   struct LDKPublicKey counterparty_node_id;
+   LDKEvent_OpenChannelRequest,
    /**
-    * Channel capacity of the closing channel (sats).
+    * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
+    * forward it.
     *
-    * This field will be `None` for objects serialized prior to LDK 0.0.117.
+    * Some scenarios where this event may be sent include:
+    * * Insufficient capacity in the outbound channel
+    * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
+    * * When an unknown SCID is requested for forwarding a payment.
+    * * Expected MPP amount has already been reached
+    * * The HTLC has timed out
+    *
+    * This event, however, does not get generated if an HTLC fails to meet the forwarding
+    * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
     */
-   struct LDKCOption_u64Z channel_capacity_sats;
+   LDKEvent_HTLCHandlingFailed,
    /**
-    * The original channel funding TXO; this helps checking for the existence and confirmation
-    * status of the closing tx.
-    * Note that for instances serialized in v0.0.119 or prior this will be missing (None).
+    * Indicates that a transaction originating from LDK needs to have its fee bumped. This event
+    * requires confirmed external funds to be readily available to spend.
     *
-    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * LDK does not currently generate this event unless the
+    * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true.
+    * It is limited to the scope of channels with anchor outputs.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`), but will only be regenerated as needed after restarts.
+    *
+    * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
     */
-   struct LDKOutPoint channel_funding_txo;
-} LDKEvent_LDKChannelClosed_Body;
-
-typedef struct LDKEvent_LDKDiscardFunding_Body {
+   LDKEvent_BumpTransaction,
    /**
-    * The channel_id of the channel which has been closed.
+    * We received an onion message that is intended to be forwarded to a peer
+    * that is currently offline. This event will only be generated if the
+    * `OnionMessenger` was initialized with
+    * [`OnionMessenger::new_with_offline_peer_interception`], see its docs.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`), but won't be persisted across restarts.
+    *
+    * [`OnionMessenger::new_with_offline_peer_interception`]: crate::onion_message::messenger::OnionMessenger::new_with_offline_peer_interception
     */
-   struct LDKChannelId channel_id;
+   LDKEvent_OnionMessageIntercepted,
    /**
-    * The full transaction received from the user
+    * Indicates that an onion message supporting peer has come online and it may
+    * be time to forward any onion messages that were previously intercepted for
+    * them. This event will only be generated if the `OnionMessenger` was
+    * initialized with
+    * [`OnionMessenger::new_with_offline_peer_interception`], see its docs.
+    *
+    * # Failure Behavior and Persistence
+    * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+    * returning `Err(ReplayEvent ())`), but won't be persisted across restarts.
+    *
+    * [`OnionMessenger::new_with_offline_peer_interception`]: crate::onion_message::messenger::OnionMessenger::new_with_offline_peer_interception
     */
-   struct LDKTransaction transaction;
-} LDKEvent_LDKDiscardFunding_Body;
+   LDKEvent_OnionMessagePeerConnected,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKEvent_Sentinel,
+} LDKEvent_Tag;
 
-typedef struct LDKEvent_LDKOpenChannelRequest_Body {
+typedef struct LDKEvent_LDKFundingGenerationReady_Body {
    /**
-    * The temporary channel ID of the channel requested to be opened.
-    *
-    * When responding to the request, the `temporary_channel_id` should be passed
-    * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
-    * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
+    * The random channel_id we picked which you'll need to pass into
+    * [`ChannelManager::funding_transaction_generated`].
     *
-    * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
-    * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
+    * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
     */
    struct LDKChannelId temporary_channel_id;
    /**
-    * The node_id of the counterparty requesting to open the channel.
-    *
-    * When responding to the request, the `counterparty_node_id` should be passed
-    * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
-    * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
-    * request.
+    * The counterparty's node_id, which you'll need to pass back into
+    * [`ChannelManager::funding_transaction_generated`].
     *
-    * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
-    * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
+    * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
     */
    struct LDKPublicKey counterparty_node_id;
    /**
-    * The channel value of the requested channel.
+    * The value, in satoshis, that the output should have.
     */
-   uint64_t funding_satoshis;
+   uint64_t channel_value_satoshis;
    /**
-    * Our starting balance in the channel if the request is accepted, in milli-satoshi.
+    * The script which should be used in the transaction output.
     */
-   uint64_t push_msat;
+   struct LDKCVec_u8Z output_script;
    /**
-    * The features that this channel will operate with. If you reject the channel, a
-    * well-behaved counterparty may automatically re-attempt the channel with a new set of
-    * feature flags.
-    *
-    * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
-    * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
-    * 0.0.106.
-    *
-    * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
-    * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
-    * 0.0.107. Channels setting this type also need to get manually accepted via
-    * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
-    * or will be rejected otherwise.
+    * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
+    * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
+    * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
+    * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
+    * serialized with LDK versions prior to 0.0.113.
     *
-    * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+    * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+    * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+    * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
     */
-   struct LDKChannelTypeFeatures channel_type;
-} LDKEvent_LDKOpenChannelRequest_Body;
+   struct LDKU128 user_channel_id;
+} LDKEvent_LDKFundingGenerationReady_Body;
 
-typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
+typedef struct LDKEvent_LDKFundingTxBroadcastSafe_Body {
    /**
-    * The channel over which the HTLC was received.
+    * The `channel_id` indicating which channel has reached this stage.
     */
-   struct LDKChannelId prev_channel_id;
+   struct LDKChannelId channel_id;
    /**
-    * Destination of the HTLC that failed to be processed.
+    * The `user_channel_id` value passed in to [`ChannelManager::create_channel`].
+    *
+    * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
     */
-   struct LDKHTLCDestination failed_next_destination;
-} LDKEvent_LDKHTLCHandlingFailed_Body;
-
-typedef struct MUST_USE_STRUCT LDKEvent {
-   LDKEvent_Tag tag;
-   union {
-      LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
-      LDKEvent_LDKPaymentClaimable_Body payment_claimable;
-      LDKEvent_LDKPaymentClaimed_Body payment_claimed;
-      LDKEvent_LDKConnectionNeeded_Body connection_needed;
-      LDKEvent_LDKInvoiceRequestFailed_Body invoice_request_failed;
-      LDKEvent_LDKPaymentSent_Body payment_sent;
-      LDKEvent_LDKPaymentFailed_Body payment_failed;
-      LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
-      LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
-      LDKEvent_LDKProbeSuccessful_Body probe_successful;
-      LDKEvent_LDKProbeFailed_Body probe_failed;
-      LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
-      LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
-      LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
-      LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
-      LDKEvent_LDKChannelPending_Body channel_pending;
-      LDKEvent_LDKChannelReady_Body channel_ready;
-      LDKEvent_LDKChannelClosed_Body channel_closed;
-      LDKEvent_LDKDiscardFunding_Body discard_funding;
-      LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
-      LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
-      struct {
-         struct LDKBumpTransactionEvent bump_transaction;
-      };
-   };
-} LDKEvent;
-
-/**
- * An enum which can either contain a crate::lightning::events::Event or not
- */
-typedef enum LDKCOption_EventZ_Tag {
+   struct LDKU128 user_channel_id;
    /**
-    * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
+    * The outpoint of the channel's funding transaction.
     */
-   LDKCOption_EventZ_Some,
+   struct LDKOutPoint funding_txo;
    /**
-    * When we're in this state, this COption_EventZ contains nothing
+    * The `node_id` of the channel counterparty.
     */
-   LDKCOption_EventZ_None,
+   struct LDKPublicKey counterparty_node_id;
    /**
-    * Must be last for serialization purposes
+    * The `temporary_channel_id` this channel used to be known by during channel establishment.
     */
-   LDKCOption_EventZ_Sentinel,
-} LDKCOption_EventZ_Tag;
-
-typedef struct LDKCOption_EventZ {
-   LDKCOption_EventZ_Tag tag;
-   union {
-      struct {
-         struct LDKEvent some;
-      };
-   };
-} LDKCOption_EventZ;
+   struct LDKChannelId former_temporary_channel_id;
+} LDKEvent_LDKFundingTxBroadcastSafe_Body;
 
-/**
- * The contents of CResult_COption_EventZDecodeErrorZ
- */
-typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
+typedef struct LDKEvent_LDKPaymentClaimable_Body {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * The node that will receive the payment after it has been claimed.
+    * This is useful to identify payments received via [phantom nodes].
+    * This field will always be filled in when the event was generated by LDK versions
+    * 0.0.113 and above.
+    *
+    * [phantom nodes]: crate::sign::PhantomKeysManager
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   struct LDKCOption_EventZ *result;
+   struct LDKPublicKey receiver_node_id;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
+    * not stop you from registering duplicate payment hashes for inbound payments.
     */
-   struct LDKDecodeError *err;
-} LDKCResult_COption_EventZDecodeErrorZPtr;
-
-/**
- * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_COption_EventZDecodeErrorZ {
+   struct LDKThirtyTwoBytes payment_hash;
    /**
-    * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * The fields in the onion which were received with each HTLC. Only fields which were
+    * identical in each HTLC involved in the payment will be included here.
+    *
+    * Payments received on LDK versions prior to 0.0.115 will have this field unset.
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   union LDKCResult_COption_EventZDecodeErrorZPtr contents;
+   struct LDKRecipientOnionFields onion_fields;
    /**
-    * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
+    * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
+    * than the invoice amount.
+    *
+    * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
+    * and the previous hop took an extra fee.
+    *
+    * # Note
+    * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
+    * field, you may lose money!
+    *
+    * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
     */
-   bool result_ok;
-} LDKCResult_COption_EventZDecodeErrorZ;
-
-/**
- * Sub-errors which don't have specific information in them use this type.
- */
-typedef struct LDKError {
+   uint64_t amount_msat;
    /**
-    * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
+    * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
+    * taken by our channel counterparty.
+    *
+    * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
+    *
+    * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
     */
-   uint8_t _dummy;
-} LDKError;
-
-/**
- * Errors that indicate what is wrong with the invoice. They have some granularity for debug
- * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
- */
-typedef enum LDKBolt11ParseError_Tag {
-   LDKBolt11ParseError_Bech32Error,
-   LDKBolt11ParseError_ParseAmountError,
-   LDKBolt11ParseError_MalformedSignature,
-   LDKBolt11ParseError_BadPrefix,
-   LDKBolt11ParseError_UnknownCurrency,
-   LDKBolt11ParseError_UnknownSiPrefix,
-   LDKBolt11ParseError_MalformedHRP,
-   LDKBolt11ParseError_TooShortDataPart,
-   LDKBolt11ParseError_UnexpectedEndOfTaggedFields,
-   LDKBolt11ParseError_DescriptionDecodeError,
-   LDKBolt11ParseError_PaddingError,
-   LDKBolt11ParseError_IntegerOverflowError,
-   LDKBolt11ParseError_InvalidSegWitProgramLength,
-   LDKBolt11ParseError_InvalidPubKeyHashLength,
-   LDKBolt11ParseError_InvalidScriptHashLength,
-   LDKBolt11ParseError_InvalidRecoveryId,
-   LDKBolt11ParseError_InvalidSliceLength,
+   uint64_t counterparty_skimmed_fee_msat;
    /**
-    * Not an error, but used internally to signal that a part of the invoice should be ignored
-    * according to BOLT11
+    * 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.
     */
-   LDKBolt11ParseError_Skip,
+   struct LDKPaymentPurpose purpose;
    /**
-    * Must be last for serialization purposes
+    * The `channel_id` indicating over which channel we received the payment.
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   LDKBolt11ParseError_Sentinel,
-} LDKBolt11ParseError_Tag;
-
-typedef struct MUST_USE_STRUCT LDKBolt11ParseError {
-   LDKBolt11ParseError_Tag tag;
-   union {
-      struct {
-         struct LDKBech32Error bech32_error;
-      };
-      struct {
-         struct LDKError parse_amount_error;
-      };
-      struct {
-         enum LDKSecp256k1Error malformed_signature;
-      };
-      struct {
-         struct LDKError description_decode_error;
-      };
-      struct {
-         struct LDKStr invalid_slice_length;
-      };
-   };
-} LDKBolt11ParseError;
-
-/**
- * The contents of CResult_SiPrefixBolt11ParseErrorZ
- */
-typedef union LDKCResult_SiPrefixBolt11ParseErrorZPtr {
+   struct LDKChannelId via_channel_id;
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * The `user_channel_id` indicating over which channel we received the payment.
     */
-   enum LDKSiPrefix *result;
+   struct LDKCOption_U128Z via_user_channel_id;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * The block height at which this payment will be failed back and will no longer be
+    * eligible for claiming.
+    *
+    * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
+    * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
+    *
+    * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
     */
-   struct LDKBolt11ParseError *err;
-} LDKCResult_SiPrefixBolt11ParseErrorZPtr;
+   struct LDKCOption_u32Z claim_deadline;
+} LDKEvent_LDKPaymentClaimable_Body;
 
-/**
- * A CResult_SiPrefixBolt11ParseErrorZ represents the result of a fallible operation,
- * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::Bolt11ParseError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_SiPrefixBolt11ParseErrorZ {
+typedef struct LDKEvent_LDKPaymentClaimed_Body {
    /**
-    * The contents of this CResult_SiPrefixBolt11ParseErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * The node that received the payment.
+    * This is useful to identify payments which were received via [phantom nodes].
+    * This field will always be filled in when the event was generated by LDK versions
+    * 0.0.113 and above.
+    *
+    * [phantom nodes]: crate::sign::PhantomKeysManager
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   union LDKCResult_SiPrefixBolt11ParseErrorZPtr contents;
+   struct LDKPublicKey receiver_node_id;
    /**
-    * Whether this CResult_SiPrefixBolt11ParseErrorZ represents a success state.
+    * The payment hash of the claimed payment. Note that LDK will not stop you from
+    * registering duplicate payment hashes for inbound payments.
     */
-   bool result_ok;
-} LDKCResult_SiPrefixBolt11ParseErrorZ;
-
-/**
- * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
- * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
- * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
- */
-typedef enum LDKParseOrSemanticError_Tag {
+   struct LDKThirtyTwoBytes payment_hash;
    /**
-    * The invoice couldn't be decoded
+    * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
+    * invoice amount.
     */
-   LDKParseOrSemanticError_ParseError,
+   uint64_t amount_msat;
    /**
-    * The invoice could be decoded but violates the BOLT11 standard
+    * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
+    * spontaneous payment.
     */
-   LDKParseOrSemanticError_SemanticError,
+   struct LDKPaymentPurpose purpose;
    /**
-    * Must be last for serialization purposes
+    * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
+    * to LDK version 0.0.117.
     */
-   LDKParseOrSemanticError_Sentinel,
-} LDKParseOrSemanticError_Tag;
-
-typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
-   LDKParseOrSemanticError_Tag tag;
-   union {
-      struct {
-         struct LDKBolt11ParseError parse_error;
-      };
-      struct {
-         enum LDKBolt11SemanticError semantic_error;
-      };
-   };
-} LDKParseOrSemanticError;
-
-/**
- * The contents of CResult_Bolt11InvoiceParseOrSemanticErrorZ
- */
-typedef union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr {
+   struct LDKCVec_ClaimedHTLCZ htlcs;
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * The sender-intended sum total of all the MPP parts. This will be `None` for events
+    * serialized prior to LDK version 0.0.117.
     */
-   struct LDKBolt11Invoice *result;
+   struct LDKCOption_u64Z sender_intended_total_msat;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * The fields in the onion which were received with each HTLC. Only fields which were
+    * identical in each HTLC involved in the payment will be included here.
+    *
+    * Payments received on LDK versions prior to 0.0.124 will have this field unset.
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   struct LDKParseOrSemanticError *err;
-} LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr;
+   struct LDKRecipientOnionFields onion_fields;
+} LDKEvent_LDKPaymentClaimed_Body;
 
-/**
- * A CResult_Bolt11InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
- * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ {
+typedef struct LDKEvent_LDKConnectionNeeded_Body {
    /**
-    * The contents of this CResult_Bolt11InvoiceParseOrSemanticErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * The node id for the node needing a connection.
     */
-   union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr contents;
+   struct LDKPublicKey node_id;
    /**
-    * Whether this CResult_Bolt11InvoiceParseOrSemanticErrorZ represents a success state.
+    * Sockets for connecting to the node.
     */
-   bool result_ok;
-} LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ;
-
-
+   struct LDKCVec_SocketAddressZ addresses;
+} LDKEvent_LDKConnectionNeeded_Body;
 
-/**
- * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
- * invalid.
- *
- * # Invariants
- * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`].
- */
-typedef struct MUST_USE_STRUCT LDKSignedRawBolt11Invoice {
+typedef struct LDKEvent_LDKInvoiceReceived_Body {
    /**
-    * 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.
+    * The `payment_id` associated with payment for the invoice.
     */
-   LDKnativeSignedRawBolt11Invoice *inner;
+   struct LDKThirtyTwoBytes payment_id;
    /**
-    * 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.
+    * The invoice to pay.
     */
-   bool is_owned;
-} LDKSignedRawBolt11Invoice;
-
-/**
- * The contents of CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ
- */
-typedef union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr {
+   struct LDKBolt12Invoice invoice;
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * The context of the [`BlindedMessagePath`] used to send the invoice.
+    *
+    * [`BlindedMessagePath`]: crate::blinded_path::message::BlindedMessagePath
     */
-   struct LDKSignedRawBolt11Invoice *result;
+   struct LDKCOption_OffersContextZ context;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * A responder for replying with an [`InvoiceError`] if needed.
+    *
+    * `None` if the invoice wasn't sent with a reply path.
+    *
+    * [`InvoiceError`]: crate::offers::invoice_error::InvoiceError
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   struct LDKBolt11ParseError *err;
-} LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr;
+   struct LDKResponder responder;
+} LDKEvent_LDKInvoiceReceived_Body;
 
-/**
- * A CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents the result of a fallible operation,
- * containing a crate::lightning_invoice::SignedRawBolt11Invoice on success and a crate::lightning_invoice::Bolt11ParseError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ {
+typedef struct LDKEvent_LDKPaymentSent_Body {
    /**
-    * The contents of this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * The `payment_id` passed to [`ChannelManager::send_payment`].
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
     */
-   union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr contents;
+   struct LDKCOption_ThirtyTwoBytesZ payment_id;
    /**
-    * Whether this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents a success state.
+    * 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!
     */
-   bool result_ok;
-} LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ;
-
-
-
-/**
- * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network,
- * but without the signature information.
- * Decoding and encoding should not lead to information loss but may lead to different hashes.
- *
- * For methods without docs see the corresponding methods in [`Bolt11Invoice`].
- */
-typedef struct MUST_USE_STRUCT LDKRawBolt11Invoice {
+   struct LDKThirtyTwoBytes payment_preimage;
    /**
-    * 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.
+    * The hash that was given to [`ChannelManager::send_payment`].
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
     */
-   LDKnativeRawBolt11Invoice *inner;
+   struct LDKThirtyTwoBytes payment_hash;
    /**
-    * 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.
+    * The total fee which was spent at intermediate hops in this payment, across all paths.
+    *
+    * Note that, like [`Route::get_total_fees`] this does *not* include any potential
+    * overpayment to the recipient node.
+    *
+    * If the recipient or an intermediate node misbehaves and gives us free money, this may
+    * overstate the amount paid, though this is unlikely.
+    *
+    * This is only `None` for payments initiated on LDK versions prior to 0.0.103.
+    *
+    * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
     */
-   bool is_owned;
-} LDKRawBolt11Invoice;
-
-
+   struct LDKCOption_u64Z fee_paid_msat;
+} LDKEvent_LDKPaymentSent_Body;
 
-/**
- * Recoverable signature
- */
-typedef struct MUST_USE_STRUCT LDKBolt11InvoiceSignature {
+typedef struct LDKEvent_LDKPaymentFailed_Body {
    /**
-    * 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.
+    * The `payment_id` passed to [`ChannelManager::send_payment`].
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
     */
-   LDKnativeBolt11InvoiceSignature *inner;
+   struct LDKThirtyTwoBytes payment_id;
    /**
-    * 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.
+    * The hash that was given to [`ChannelManager::send_payment`]. `None` if the payment failed
+    * before receiving an invoice when paying a BOLT12 [`Offer`].
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    * [`Offer`]: crate::offers::offer::Offer
     */
-   bool is_owned;
-} LDKBolt11InvoiceSignature;
+   struct LDKCOption_ThirtyTwoBytesZ payment_hash;
+   /**
+    * The reason the payment failed. This is only `None` for events generated or serialized
+    * by versions prior to 0.0.115, or when downgrading to a version with a reason that was
+    * added after.
+    */
+   struct LDKCOption_PaymentFailureReasonZ reason;
+} LDKEvent_LDKPaymentFailed_Body;
 
-/**
- * A tuple of 3 elements. See the individual fields for the types contained.
- */
-typedef struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ {
+typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
    /**
-    * The element at position 0
+    * The `payment_id` passed to [`ChannelManager::send_payment`].
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
     */
-   struct LDKRawBolt11Invoice a;
+   struct LDKThirtyTwoBytes payment_id;
    /**
-    * The element at position 1
+    * The hash that was given to [`ChannelManager::send_payment`].
+    *
+    * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
     */
-   struct LDKThirtyTwoBytes b;
+   struct LDKCOption_ThirtyTwoBytesZ payment_hash;
    /**
-    * The element at position 2
+    * The payment path that was successful.
+    *
+    * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
     */
-   struct LDKBolt11InvoiceSignature c;
-} LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ;
-
-
+   struct LDKPath path;
+} LDKEvent_LDKPaymentPathSuccessful_Body;
 
-/**
- * Payee public key
- */
-typedef struct MUST_USE_STRUCT LDKPayeePubKey {
+typedef struct LDKEvent_LDKPaymentPathFailed_Body {
    /**
-    * 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.
+    * The `payment_id` passed to [`ChannelManager::send_payment`].
+    *
+    * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
     */
-   LDKnativePayeePubKey *inner;
+   struct LDKCOption_ThirtyTwoBytesZ payment_id;
    /**
-    * 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.
+    * The hash that was given to [`ChannelManager::send_payment`].
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
     */
-   bool is_owned;
-} LDKPayeePubKey;
-
-/**
- * The contents of CResult_PayeePubKeySecp256k1ErrorZ
- */
-typedef union LDKCResult_PayeePubKeySecp256k1ErrorZPtr {
+   struct LDKThirtyTwoBytes payment_hash;
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * Indicates the payment was rejected for some reason by the recipient. This implies that
+    * the payment has failed, not just the route in question. If this is not set, the payment may
+    * be retried via a different route.
     */
-   struct LDKPayeePubKey *result;
+   bool payment_failed_permanently;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * Extra error details based on the failure type. May contain an update that needs to be
+    * applied to the [`NetworkGraph`].
+    *
+    * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
     */
-   enum LDKSecp256k1Error *err;
-} LDKCResult_PayeePubKeySecp256k1ErrorZPtr;
-
-/**
- * A CResult_PayeePubKeySecp256k1ErrorZ represents the result of a fallible operation,
- * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_PayeePubKeySecp256k1ErrorZ {
+   struct LDKPathFailure failure;
    /**
-    * The contents of this CResult_PayeePubKeySecp256k1ErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * The payment path that failed.
     */
-   union LDKCResult_PayeePubKeySecp256k1ErrorZPtr contents;
+   struct LDKPath path;
    /**
-    * Whether this CResult_PayeePubKeySecp256k1ErrorZ represents a success state.
+    * The channel responsible for the failed payment path.
+    *
+    * Note that for route hints or for the first hop in a path this may be an SCID alias and
+    * may not refer to a channel in the public network graph. These aliases may also collide
+    * with channels in the public network graph.
+    *
+    * If this is `Some`, then the corresponding channel should be avoided when the payment is
+    * retried. May be `None` for older [`Event`] serializations.
     */
-   bool result_ok;
-} LDKCResult_PayeePubKeySecp256k1ErrorZ;
-
-
+   struct LDKCOption_u64Z short_channel_id;
+} LDKEvent_LDKPaymentPathFailed_Body;
 
-/**
- * Private routing information
- *
- * # Invariants
- * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
- *
- */
-typedef struct MUST_USE_STRUCT LDKPrivateRoute {
+typedef struct LDKEvent_LDKProbeSuccessful_Body {
    /**
-    * 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.
+    * The id returned by [`ChannelManager::send_probe`].
+    *
+    * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
     */
-   LDKnativePrivateRoute *inner;
+   struct LDKThirtyTwoBytes payment_id;
    /**
-    * 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.
+    * The hash generated by [`ChannelManager::send_probe`].
+    *
+    * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
     */
-   bool is_owned;
-} LDKPrivateRoute;
+   struct LDKThirtyTwoBytes payment_hash;
+   /**
+    * The payment path that was successful.
+    */
+   struct LDKPath path;
+} LDKEvent_LDKProbeSuccessful_Body;
 
-/**
- * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
- * This corresponds to std::vector in C++
- */
-typedef struct LDKCVec_PrivateRouteZ {
+typedef struct LDKEvent_LDKProbeFailed_Body {
    /**
-    * The elements in the array.
-    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+    * The id returned by [`ChannelManager::send_probe`].
+    *
+    * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
     */
-   struct LDKPrivateRoute *data;
+   struct LDKThirtyTwoBytes payment_id;
    /**
-    * The number of elements pointed to by `data`.
+    * The hash generated by [`ChannelManager::send_probe`].
+    *
+    * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
     */
-   uintptr_t datalen;
-} LDKCVec_PrivateRouteZ;
-
-
-
-/**
- * A timestamp that refers to a date after 1 January 1970.
- *
- * # Invariants
- *
- * The Unix timestamp representing the stored time has to be positive and no greater than
- * [`MAX_TIMESTAMP`].
- */
-typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
+   struct LDKThirtyTwoBytes payment_hash;
    /**
-    * 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.
+    * The payment path that failed.
     */
-   LDKnativePositiveTimestamp *inner;
+   struct LDKPath path;
    /**
-    * 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.
+    * The channel responsible for the failed probe.
+    *
+    * Note that for route hints or for the first hop in a path this may be an SCID alias and
+    * may not refer to a channel in the public network graph. These aliases may also collide
+    * with channels in the public network graph.
     */
-   bool is_owned;
-} LDKPositiveTimestamp;
+   struct LDKCOption_u64Z short_channel_id;
+} LDKEvent_LDKProbeFailed_Body;
 
-/**
- * The contents of CResult_PositiveTimestampCreationErrorZ
- */
-typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
+typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * The minimum amount of time that should be waited prior to calling
+    * process_pending_htlc_forwards. To increase the effort required to correlate payments,
+    * you should wait a random amount of time in roughly the range (now + time_forwardable,
+    * now + 5*time_forwardable).
     */
-   struct LDKPositiveTimestamp *result;
+   uint64_t time_forwardable;
+} LDKEvent_LDKPendingHTLCsForwardable_Body;
+
+typedef struct LDKEvent_LDKHTLCIntercepted_Body {
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * An id to help LDK identify which HTLC is being forwarded or failed.
     */
-   enum LDKCreationError *err;
-} LDKCResult_PositiveTimestampCreationErrorZPtr;
-
-/**
- * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
- * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
+   struct LDKThirtyTwoBytes intercept_id;
    /**
-    * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * The fake scid that was programmed as the next hop's scid, generated using
+    * [`ChannelManager::get_intercept_scid`].
+    *
+    * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
     */
-   union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
+   uint64_t requested_next_hop_scid;
    /**
-    * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
+    * The payment hash used for this HTLC.
     */
-   bool result_ok;
-} LDKCResult_PositiveTimestampCreationErrorZ;
-
-/**
- * The contents of CResult_NoneBolt11SemanticErrorZ
- */
-typedef union LDKCResult_NoneBolt11SemanticErrorZPtr {
+   struct LDKThirtyTwoBytes payment_hash;
    /**
-    * Note that this value is always NULL, as there are no contents in the OK variant
+    * How many msats were received on the inbound edge of this HTLC.
     */
-   void *result;
+   uint64_t inbound_amount_msat;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * How many msats the payer intended to route to the next node. Depending on the reason you are
+    * intercepting this payment, you might take a fee by forwarding less than this amount.
+    * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
+    *
+    * Note that LDK will NOT check that expected fees were factored into this value. You MUST
+    * check that whatever fee you want has been included here or subtract it as required. Further,
+    * LDK will not stop you from forwarding more than you received.
     */
-   enum LDKBolt11SemanticError *err;
-} LDKCResult_NoneBolt11SemanticErrorZPtr;
+   uint64_t expected_outbound_amount_msat;
+} LDKEvent_LDKHTLCIntercepted_Body;
 
-/**
- * A CResult_NoneBolt11SemanticErrorZ represents the result of a fallible operation,
- * containing a () on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_NoneBolt11SemanticErrorZ {
+typedef struct LDKEvent_LDKSpendableOutputs_Body {
    /**
-    * The contents of this CResult_NoneBolt11SemanticErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * The outputs which you should store as spendable by you.
     */
-   union LDKCResult_NoneBolt11SemanticErrorZPtr contents;
+   struct LDKCVec_SpendableOutputDescriptorZ outputs;
    /**
-    * Whether this CResult_NoneBolt11SemanticErrorZ represents a success state.
+    * The `channel_id` indicating which channel the spendable outputs belong to.
+    *
+    * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   bool result_ok;
-} LDKCResult_NoneBolt11SemanticErrorZ;
+   struct LDKChannelId channel_id;
+} LDKEvent_LDKSpendableOutputs_Body;
 
-/**
- * The contents of CResult_Bolt11InvoiceBolt11SemanticErrorZ
- */
-typedef union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr {
+typedef struct LDKEvent_LDKPaymentForwarded_Body {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * The channel id of the incoming channel between the previous node and us.
+    *
+    * This is only `None` for events generated or serialized by versions prior to 0.0.107.
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   struct LDKBolt11Invoice *result;
+   struct LDKChannelId prev_channel_id;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * The channel id of the outgoing channel between the next node and us.
+    *
+    * This is only `None` for events generated or serialized by versions prior to 0.0.107.
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   enum LDKBolt11SemanticError *err;
-} LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr;
-
-/**
- * A CResult_Bolt11InvoiceBolt11SemanticErrorZ represents the result of a fallible operation,
- * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ {
+   struct LDKChannelId next_channel_id;
    /**
-    * The contents of this CResult_Bolt11InvoiceBolt11SemanticErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * The `user_channel_id` of the incoming channel between the previous node and us.
+    *
+    * This is only `None` for events generated or serialized by versions prior to 0.0.122.
     */
-   union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr contents;
+   struct LDKCOption_U128Z prev_user_channel_id;
    /**
-    * Whether this CResult_Bolt11InvoiceBolt11SemanticErrorZ represents a success state.
+    * The `user_channel_id` of the outgoing channel between the next node and us.
+    *
+    * This will be `None` if the payment was settled via an on-chain transaction. See the
+    * caveat described for the `total_fee_earned_msat` field. Moreover it will be `None` for
+    * events generated or serialized by versions prior to 0.0.122.
     */
-   bool result_ok;
-} LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ;
-
-
-
-/**
- * Description string
- *
- * # Invariants
- * The description can be at most 639 __bytes__ long
- */
-typedef struct MUST_USE_STRUCT LDKDescription {
+   struct LDKCOption_U128Z next_user_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.
+    * The total fee, in milli-satoshis, which was earned as a result of the payment.
+    *
+    * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
+    * was pending, the amount the next hop claimed will have been rounded down to the nearest
+    * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
+    * claimed the full value in millisatoshis from the source. In this case,
+    * `claim_from_onchain_tx` will be set.
+    *
+    * If the channel which sent us the payment has been force-closed, we will claim the funds
+    * via an on-chain transaction. In that case we do not yet know the on-chain transaction
+    * fees which we will spend and will instead set this to `None`. It is possible duplicate
+    * `PaymentForwarded` events are generated for the same payment iff `total_fee_earned_msat` is
+    * `None`.
     */
-   LDKnativeDescription *inner;
+   struct LDKCOption_u64Z total_fee_earned_msat;
    /**
-    * 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.
+    * The share of the total fee, in milli-satoshis, which was withheld in addition to the
+    * forwarding fee.
+    *
+    * This will only be `Some` if we forwarded an intercepted HTLC with less than the
+    * expected amount. This means our counterparty accepted to receive less than the invoice
+    * amount, e.g., by claiming the payment featuring a corresponding
+    * [`PaymentClaimable::counterparty_skimmed_fee_msat`].
+    *
+    * Will also always be `None` for events serialized with LDK prior to version 0.0.122.
+    *
+    * The caveat described above the `total_fee_earned_msat` field applies here as well.
+    *
+    * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: Self::PaymentClaimable::counterparty_skimmed_fee_msat
     */
-   bool is_owned;
-} LDKDescription;
-
-/**
- * The contents of CResult_DescriptionCreationErrorZ
- */
-typedef union LDKCResult_DescriptionCreationErrorZPtr {
+   struct LDKCOption_u64Z skimmed_fee_msat;
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
+    * transaction.
     */
-   struct LDKDescription *result;
+   bool claim_from_onchain_tx;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * The final amount forwarded, in milli-satoshis, after the fee is deducted.
+    *
+    * The caveat described above the `total_fee_earned_msat` field applies here as well.
     */
-   enum LDKCreationError *err;
-} LDKCResult_DescriptionCreationErrorZPtr;
+   struct LDKCOption_u64Z outbound_amount_forwarded_msat;
+} LDKEvent_LDKPaymentForwarded_Body;
 
-/**
- * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
- * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_DescriptionCreationErrorZ {
+typedef struct LDKEvent_LDKChannelPending_Body {
    /**
-    * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * The `channel_id` of the channel that is pending confirmation.
     */
-   union LDKCResult_DescriptionCreationErrorZPtr contents;
+   struct LDKChannelId channel_id;
    /**
-    * Whether this CResult_DescriptionCreationErrorZ represents a success state.
+    * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
+    * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
+    * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
+    * `user_channel_id` will be randomized for an inbound channel.
+    *
+    * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+    * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+    * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
     */
-   bool result_ok;
-} LDKCResult_DescriptionCreationErrorZ;
-
-/**
- * The contents of CResult_PrivateRouteCreationErrorZ
- */
-typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
+   struct LDKU128 user_channel_id;
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * The `temporary_channel_id` this channel used to be known by during channel establishment.
+    *
+    * Will be `None` for channels created prior to LDK version 0.0.115.
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   struct LDKPrivateRoute *result;
+   struct LDKChannelId former_temporary_channel_id;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * The `node_id` of the channel counterparty.
     */
-   enum LDKCreationError *err;
-} LDKCResult_PrivateRouteCreationErrorZPtr;
-
-/**
- * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
- * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_PrivateRouteCreationErrorZ {
+   struct LDKPublicKey counterparty_node_id;
    /**
-    * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * The outpoint of the channel's funding transaction.
     */
-   union LDKCResult_PrivateRouteCreationErrorZPtr contents;
+   struct LDKOutPoint funding_txo;
    /**
-    * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
+    * The features that this channel will operate with.
+    *
+    * Will be `None` for channels created prior to LDK version 0.0.122.
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   bool result_ok;
-} LDKCResult_PrivateRouteCreationErrorZ;
+   struct LDKChannelTypeFeatures channel_type;
+} LDKEvent_LDKChannelPending_Body;
 
-/**
- * The contents of CResult_OutPointDecodeErrorZ
- */
-typedef union LDKCResult_OutPointDecodeErrorZPtr {
+typedef struct LDKEvent_LDKChannelReady_Body {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * The `channel_id` of the channel that is ready.
     */
-   struct LDKOutPoint *result;
+   struct LDKChannelId channel_id;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
-    */
-   struct LDKDecodeError *err;
-} LDKCResult_OutPointDecodeErrorZPtr;
-
-/**
- * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_OutPointDecodeErrorZ {
+    * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
+    * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
+    * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
+    * `user_channel_id` will be randomized for an inbound channel.
+    *
+    * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+    * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+    * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+    */
+   struct LDKU128 user_channel_id;
    /**
-    * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * The `node_id` of the channel counterparty.
     */
-   union LDKCResult_OutPointDecodeErrorZPtr contents;
+   struct LDKPublicKey counterparty_node_id;
    /**
-    * Whether this CResult_OutPointDecodeErrorZ represents a success state.
+    * The features that this channel will operate with.
     */
-   bool result_ok;
-} LDKCResult_OutPointDecodeErrorZ;
-
-
+   struct LDKChannelTypeFeatures channel_type;
+} LDKEvent_LDKChannelReady_Body;
 
-/**
- * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
- * variable-length integers except that it is serialized in big-endian instead of little-endian.
- *
- * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
- * encoded in several different ways, which we must check for at deserialization-time. Thus, if
- * you're looking for an example of a variable-length integer to use for your own project, move
- * along, this is a rather poor design.
- */
-typedef struct MUST_USE_STRUCT LDKBigSize {
+typedef struct LDKEvent_LDKChannelClosed_Body {
    /**
-    * 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.
+    * The `channel_id` of the channel which has been closed. Note that on-chain transactions
+    * resolving the channel are likely still awaiting confirmation.
     */
-   LDKnativeBigSize *inner;
+   struct LDKChannelId channel_id;
    /**
-    * 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.
+    * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
+    * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
+    * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
+    * `user_channel_id` will be randomized for inbound channels.
+    * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
+    * zero for objects serialized with LDK versions prior to 0.0.102.
+    *
+    * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+    * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+    * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
     */
-   bool is_owned;
-} LDKBigSize;
+   struct LDKU128 user_channel_id;
+   /**
+    * The reason the channel was closed.
+    */
+   struct LDKClosureReason reason;
+   /**
+    * Counterparty in the closed channel.
+    *
+    * This field will be `None` for objects serialized prior to LDK 0.0.117.
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    */
+   struct LDKPublicKey counterparty_node_id;
+   /**
+    * Channel capacity of the closing channel (sats).
+    *
+    * This field will be `None` for objects serialized prior to LDK 0.0.117.
+    */
+   struct LDKCOption_u64Z channel_capacity_sats;
+   /**
+    * The original channel funding TXO; this helps checking for the existence and confirmation
+    * status of the closing tx.
+    * Note that for instances serialized in v0.0.119 or prior this will be missing (None).
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    */
+   struct LDKOutPoint channel_funding_txo;
+} LDKEvent_LDKChannelClosed_Body;
 
-/**
- * The contents of CResult_BigSizeDecodeErrorZ
- */
-typedef union LDKCResult_BigSizeDecodeErrorZPtr {
+typedef struct LDKEvent_LDKDiscardFunding_Body {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * The channel_id of the channel which has been closed.
     */
-   struct LDKBigSize *result;
+   struct LDKChannelId channel_id;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * The full transaction received from the user
     */
-   struct LDKDecodeError *err;
-} LDKCResult_BigSizeDecodeErrorZPtr;
+   struct LDKFundingInfo funding_info;
+} LDKEvent_LDKDiscardFunding_Body;
 
-/**
- * A CResult_BigSizeDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::util::ser::BigSize on success and a crate::lightning::ln::msgs::DecodeError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_BigSizeDecodeErrorZ {
+typedef struct LDKEvent_LDKOpenChannelRequest_Body {
    /**
-    * The contents of this CResult_BigSizeDecodeErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * The temporary channel ID of the channel requested to be opened.
+    *
+    * When responding to the request, the `temporary_channel_id` should be passed
+    * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
+    * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
+    *
+    * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+    * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
     */
-   union LDKCResult_BigSizeDecodeErrorZPtr contents;
+   struct LDKChannelId temporary_channel_id;
    /**
-    * Whether this CResult_BigSizeDecodeErrorZ represents a success state.
+    * The node_id of the counterparty requesting to open the channel.
+    *
+    * When responding to the request, the `counterparty_node_id` should be passed
+    * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
+    * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
+    * request.
+    *
+    * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+    * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
     */
-   bool result_ok;
-} LDKCResult_BigSizeDecodeErrorZ;
+   struct LDKPublicKey counterparty_node_id;
+   /**
+    * The channel value of the requested channel.
+    */
+   uint64_t funding_satoshis;
+   /**
+    * Our starting balance in the channel if the request is accepted, in milli-satoshi.
+    */
+   uint64_t push_msat;
+   /**
+    * The features that this channel will operate with. If you reject the channel, a
+    * well-behaved counterparty may automatically re-attempt the channel with a new set of
+    * feature flags.
+    *
+    * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
+    * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
+    * 0.0.106.
+    *
+    * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
+    * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
+    * 0.0.107. Channels setting this type also need to get manually accepted via
+    * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
+    * or will be rejected otherwise.
+    *
+    * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+    */
+   struct LDKChannelTypeFeatures channel_type;
+   /**
+    * True if this channel is (or will be) publicly-announced.
+    */
+   bool is_announced;
+   /**
+    * Channel parameters given by the counterparty.
+    */
+   struct LDKChannelParameters params;
+} LDKEvent_LDKOpenChannelRequest_Body;
 
-/**
- * The contents of CResult_HostnameDecodeErrorZ
- */
-typedef union LDKCResult_HostnameDecodeErrorZPtr {
+typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * The channel over which the HTLC was received.
     */
-   struct LDKHostname *result;
+   struct LDKChannelId prev_channel_id;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * Destination of the HTLC that failed to be processed.
     */
-   struct LDKDecodeError *err;
-} LDKCResult_HostnameDecodeErrorZPtr;
+   struct LDKHTLCDestination failed_next_destination;
+} LDKEvent_LDKHTLCHandlingFailed_Body;
 
-/**
- * A CResult_HostnameDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::util::ser::Hostname on success and a crate::lightning::ln::msgs::DecodeError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_HostnameDecodeErrorZ {
+typedef struct LDKEvent_LDKOnionMessageIntercepted_Body {
    /**
-    * The contents of this CResult_HostnameDecodeErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * The node id of the offline peer.
     */
-   union LDKCResult_HostnameDecodeErrorZPtr contents;
+   struct LDKPublicKey peer_node_id;
    /**
-    * Whether this CResult_HostnameDecodeErrorZ represents a success state.
+    * The onion message intended to be forwarded to `peer_node_id`.
     */
-   bool result_ok;
-} LDKCResult_HostnameDecodeErrorZ;
+   struct LDKOnionMessage message;
+} LDKEvent_LDKOnionMessageIntercepted_Body;
 
+typedef struct LDKEvent_LDKOnionMessagePeerConnected_Body {
+   /**
+    * The node id of the peer we just connected to, who advertises support for
+    * onion messages.
+    */
+   struct LDKPublicKey peer_node_id;
+} LDKEvent_LDKOnionMessagePeerConnected_Body;
 
+typedef struct MUST_USE_STRUCT LDKEvent {
+   LDKEvent_Tag tag;
+   union {
+      LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
+      LDKEvent_LDKFundingTxBroadcastSafe_Body funding_tx_broadcast_safe;
+      LDKEvent_LDKPaymentClaimable_Body payment_claimable;
+      LDKEvent_LDKPaymentClaimed_Body payment_claimed;
+      LDKEvent_LDKConnectionNeeded_Body connection_needed;
+      LDKEvent_LDKInvoiceReceived_Body invoice_received;
+      LDKEvent_LDKPaymentSent_Body payment_sent;
+      LDKEvent_LDKPaymentFailed_Body payment_failed;
+      LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
+      LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
+      LDKEvent_LDKProbeSuccessful_Body probe_successful;
+      LDKEvent_LDKProbeFailed_Body probe_failed;
+      LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
+      LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
+      LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
+      LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
+      LDKEvent_LDKChannelPending_Body channel_pending;
+      LDKEvent_LDKChannelReady_Body channel_ready;
+      LDKEvent_LDKChannelClosed_Body channel_closed;
+      LDKEvent_LDKDiscardFunding_Body discard_funding;
+      LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
+      LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
+      struct {
+         struct LDKBumpTransactionEvent bump_transaction;
+      };
+      LDKEvent_LDKOnionMessageIntercepted_Body onion_message_intercepted;
+      LDKEvent_LDKOnionMessagePeerConnected_Body onion_message_peer_connected;
+   };
+} LDKEvent;
 
 /**
- * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`]
- * if the `Transaction`'s consensus-serialized length is <= u16::MAX.
- *
- * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`.
+ * An enum which can either contain a crate::lightning::events::Event or not
  */
-typedef struct MUST_USE_STRUCT LDKTransactionU16LenLimited {
+typedef enum LDKCOption_EventZ_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_EventZ contains a crate::lightning::events::Event
     */
-   LDKnativeTransactionU16LenLimited *inner;
+   LDKCOption_EventZ_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_EventZ contains nothing
     */
-   bool is_owned;
-} LDKTransactionU16LenLimited;
+   LDKCOption_EventZ_None,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKCOption_EventZ_Sentinel,
+} LDKCOption_EventZ_Tag;
+
+typedef struct LDKCOption_EventZ {
+   LDKCOption_EventZ_Tag tag;
+   union {
+      struct {
+         struct LDKEvent some;
+      };
+   };
+} LDKCOption_EventZ;
 
 /**
- * The contents of CResult_TransactionU16LenLimitedNoneZ
+ * The contents of CResult_COption_EventZDecodeErrorZ
  */
-typedef union LDKCResult_TransactionU16LenLimitedNoneZPtr {
+typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKTransactionU16LenLimited *result;
+   struct LDKCOption_EventZ *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_TransactionU16LenLimitedNoneZPtr;
+   struct LDKDecodeError *err;
+} LDKCResult_COption_EventZDecodeErrorZPtr;
 
 /**
- * A CResult_TransactionU16LenLimitedNoneZ represents the result of a fallible operation,
- * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a () on failure.
+ * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_TransactionU16LenLimitedNoneZ {
+typedef struct LDKCResult_COption_EventZDecodeErrorZ {
    /**
-    * The contents of this CResult_TransactionU16LenLimitedNoneZ, accessible via either
+    * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_TransactionU16LenLimitedNoneZPtr contents;
+   union LDKCResult_COption_EventZDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_TransactionU16LenLimitedNoneZ represents a success state.
+    * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_TransactionU16LenLimitedNoneZ;
+} LDKCResult_COption_EventZDecodeErrorZ;
 
 /**
- * The contents of CResult_TransactionU16LenLimitedDecodeErrorZ
+ * The contents of CResult_NonceDecodeErrorZ
  */
-typedef union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr {
+typedef union LDKCResult_NonceDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKTransactionU16LenLimited *result;
+   struct LDKNonce *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr;
+} LDKCResult_NonceDecodeErrorZPtr;
 
 /**
- * A CResult_TransactionU16LenLimitedDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_NonceDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::offers::nonce::Nonce on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ {
+typedef struct LDKCResult_NonceDecodeErrorZ {
    /**
-    * The contents of this CResult_TransactionU16LenLimitedDecodeErrorZ, accessible via either
+    * The contents of this CResult_NonceDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr contents;
+   union LDKCResult_NonceDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_TransactionU16LenLimitedDecodeErrorZ represents a success state.
+    * Whether this CResult_NonceDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_TransactionU16LenLimitedDecodeErrorZ;
+} LDKCResult_NonceDecodeErrorZ;
 
 /**
- * The contents of CResult_UntrustedStringDecodeErrorZ
+ * A dynamically-allocated array of crate::lightning_types::routing::RouteHintHops of arbitrary size.
+ * This corresponds to std::vector in C++
  */
-typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
+typedef struct LDKCVec_RouteHintHopZ {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
     */
-   struct LDKUntrustedString *result;
+   struct LDKRouteHintHop *data;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * The number of elements pointed to by `data`.
     */
-   struct LDKDecodeError *err;
-} LDKCResult_UntrustedStringDecodeErrorZPtr;
+   uintptr_t datalen;
+} LDKCVec_RouteHintHopZ;
 
 /**
- * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::util::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ * Sub-errors which don't have specific information in them use this type.
  */
-typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
+typedef struct LDKError {
    /**
-    * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
     */
-   union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
+   uint8_t _dummy;
+} LDKError;
+
+/**
+ * Errors that indicate what is wrong with the invoice. They have some granularity for debug
+ * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
+ */
+typedef enum LDKBolt11ParseError_Tag {
+   LDKBolt11ParseError_Bech32Error,
+   LDKBolt11ParseError_ParseAmountError,
+   LDKBolt11ParseError_MalformedSignature,
+   LDKBolt11ParseError_BadPrefix,
+   LDKBolt11ParseError_UnknownCurrency,
+   LDKBolt11ParseError_UnknownSiPrefix,
+   LDKBolt11ParseError_MalformedHRP,
+   LDKBolt11ParseError_TooShortDataPart,
+   LDKBolt11ParseError_UnexpectedEndOfTaggedFields,
+   LDKBolt11ParseError_DescriptionDecodeError,
+   LDKBolt11ParseError_PaddingError,
+   LDKBolt11ParseError_IntegerOverflowError,
+   LDKBolt11ParseError_InvalidSegWitProgramLength,
+   LDKBolt11ParseError_InvalidPubKeyHashLength,
+   LDKBolt11ParseError_InvalidScriptHashLength,
+   LDKBolt11ParseError_InvalidRecoveryId,
+   LDKBolt11ParseError_InvalidSliceLength,
    /**
-    * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
+    * Not an error, but used internally to signal that a part of the invoice should be ignored
+    * according to BOLT11
     */
-   bool result_ok;
-} LDKCResult_UntrustedStringDecodeErrorZ;
+   LDKBolt11ParseError_Skip,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKBolt11ParseError_Sentinel,
+} LDKBolt11ParseError_Tag;
+
+typedef struct MUST_USE_STRUCT LDKBolt11ParseError {
+   LDKBolt11ParseError_Tag tag;
+   union {
+      struct {
+         struct LDKBech32Error bech32_error;
+      };
+      struct {
+         struct LDKError parse_amount_error;
+      };
+      struct {
+         enum LDKSecp256k1Error malformed_signature;
+      };
+      struct {
+         struct LDKError description_decode_error;
+      };
+      struct {
+         struct LDKStr invalid_slice_length;
+      };
+   };
+} LDKBolt11ParseError;
 
 /**
- * The contents of CResult_ChannelIdDecodeErrorZ
+ * The contents of CResult_SiPrefixBolt11ParseErrorZ
  */
-typedef union LDKCResult_ChannelIdDecodeErrorZPtr {
+typedef union LDKCResult_SiPrefixBolt11ParseErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKChannelId *result;
+   enum LDKSiPrefix *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKDecodeError *err;
-} LDKCResult_ChannelIdDecodeErrorZPtr;
+   struct LDKBolt11ParseError *err;
+} LDKCResult_SiPrefixBolt11ParseErrorZPtr;
 
 /**
- * A CResult_ChannelIdDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::types::ChannelId on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_SiPrefixBolt11ParseErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::Bolt11ParseError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_ChannelIdDecodeErrorZ {
+typedef struct LDKCResult_SiPrefixBolt11ParseErrorZ {
    /**
-    * The contents of this CResult_ChannelIdDecodeErrorZ, accessible via either
+    * The contents of this CResult_SiPrefixBolt11ParseErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_ChannelIdDecodeErrorZPtr contents;
+   union LDKCResult_SiPrefixBolt11ParseErrorZPtr contents;
    /**
-    * Whether this CResult_ChannelIdDecodeErrorZ represents a success state.
+    * Whether this CResult_SiPrefixBolt11ParseErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_ChannelIdDecodeErrorZ;
-
-/**
- * A tuple of 2 elements. See the individual fields for the types contained.
- */
-typedef struct LDKC2Tuple__u832u16Z {
-   /**
-    * The element at position 0
-    */
-   struct LDKThirtyTwoBytes a;
-   /**
-    * The element at position 1
-    */
-   uint16_t b;
-} LDKC2Tuple__u832u16Z;
+} LDKCResult_SiPrefixBolt11ParseErrorZ;
 
 
 
 /**
- * Parameters for relaying over a given [`BlindedHop`].
+ * Represents a syntactically and semantically correct lightning BOLT11 invoice.
  *
- * [`BlindedHop`]: crate::blinded_path::BlindedHop
+ * There are three ways to construct a `Bolt11Invoice`:
+ *  1. using [`InvoiceBuilder`]
+ *  2. using [`Bolt11Invoice::from_signed`]
+ *  3. using `str::parse::<Bolt11Invoice>(&str)` (see [`Bolt11Invoice::from_str`])
+ *
+ * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
  */
-typedef struct MUST_USE_STRUCT LDKPaymentRelay {
+typedef struct MUST_USE_STRUCT LDKBolt11Invoice {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativePaymentRelay *inner;
+   LDKnativeBolt11Invoice *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKPaymentRelay;
+} LDKBolt11Invoice;
 
 /**
- * The contents of CResult_PaymentRelayDecodeErrorZ
+ * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
+ * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
+ * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
  */
-typedef union LDKCResult_PaymentRelayDecodeErrorZPtr {
+typedef enum LDKParseOrSemanticError_Tag {
+   /**
+    * The invoice couldn't be decoded
+    */
+   LDKParseOrSemanticError_ParseError,
+   /**
+    * The invoice could be decoded but violates the BOLT11 standard
+    */
+   LDKParseOrSemanticError_SemanticError,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKParseOrSemanticError_Sentinel,
+} LDKParseOrSemanticError_Tag;
+
+typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
+   LDKParseOrSemanticError_Tag tag;
+   union {
+      struct {
+         struct LDKBolt11ParseError parse_error;
+      };
+      struct {
+         enum LDKBolt11SemanticError semantic_error;
+      };
+   };
+} LDKParseOrSemanticError;
+
+/**
+ * The contents of CResult_Bolt11InvoiceParseOrSemanticErrorZ
+ */
+typedef union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKPaymentRelay *result;
+   struct LDKBolt11Invoice *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKDecodeError *err;
-} LDKCResult_PaymentRelayDecodeErrorZPtr;
+   struct LDKParseOrSemanticError *err;
+} LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr;
 
 /**
- * A CResult_PaymentRelayDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::blinded_path::payment::PaymentRelay on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_Bolt11InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_PaymentRelayDecodeErrorZ {
+typedef struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ {
    /**
-    * The contents of this CResult_PaymentRelayDecodeErrorZ, accessible via either
+    * The contents of this CResult_Bolt11InvoiceParseOrSemanticErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_PaymentRelayDecodeErrorZPtr contents;
+   union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr contents;
    /**
-    * Whether this CResult_PaymentRelayDecodeErrorZ represents a success state.
+    * Whether this CResult_Bolt11InvoiceParseOrSemanticErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_PaymentRelayDecodeErrorZ;
+} LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ;
 
 
 
 /**
- * Constraints for relaying over a given [`BlindedHop`].
+ * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
+ * invalid.
  *
- * [`BlindedHop`]: crate::blinded_path::BlindedHop
+ * # Invariants
+ * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`].
  */
-typedef struct MUST_USE_STRUCT LDKPaymentConstraints {
+typedef struct MUST_USE_STRUCT LDKSignedRawBolt11Invoice {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativePaymentConstraints *inner;
+   LDKnativeSignedRawBolt11Invoice *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKPaymentConstraints;
+} LDKSignedRawBolt11Invoice;
 
 /**
- * The contents of CResult_PaymentConstraintsDecodeErrorZ
+ * The contents of CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ
  */
-typedef union LDKCResult_PaymentConstraintsDecodeErrorZPtr {
+typedef union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKPaymentConstraints *result;
+   struct LDKSignedRawBolt11Invoice *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKDecodeError *err;
-} LDKCResult_PaymentConstraintsDecodeErrorZPtr;
+   struct LDKBolt11ParseError *err;
+} LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr;
 
 /**
- * A CResult_PaymentConstraintsDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::blinded_path::payment::PaymentConstraints on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::SignedRawBolt11Invoice on success and a crate::lightning_invoice::Bolt11ParseError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_PaymentConstraintsDecodeErrorZ {
+typedef struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ {
    /**
-    * The contents of this CResult_PaymentConstraintsDecodeErrorZ, accessible via either
+    * The contents of this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_PaymentConstraintsDecodeErrorZPtr contents;
+   union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr contents;
    /**
-    * Whether this CResult_PaymentConstraintsDecodeErrorZ represents a success state.
+    * Whether this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_PaymentConstraintsDecodeErrorZ;
+} LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ;
+
+
 
 /**
- * The contents of CResult_PaymentContextDecodeErrorZ
+ * Recoverable signature
  */
-typedef union LDKCResult_PaymentContextDecodeErrorZPtr {
+typedef struct MUST_USE_STRUCT LDKBolt11InvoiceSignature {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * 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 LDKPaymentContext *result;
+   LDKnativeBolt11InvoiceSignature *inner;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * 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.
     */
-   struct LDKDecodeError *err;
-} LDKCResult_PaymentContextDecodeErrorZPtr;
+   bool is_owned;
+} LDKBolt11InvoiceSignature;
 
 /**
- * A CResult_PaymentContextDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::blinded_path::payment::PaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ * A tuple of 3 elements. See the individual fields for the types contained.
  */
-typedef struct LDKCResult_PaymentContextDecodeErrorZ {
+typedef struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ {
    /**
-    * The contents of this CResult_PaymentContextDecodeErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * The element at position 0
     */
-   union LDKCResult_PaymentContextDecodeErrorZPtr contents;
+   struct LDKRawBolt11Invoice a;
    /**
-    * Whether this CResult_PaymentContextDecodeErrorZ represents a success state.
+    * The element at position 1
     */
-   bool result_ok;
-} LDKCResult_PaymentContextDecodeErrorZ;
+   struct LDKThirtyTwoBytes b;
+   /**
+    * The element at position 2
+    */
+   struct LDKBolt11InvoiceSignature c;
+} LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ;
+
+
 
 /**
- * The contents of CResult_UnknownPaymentContextDecodeErrorZ
+ * Payee public key
  */
-typedef union LDKCResult_UnknownPaymentContextDecodeErrorZPtr {
+typedef struct MUST_USE_STRUCT LDKPayeePubKey {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativePayeePubKey *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKPayeePubKey;
+
+/**
+ * The contents of CResult_PayeePubKeySecp256k1ErrorZ
+ */
+typedef union LDKCResult_PayeePubKeySecp256k1ErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKUnknownPaymentContext *result;
+   struct LDKPayeePubKey *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKDecodeError *err;
-} LDKCResult_UnknownPaymentContextDecodeErrorZPtr;
+   enum LDKSecp256k1Error *err;
+} LDKCResult_PayeePubKeySecp256k1ErrorZPtr;
 
 /**
- * A CResult_UnknownPaymentContextDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::blinded_path::payment::UnknownPaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_PayeePubKeySecp256k1ErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_UnknownPaymentContextDecodeErrorZ {
+typedef struct LDKCResult_PayeePubKeySecp256k1ErrorZ {
    /**
-    * The contents of this CResult_UnknownPaymentContextDecodeErrorZ, accessible via either
+    * The contents of this CResult_PayeePubKeySecp256k1ErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_UnknownPaymentContextDecodeErrorZPtr contents;
+   union LDKCResult_PayeePubKeySecp256k1ErrorZPtr contents;
    /**
-    * Whether this CResult_UnknownPaymentContextDecodeErrorZ represents a success state.
+    * Whether this CResult_PayeePubKeySecp256k1ErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_UnknownPaymentContextDecodeErrorZ;
+} LDKCResult_PayeePubKeySecp256k1ErrorZ;
+
+
 
 /**
- * The contents of CResult_Bolt12OfferContextDecodeErrorZ
+ * Private routing information
+ *
+ * # Invariants
+ * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
+ *
  */
-typedef union LDKCResult_Bolt12OfferContextDecodeErrorZPtr {
+typedef struct MUST_USE_STRUCT LDKPrivateRoute {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativePrivateRoute *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKPrivateRoute;
+
+/**
+ * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_PrivateRouteZ {
+   /**
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+    */
+   struct LDKPrivateRoute *data;
+   /**
+    * The number of elements pointed to by `data`.
+    */
+   uintptr_t datalen;
+} LDKCVec_PrivateRouteZ;
+
+
+
+/**
+ * A timestamp that refers to a date after 1 January 1970.
+ *
+ * # Invariants
+ *
+ * The Unix timestamp representing the stored time has to be positive and no greater than
+ * [`MAX_TIMESTAMP`].
+ */
+typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativePositiveTimestamp *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKPositiveTimestamp;
+
+/**
+ * The contents of CResult_PositiveTimestampCreationErrorZ
+ */
+typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKBolt12OfferContext *result;
+   struct LDKPositiveTimestamp *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKDecodeError *err;
-} LDKCResult_Bolt12OfferContextDecodeErrorZPtr;
+   enum LDKCreationError *err;
+} LDKCResult_PositiveTimestampCreationErrorZPtr;
 
 /**
- * A CResult_Bolt12OfferContextDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::blinded_path::payment::Bolt12OfferContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_Bolt12OfferContextDecodeErrorZ {
+typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
    /**
-    * The contents of this CResult_Bolt12OfferContextDecodeErrorZ, accessible via either
+    * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_Bolt12OfferContextDecodeErrorZPtr contents;
+   union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
    /**
-    * Whether this CResult_Bolt12OfferContextDecodeErrorZ represents a success state.
+    * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_Bolt12OfferContextDecodeErrorZ;
+} LDKCResult_PositiveTimestampCreationErrorZ;
 
 /**
- * The contents of CResult_Bolt12RefundContextDecodeErrorZ
+ * The contents of CResult_NoneBolt11SemanticErrorZ
  */
-typedef union LDKCResult_Bolt12RefundContextDecodeErrorZPtr {
+typedef union LDKCResult_NoneBolt11SemanticErrorZPtr {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * Note that this value is always NULL, as there are no contents in the OK variant
     */
-   struct LDKBolt12RefundContext *result;
+   void *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKDecodeError *err;
-} LDKCResult_Bolt12RefundContextDecodeErrorZPtr;
+   enum LDKBolt11SemanticError *err;
+} LDKCResult_NoneBolt11SemanticErrorZPtr;
 
 /**
- * A CResult_Bolt12RefundContextDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::blinded_path::payment::Bolt12RefundContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_NoneBolt11SemanticErrorZ represents the result of a fallible operation,
+ * containing a () on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_Bolt12RefundContextDecodeErrorZ {
+typedef struct LDKCResult_NoneBolt11SemanticErrorZ {
    /**
-    * The contents of this CResult_Bolt12RefundContextDecodeErrorZ, accessible via either
+    * The contents of this CResult_NoneBolt11SemanticErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_Bolt12RefundContextDecodeErrorZPtr contents;
+   union LDKCResult_NoneBolt11SemanticErrorZPtr contents;
    /**
-    * Whether this CResult_Bolt12RefundContextDecodeErrorZ represents a success state.
+    * Whether this CResult_NoneBolt11SemanticErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_Bolt12RefundContextDecodeErrorZ;
+} LDKCResult_NoneBolt11SemanticErrorZ;
 
 /**
- * The contents of CResult_StrSecp256k1ErrorZ
+ * The contents of CResult_Bolt11InvoiceBolt11SemanticErrorZ
  */
-typedef union LDKCResult_StrSecp256k1ErrorZPtr {
+typedef union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKStr *result;
+   struct LDKBolt11Invoice *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
-   enum LDKSecp256k1Error *err;
-} LDKCResult_StrSecp256k1ErrorZPtr;
+   enum LDKBolt11SemanticError *err;
+} LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr;
 
 /**
- * A CResult_StrSecp256k1ErrorZ represents the result of a fallible operation,
- * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
+ * A CResult_Bolt11InvoiceBolt11SemanticErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_StrSecp256k1ErrorZ {
+typedef struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ {
    /**
-    * The contents of this CResult_StrSecp256k1ErrorZ, accessible via either
+    * The contents of this CResult_Bolt11InvoiceBolt11SemanticErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_StrSecp256k1ErrorZPtr contents;
+   union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr contents;
    /**
-    * Whether this CResult_StrSecp256k1ErrorZ represents a success state.
+    * Whether this CResult_Bolt11InvoiceBolt11SemanticErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_StrSecp256k1ErrorZ;
+} LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ;
+
+
 
 /**
- * A tuple of 3 elements. See the individual fields for the types contained.
+ * Description string
+ *
+ * # Invariants
+ * The description can be at most 639 __bytes__ long
  */
-typedef struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ {
-   /**
-    * The element at position 0
-    */
-   struct LDKThirtyTwoBytes a;
+typedef struct MUST_USE_STRUCT LDKDescription {
    /**
-    * The element at position 1
+    * 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 LDKRecipientOnionFields b;
+   LDKnativeDescription *inner;
    /**
-    * The element at position 2
+    * 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.
     */
-   struct LDKRouteParameters c;
-} LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ;
+   bool is_owned;
+} LDKDescription;
 
 /**
- * The contents of CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ
+ * The contents of CResult_DescriptionCreationErrorZ
  */
-typedef union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr {
+typedef union LDKCResult_DescriptionCreationErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *result;
+   struct LDKDescription *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_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr;
+   enum LDKCreationError *err;
+} LDKCResult_DescriptionCreationErrorZPtr;
 
 /**
- * A CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents the result of a fallible operation,
- * containing a crate::c_types::derived::C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ on success and a () on failure.
+ * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ {
+typedef struct LDKCResult_DescriptionCreationErrorZ {
    /**
-    * The contents of this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ, accessible via either
+    * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr contents;
+   union LDKCResult_DescriptionCreationErrorZPtr contents;
    /**
-    * Whether this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents a success state.
+    * Whether this CResult_DescriptionCreationErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ;
+} LDKCResult_DescriptionCreationErrorZ;
 
 /**
- * A tuple of 3 elements. See the individual fields for the types contained.
+ * The contents of CResult_PrivateRouteCreationErrorZ
  */
-typedef struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ {
-   /**
-    * The element at position 0
-    */
-   struct LDKPublicKey a;
+typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
    /**
-    * The element at position 1
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKOnionMessage b;
+   struct LDKPrivateRoute *result;
    /**
-    * The element at position 2
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKCOption_CVec_SocketAddressZZ c;
-} LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ;
+   enum LDKCreationError *err;
+} LDKCResult_PrivateRouteCreationErrorZPtr;
 
 /**
- * Errors that may occur when [sending an onion message].
- *
- * [sending an onion message]: OnionMessenger::send_onion_message
+ * 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 enum LDKSendError_Tag {
+typedef struct LDKCResult_PrivateRouteCreationErrorZ {
    /**
-    * Errored computing onion message packet keys.
+    * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   LDKSendError_Secp256k1,
+   union LDKCResult_PrivateRouteCreationErrorZPtr contents;
    /**
-    * Because implementations such as Eclair will drop onion messages where the message packet
-    * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
+    * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
     */
-   LDKSendError_TooBigPacket,
+   bool result_ok;
+} LDKCResult_PrivateRouteCreationErrorZ;
+
+/**
+ * The contents of CResult_OutPointDecodeErrorZ
+ */
+typedef union LDKCResult_OutPointDecodeErrorZPtr {
    /**
-    * The provided [`Destination`] was an invalid [`BlindedPath`] due to not having any blinded
-    * hops.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   LDKSendError_TooFewBlindedHops,
+   struct LDKOutPoint *result;
    /**
-    * The first hop is not a peer and doesn't have a known [`SocketAddress`].
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   LDKSendError_InvalidFirstHop,
+   struct LDKDecodeError *err;
+} LDKCResult_OutPointDecodeErrorZPtr;
+
+/**
+ * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_OutPointDecodeErrorZ {
    /**
-    * A path from the sender to the destination could not be found by the [`MessageRouter`].
+    * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   LDKSendError_PathNotFound,
+   union LDKCResult_OutPointDecodeErrorZPtr contents;
    /**
-    * Onion message contents must have a TLV type >= 64.
+    * Whether this CResult_OutPointDecodeErrorZ represents a success state.
     */
-   LDKSendError_InvalidMessage,
+   bool result_ok;
+} LDKCResult_OutPointDecodeErrorZ;
+
+
+
+/**
+ * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
+ * variable-length integers except that it is serialized in big-endian instead of little-endian.
+ *
+ * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
+ * encoded in several different ways, which we must check for at deserialization-time. Thus, if
+ * you're looking for an example of a variable-length integer to use for your own project, move
+ * along, this is a rather poor design.
+ */
+typedef struct MUST_USE_STRUCT LDKBigSize {
    /**
-    * Our next-hop peer's buffer was full or our total outbound buffer was full.
+    * 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.
     */
-   LDKSendError_BufferFull,
+   LDKnativeBigSize *inner;
    /**
-    * Failed to retrieve our node id from the provided [`NodeSigner`].
-    *
-    * [`NodeSigner`]: crate::sign::NodeSigner
+    * 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.
     */
-   LDKSendError_GetNodeIdFailed,
+   bool is_owned;
+} LDKBigSize;
+
+/**
+ * The contents of CResult_BigSizeDecodeErrorZ
+ */
+typedef union LDKCResult_BigSizeDecodeErrorZPtr {
    /**
-    * The provided [`Destination`] has a blinded path with an unresolved introduction node. An
-    * attempt to resolve it in the [`MessageRouter`] when finding an [`OnionMessagePath`] likely
-    * failed.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   LDKSendError_UnresolvedIntroductionNode,
+   struct LDKBigSize *result;
    /**
-    * We attempted to send to a blinded path where we are the introduction node, and failed to
-    * advance the blinded path to make the second hop the new introduction node. Either
-    * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
-    * new blinding point, or we were attempting to send to ourselves.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   LDKSendError_BlindedPathAdvanceFailed,
+   struct LDKDecodeError *err;
+} LDKCResult_BigSizeDecodeErrorZPtr;
+
+/**
+ * A CResult_BigSizeDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::util::ser::BigSize on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_BigSizeDecodeErrorZ {
    /**
-    * Must be last for serialization purposes
+    * The contents of this CResult_BigSizeDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   LDKSendError_Sentinel,
-} LDKSendError_Tag;
-
-typedef struct MUST_USE_STRUCT LDKSendError {
-   LDKSendError_Tag tag;
-   union {
-      struct {
-         enum LDKSecp256k1Error secp256k1;
-      };
-      struct {
-         struct LDKPublicKey invalid_first_hop;
-      };
-   };
-} LDKSendError;
+   union LDKCResult_BigSizeDecodeErrorZPtr contents;
+   /**
+    * Whether this CResult_BigSizeDecodeErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_BigSizeDecodeErrorZ;
 
 /**
- * The contents of CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ
+ * The contents of CResult_UntrustedStringDecodeErrorZ
  */
-typedef union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr {
+typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *result;
+   struct LDKUntrustedString *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKSendError *err;
-} LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr;
+   struct LDKDecodeError *err;
+} LDKCResult_UntrustedStringDecodeErrorZPtr;
 
 /**
- * A CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents the result of a fallible operation,
- * containing a crate::c_types::derived::C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ on success and a crate::lightning::onion_message::messenger::SendError on failure.
+ * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_types::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ {
+typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
    /**
-    * The contents of this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ, accessible via either
+    * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr contents;
+   union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents a success state.
+    * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ;
+} LDKCResult_UntrustedStringDecodeErrorZ;
 
 /**
- * The next hop to forward an onion message along its path.
- *
- * Note that payment blinded paths always specify their next hop using an explicit node id.
+ * The contents of CResult_HostnameDecodeErrorZ
  */
-typedef enum LDKNextMessageHop_Tag {
-   /**
-    * The node id of the next hop.
-    */
-   LDKNextMessageHop_NodeId,
+typedef union LDKCResult_HostnameDecodeErrorZPtr {
    /**
-    * The short channel id leading to the next hop.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   LDKNextMessageHop_ShortChannelId,
+   struct LDKHostname *result;
    /**
-    * Must be last for serialization purposes
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   LDKNextMessageHop_Sentinel,
-} LDKNextMessageHop_Tag;
-
-typedef struct MUST_USE_STRUCT LDKNextMessageHop {
-   LDKNextMessageHop_Tag tag;
-   union {
-      struct {
-         struct LDKPublicKey node_id;
-      };
-      struct {
-         uint64_t short_channel_id;
-      };
-   };
-} LDKNextMessageHop;
+   struct LDKDecodeError *err;
+} LDKCResult_HostnameDecodeErrorZPtr;
 
 /**
- * The contents of an [`OnionMessage`] as read from the wire.
- *
- * [`OnionMessage`]: crate::ln::msgs::OnionMessage
+ * A CResult_HostnameDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::util::ser::Hostname on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef enum LDKParsedOnionMessageContents_Tag {
-   /**
-    * A message related to BOLT 12 Offers.
-    */
-   LDKParsedOnionMessageContents_Offers,
+typedef struct LDKCResult_HostnameDecodeErrorZ {
    /**
-    * A custom onion message specified by the user.
+    * The contents of this CResult_HostnameDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   LDKParsedOnionMessageContents_Custom,
+   union LDKCResult_HostnameDecodeErrorZPtr contents;
    /**
-    * Must be last for serialization purposes
+    * Whether this CResult_HostnameDecodeErrorZ represents a success state.
     */
-   LDKParsedOnionMessageContents_Sentinel,
-} LDKParsedOnionMessageContents_Tag;
+   bool result_ok;
+} LDKCResult_HostnameDecodeErrorZ;
+
 
-typedef struct MUST_USE_STRUCT LDKParsedOnionMessageContents {
-   LDKParsedOnionMessageContents_Tag tag;
-   union {
-      struct {
-         struct LDKOffersMessage offers;
-      };
-      struct {
-         struct LDKOnionMessageContents custom;
-      };
-   };
-} LDKParsedOnionMessageContents;
 
 /**
- * A processed incoming onion message, containing either a Forward (another onion message)
- * or a Receive payload with decrypted contents.
+ * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`]
+ * if the `Transaction`'s consensus-serialized length is <= u16::MAX.
+ *
+ * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`.
  */
-typedef enum LDKPeeledOnion_Tag {
-   /**
-    * Forwarded onion, with the next node id and a new onion
-    */
-   LDKPeeledOnion_Forward,
-   /**
-    * Received onion message, with decrypted contents, path_id, and reply path
-    */
-   LDKPeeledOnion_Receive,
-   /**
-    * Must be last for serialization purposes
-    */
-   LDKPeeledOnion_Sentinel,
-} LDKPeeledOnion_Tag;
-
-typedef struct LDKPeeledOnion_LDKForward_Body {
-   struct LDKNextMessageHop _0;
-   struct LDKOnionMessage _1;
-} LDKPeeledOnion_LDKForward_Body;
-
-typedef struct LDKPeeledOnion_LDKReceive_Body {
-   struct LDKParsedOnionMessageContents _0;
+typedef struct MUST_USE_STRUCT LDKTransactionU16LenLimited {
    /**
-    *
-    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * 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 LDKThirtyTwoBytes _1;
+   LDKnativeTransactionU16LenLimited *inner;
    /**
-    *
-    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * 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.
     */
-   struct LDKBlindedPath _2;
-} LDKPeeledOnion_LDKReceive_Body;
-
-typedef struct MUST_USE_STRUCT LDKPeeledOnion {
-   LDKPeeledOnion_Tag tag;
-   union {
-      LDKPeeledOnion_LDKForward_Body forward;
-      LDKPeeledOnion_LDKReceive_Body receive;
-   };
-} LDKPeeledOnion;
+   bool is_owned;
+} LDKTransactionU16LenLimited;
 
 /**
- * The contents of CResult_PeeledOnionNoneZ
+ * The contents of CResult_TransactionU16LenLimitedNoneZ
  */
-typedef union LDKCResult_PeeledOnionNoneZPtr {
+typedef union LDKCResult_TransactionU16LenLimitedNoneZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKPeeledOnion *result;
+   struct LDKTransactionU16LenLimited *result;
    /**
     * Note that this value is always NULL, as there are no contents in the Err variant
     */
    void *err;
-} LDKCResult_PeeledOnionNoneZPtr;
+} LDKCResult_TransactionU16LenLimitedNoneZPtr;
 
 /**
- * A CResult_PeeledOnionNoneZ represents the result of a fallible operation,
- * containing a crate::lightning::onion_message::messenger::PeeledOnion on success and a () on failure.
+ * A CResult_TransactionU16LenLimitedNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a () on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_PeeledOnionNoneZ {
+typedef struct LDKCResult_TransactionU16LenLimitedNoneZ {
    /**
-    * The contents of this CResult_PeeledOnionNoneZ, accessible via either
+    * The contents of this CResult_TransactionU16LenLimitedNoneZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_PeeledOnionNoneZPtr contents;
+   union LDKCResult_TransactionU16LenLimitedNoneZPtr contents;
    /**
-    * Whether this CResult_PeeledOnionNoneZ represents a success state.
+    * Whether this CResult_TransactionU16LenLimitedNoneZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_PeeledOnionNoneZ;
+} LDKCResult_TransactionU16LenLimitedNoneZ;
 
 /**
- * Result of successfully [sending an onion message].
- *
- * [sending an onion message]: OnionMessenger::send_onion_message
+ * The contents of CResult_TransactionU16LenLimitedDecodeErrorZ
  */
-typedef enum LDKSendSuccess_Tag {
+typedef union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr {
    /**
-    * The message was buffered and will be sent once it is processed by
-    * [`OnionMessageHandler::next_onion_message_for_peer`].
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   LDKSendSuccess_Buffered,
+   struct LDKTransactionU16LenLimited *result;
    /**
-    * The message was buffered and will be sent once the node is connected as a peer and it is
-    * processed by [`OnionMessageHandler::next_onion_message_for_peer`].
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   LDKSendSuccess_BufferedAwaitingConnection,
+   struct LDKDecodeError *err;
+} LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr;
+
+/**
+ * A CResult_TransactionU16LenLimitedDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ {
    /**
-    * Must be last for serialization purposes
+    * The contents of this CResult_TransactionU16LenLimitedDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   LDKSendSuccess_Sentinel,
-} LDKSendSuccess_Tag;
-
-typedef struct MUST_USE_STRUCT LDKSendSuccess {
-   LDKSendSuccess_Tag tag;
-   union {
-      struct {
-         struct LDKPublicKey buffered_awaiting_connection;
-      };
-   };
-} LDKSendSuccess;
+   union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr contents;
+   /**
+    * Whether this CResult_TransactionU16LenLimitedDecodeErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_TransactionU16LenLimitedDecodeErrorZ;
 
 /**
- * The contents of CResult_SendSuccessSendErrorZ
+ * The contents of CResult_ChannelIdDecodeErrorZ
  */
-typedef union LDKCResult_SendSuccessSendErrorZPtr {
+typedef union LDKCResult_ChannelIdDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKSendSuccess *result;
+   struct LDKChannelId *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKSendError *err;
-} LDKCResult_SendSuccessSendErrorZPtr;
+   struct LDKDecodeError *err;
+} LDKCResult_ChannelIdDecodeErrorZPtr;
 
 /**
- * A CResult_SendSuccessSendErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::onion_message::messenger::SendSuccess on success and a crate::lightning::onion_message::messenger::SendError on failure.
+ * A CResult_ChannelIdDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::types::ChannelId on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_SendSuccessSendErrorZ {
+typedef struct LDKCResult_ChannelIdDecodeErrorZ {
    /**
-    * The contents of this CResult_SendSuccessSendErrorZ, accessible via either
+    * The contents of this CResult_ChannelIdDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_SendSuccessSendErrorZPtr contents;
+   union LDKCResult_ChannelIdDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_SendSuccessSendErrorZ represents a success state.
+    * Whether this CResult_ChannelIdDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_SendSuccessSendErrorZ;
+} LDKCResult_ChannelIdDecodeErrorZ;
+
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple__u832u16Z {
+   /**
+    * The element at position 0
+    */
+   struct LDKThirtyTwoBytes a;
+   /**
+    * The element at position 1
+    */
+   uint16_t b;
+} LDKC2Tuple__u832u16Z;
+
+
+
+/**
+ * Information needed to route a payment across a [`BlindedPaymentPath`].
+ */
+typedef struct MUST_USE_STRUCT LDKBlindedPayInfo {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeBlindedPayInfo *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKBlindedPayInfo;
 
 /**
- * The contents of CResult_BlindedPathNoneZ
+ * The contents of CResult_BlindedPayInfoDecodeErrorZ
  */
-typedef union LDKCResult_BlindedPathNoneZPtr {
+typedef union LDKCResult_BlindedPayInfoDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKBlindedPath *result;
+   struct LDKBlindedPayInfo *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_BlindedPathNoneZPtr;
+   struct LDKDecodeError *err;
+} LDKCResult_BlindedPayInfoDecodeErrorZPtr;
 
 /**
- * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
- * containing a crate::lightning::blinded_path::BlindedPath on success and a () on failure.
+ * A CResult_BlindedPayInfoDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::BlindedPayInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_BlindedPathNoneZ {
+typedef struct LDKCResult_BlindedPayInfoDecodeErrorZ {
    /**
-    * The contents of this CResult_BlindedPathNoneZ, accessible via either
+    * The contents of this CResult_BlindedPayInfoDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_BlindedPathNoneZPtr contents;
+   union LDKCResult_BlindedPayInfoDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_BlindedPathNoneZ represents a success state.
+    * Whether this CResult_BlindedPayInfoDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_BlindedPathNoneZ;
+} LDKCResult_BlindedPayInfoDecodeErrorZ;
 
 /**
- * The contents of CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ
+ * The contents of CResult_BlindedPaymentPathNoneZ
  */
-typedef union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr {
+typedef union LDKCResult_BlindedPaymentPathNoneZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *result;
+   struct LDKBlindedPaymentPath *result;
    /**
     * Note that this value is always NULL, as there are no contents in the Err variant
     */
    void *err;
-} LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr;
+} LDKCResult_BlindedPaymentPathNoneZPtr;
 
 /**
- * A CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents the result of a fallible operation,
- * containing a crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZ on success and a () on failure.
+ * A CResult_BlindedPaymentPathNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::BlindedPaymentPath on success and a () on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ {
+typedef struct LDKCResult_BlindedPaymentPathNoneZ {
    /**
-    * The contents of this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ, accessible via either
+    * The contents of this CResult_BlindedPaymentPathNoneZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr contents;
+   union LDKCResult_BlindedPaymentPathNoneZPtr contents;
    /**
-    * Whether this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents a success state.
+    * Whether this CResult_BlindedPaymentPathNoneZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ;
+} LDKCResult_BlindedPaymentPathNoneZ;
 
 
 
 /**
  * An intermediate node, its outbound channel, and relay parameters.
  */
-typedef struct MUST_USE_STRUCT LDKForwardNode {
+typedef struct MUST_USE_STRUCT LDKPaymentForwardNode {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeForwardNode *inner;
+   LDKnativePaymentForwardNode *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKForwardNode;
+} LDKPaymentForwardNode;
 
 /**
- * A dynamically-allocated array of crate::lightning::blinded_path::payment::ForwardNodes of arbitrary size.
+ * A dynamically-allocated array of crate::lightning::blinded_path::payment::PaymentForwardNodes of arbitrary size.
  * This corresponds to std::vector in C++
  */
-typedef struct LDKCVec_ForwardNodeZ {
+typedef struct LDKCVec_PaymentForwardNodeZ {
    /**
     * The elements in the array.
     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
     */
-   struct LDKForwardNode *data;
+   struct LDKPaymentForwardNode *data;
    /**
     * The number of elements pointed to by `data`.
     */
    uintptr_t datalen;
-} LDKCVec_ForwardNodeZ;
+} LDKCVec_PaymentForwardNodeZ;
+
+
+
+/**
+ * Parameters for relaying over a given [`BlindedHop`].
+ *
+ * [`BlindedHop`]: crate::blinded_path::BlindedHop
+ */
+typedef struct MUST_USE_STRUCT LDKPaymentRelay {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativePaymentRelay *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKPaymentRelay;
 
 /**
- * The contents of CResult_BlindedPathDecodeErrorZ
+ * The contents of CResult_PaymentRelayDecodeErrorZ
  */
-typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
+typedef union LDKCResult_PaymentRelayDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKBlindedPath *result;
+   struct LDKPaymentRelay *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_BlindedPathDecodeErrorZPtr;
+} LDKCResult_PaymentRelayDecodeErrorZPtr;
 
 /**
- * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_PaymentRelayDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::PaymentRelay on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_BlindedPathDecodeErrorZ {
+typedef struct LDKCResult_PaymentRelayDecodeErrorZ {
    /**
-    * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
+    * The contents of this CResult_PaymentRelayDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_BlindedPathDecodeErrorZPtr contents;
+   union LDKCResult_PaymentRelayDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
+    * Whether this CResult_PaymentRelayDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_BlindedPathDecodeErrorZ;
+} LDKCResult_PaymentRelayDecodeErrorZ;
+
+
 
 /**
- * The contents of CResult_BlindedHopDecodeErrorZ
+ * Constraints for relaying over a given [`BlindedHop`].
+ *
+ * [`BlindedHop`]: crate::blinded_path::BlindedHop
  */
-typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
+typedef struct MUST_USE_STRUCT LDKPaymentConstraints {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativePaymentConstraints *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKPaymentConstraints;
+
+/**
+ * The contents of CResult_PaymentConstraintsDecodeErrorZ
+ */
+typedef union LDKCResult_PaymentConstraintsDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKBlindedHop *result;
+   struct LDKPaymentConstraints *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_BlindedHopDecodeErrorZPtr;
+} LDKCResult_PaymentConstraintsDecodeErrorZPtr;
 
 /**
- * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_PaymentConstraintsDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::PaymentConstraints on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_BlindedHopDecodeErrorZ {
+typedef struct LDKCResult_PaymentConstraintsDecodeErrorZ {
    /**
-    * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
+    * The contents of this CResult_PaymentConstraintsDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_BlindedHopDecodeErrorZPtr contents;
+   union LDKCResult_PaymentConstraintsDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
+    * Whether this CResult_PaymentConstraintsDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_BlindedHopDecodeErrorZ;
+} LDKCResult_PaymentConstraintsDecodeErrorZ;
 
 /**
- * The contents of CResult_InvoiceErrorDecodeErrorZ
+ * The contents of CResult_PaymentContextDecodeErrorZ
  */
-typedef union LDKCResult_InvoiceErrorDecodeErrorZPtr {
+typedef union LDKCResult_PaymentContextDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKInvoiceError *result;
+   struct LDKPaymentContext *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_InvoiceErrorDecodeErrorZPtr;
+} LDKCResult_PaymentContextDecodeErrorZPtr;
 
 /**
- * A CResult_InvoiceErrorDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::offers::invoice_error::InvoiceError on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_PaymentContextDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::PaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_InvoiceErrorDecodeErrorZ {
+typedef struct LDKCResult_PaymentContextDecodeErrorZ {
    /**
-    * The contents of this CResult_InvoiceErrorDecodeErrorZ, accessible via either
+    * The contents of this CResult_PaymentContextDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_InvoiceErrorDecodeErrorZPtr contents;
+   union LDKCResult_PaymentContextDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_InvoiceErrorDecodeErrorZ represents a success state.
+    * Whether this CResult_PaymentContextDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_InvoiceErrorDecodeErrorZ;
-
-
-
-/**
- * The state of a spendable output currently tracked by an [`OutputSweeper`].
- */
-typedef struct MUST_USE_STRUCT LDKTrackedSpendableOutput {
-   /**
-    * A pointer to the opaque Rust object.
-    * Nearly everywhere, inner must be non-null, however in places where
-    * the Rust equivalent takes an Option, it may be set to null to indicate None.
-    */
-   LDKnativeTrackedSpendableOutput *inner;
-   /**
-    * Indicates that this is the only struct which contains the same pointer.
-    * Rust functions which take ownership of an object provided via an argument require
-    * this to be true and invalidate the object pointed to by inner.
-    */
-   bool is_owned;
-} LDKTrackedSpendableOutput;
+} LDKCResult_PaymentContextDecodeErrorZ;
 
 /**
- * The contents of CResult_TrackedSpendableOutputDecodeErrorZ
+ * The contents of CResult_UnknownPaymentContextDecodeErrorZ
  */
-typedef union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr {
+typedef union LDKCResult_UnknownPaymentContextDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKTrackedSpendableOutput *result;
+   struct LDKUnknownPaymentContext *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_TrackedSpendableOutputDecodeErrorZPtr;
+} LDKCResult_UnknownPaymentContextDecodeErrorZPtr;
 
 /**
- * A CResult_TrackedSpendableOutputDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::util::sweep::TrackedSpendableOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_UnknownPaymentContextDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::UnknownPaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_TrackedSpendableOutputDecodeErrorZ {
+typedef struct LDKCResult_UnknownPaymentContextDecodeErrorZ {
    /**
-    * The contents of this CResult_TrackedSpendableOutputDecodeErrorZ, accessible via either
+    * The contents of this CResult_UnknownPaymentContextDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr contents;
+   union LDKCResult_UnknownPaymentContextDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_TrackedSpendableOutputDecodeErrorZ represents a success state.
+    * Whether this CResult_UnknownPaymentContextDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_TrackedSpendableOutputDecodeErrorZ;
+} LDKCResult_UnknownPaymentContextDecodeErrorZ;
 
 /**
- * The current status of the output spend.
+ * The contents of CResult_Bolt12OfferContextDecodeErrorZ
  */
-typedef enum LDKOutputSpendStatus_Tag {
-   /**
-    * The output is tracked but an initial spending transaction hasn't been generated and
-    * broadcasted yet.
-    */
-   LDKOutputSpendStatus_PendingInitialBroadcast,
-   /**
-    * A transaction spending the output has been broadcasted but is pending its first confirmation on-chain.
-    */
-   LDKOutputSpendStatus_PendingFirstConfirmation,
-   /**
-    * A transaction spending the output has been confirmed on-chain but will be tracked until it
-    * reaches [`ANTI_REORG_DELAY`] confirmations.
-    */
-   LDKOutputSpendStatus_PendingThresholdConfirmations,
+typedef union LDKCResult_Bolt12OfferContextDecodeErrorZPtr {
    /**
-    * Must be last for serialization purposes
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   LDKOutputSpendStatus_Sentinel,
-} LDKOutputSpendStatus_Tag;
-
-typedef struct LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body {
+   struct LDKBolt12OfferContext *result;
    /**
-    * The height at which we will first generate and broadcast a spending transaction.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKCOption_u32Z delayed_until_height;
-} LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body;
+   struct LDKDecodeError *err;
+} LDKCResult_Bolt12OfferContextDecodeErrorZPtr;
 
-typedef struct LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body {
-   /**
-    * The hash of the chain tip when we first broadcast a transaction spending this output.
-    */
-   struct LDKThirtyTwoBytes first_broadcast_hash;
+/**
+ * A CResult_Bolt12OfferContextDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::Bolt12OfferContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_Bolt12OfferContextDecodeErrorZ {
    /**
-    * The best height when we last broadcast a transaction spending this output.
+    * The contents of this CResult_Bolt12OfferContextDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   uint32_t latest_broadcast_height;
+   union LDKCResult_Bolt12OfferContextDecodeErrorZPtr contents;
    /**
-    * The transaction spending this output we last broadcasted.
+    * Whether this CResult_Bolt12OfferContextDecodeErrorZ represents a success state.
     */
-   struct LDKTransaction latest_spending_tx;
-} LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body;
+   bool result_ok;
+} LDKCResult_Bolt12OfferContextDecodeErrorZ;
 
-typedef struct LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body {
-   /**
-    * The hash of the chain tip when we first broadcast a transaction spending this output.
-    */
-   struct LDKThirtyTwoBytes first_broadcast_hash;
+/**
+ * The contents of CResult_Bolt12RefundContextDecodeErrorZ
+ */
+typedef union LDKCResult_Bolt12RefundContextDecodeErrorZPtr {
    /**
-    * The best height when we last broadcast a transaction spending this output.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   uint32_t latest_broadcast_height;
+   struct LDKBolt12RefundContext *result;
    /**
-    * The transaction spending this output we saw confirmed on-chain.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKTransaction latest_spending_tx;
+   struct LDKDecodeError *err;
+} LDKCResult_Bolt12RefundContextDecodeErrorZPtr;
+
+/**
+ * A CResult_Bolt12RefundContextDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::Bolt12RefundContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_Bolt12RefundContextDecodeErrorZ {
    /**
-    * The height at which the spending transaction was confirmed.
+    * The contents of this CResult_Bolt12RefundContextDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   uint32_t confirmation_height;
+   union LDKCResult_Bolt12RefundContextDecodeErrorZPtr contents;
    /**
-    * The hash of the block in which the spending transaction was confirmed.
+    * Whether this CResult_Bolt12RefundContextDecodeErrorZ represents a success state.
     */
-   struct LDKThirtyTwoBytes confirmation_hash;
-} LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body;
-
-typedef struct MUST_USE_STRUCT LDKOutputSpendStatus {
-   LDKOutputSpendStatus_Tag tag;
-   union {
-      LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body pending_initial_broadcast;
-      LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body pending_first_confirmation;
-      LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body pending_threshold_confirmations;
-   };
-} LDKOutputSpendStatus;
+   bool result_ok;
+} LDKCResult_Bolt12RefundContextDecodeErrorZ;
 
 /**
- * The contents of CResult_OutputSpendStatusDecodeErrorZ
+ * The contents of CResult_ResponderDecodeErrorZ
  */
-typedef union LDKCResult_OutputSpendStatusDecodeErrorZPtr {
+typedef union LDKCResult_ResponderDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKOutputSpendStatus *result;
+   struct LDKResponder *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_OutputSpendStatusDecodeErrorZPtr;
+} LDKCResult_ResponderDecodeErrorZPtr;
 
 /**
- * A CResult_OutputSpendStatusDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::util::sweep::OutputSpendStatus on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_ResponderDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::onion_message::messenger::Responder on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_OutputSpendStatusDecodeErrorZ {
+typedef struct LDKCResult_ResponderDecodeErrorZ {
    /**
-    * The contents of this CResult_OutputSpendStatusDecodeErrorZ, accessible via either
+    * The contents of this CResult_ResponderDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_OutputSpendStatusDecodeErrorZPtr contents;
+   union LDKCResult_ResponderDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_OutputSpendStatusDecodeErrorZ represents a success state.
+    * Whether this CResult_ResponderDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_OutputSpendStatusDecodeErrorZ;
+} LDKCResult_ResponderDecodeErrorZ;
 
+/**
+ * An enum which can either contain a crate::lightning::blinded_path::message::MessageContext or not
+ */
+typedef enum LDKCOption_MessageContextZ_Tag {
+   /**
+    * When we're in this state, this COption_MessageContextZ contains a crate::lightning::blinded_path::message::MessageContext
+    */
+   LDKCOption_MessageContextZ_Some,
+   /**
+    * When we're in this state, this COption_MessageContextZ contains nothing
+    */
+   LDKCOption_MessageContextZ_None,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKCOption_MessageContextZ_Sentinel,
+} LDKCOption_MessageContextZ_Tag;
 
+typedef struct LDKCOption_MessageContextZ {
+   LDKCOption_MessageContextZ_Tag tag;
+   union {
+      struct {
+         struct LDKMessageContext some;
+      };
+   };
+} LDKCOption_MessageContextZ;
 
 /**
- * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
- *
- * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
- * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
- * [`Confirm::transactions_confirmed`].
- *
- * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
- * may have been spent there. See [`Filter::register_output`] for details.
- *
- * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
- * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
+ * A tuple of 3 elements. See the individual fields for the types contained.
  */
-typedef struct MUST_USE_STRUCT LDKWatchedOutput {
+typedef struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ {
    /**
-    * 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.
+    * The element at position 0
     */
-   LDKnativeWatchedOutput *inner;
+   struct LDKPublicKey a;
    /**
-    * 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.
+    * The element at position 1
     */
-   bool is_owned;
-} LDKWatchedOutput;
+   struct LDKOnionMessage b;
+   /**
+    * The element at position 2
+    */
+   struct LDKCOption_CVec_SocketAddressZZ c;
+} LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ;
 
 /**
- * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
- * channels.
+ * Errors that may occur when [sending an onion message].
  *
- * This is useful in order to have a [`Watch`] implementation convey to a chain source which
- * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
- * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
- * receiving full blocks from a chain source, any further filtering is unnecessary.
- *
- * After an output has been registered, subsequent block retrievals from the chain source must not
- * exclude any transactions matching the new criteria nor any in-block descendants of such
- * transactions.
- *
- * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
- * should not block on I/O. Implementations should instead queue the newly monitored data to be
- * processed later. Then, in order to block until the data has been processed, any [`Watch`]
- * invocation that has called the `Filter` must return [`InProgress`].
- *
- * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
- * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
- * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
+ * [sending an onion message]: OnionMessenger::send_onion_message
  */
-typedef struct LDKFilter {
+typedef enum LDKSendError_Tag {
    /**
-    * 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.
+    * Errored computing onion message packet keys.
     */
-   void *this_arg;
+   LDKSendError_Secp256k1,
    /**
-    * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
-    * a spending condition.
+    * Because implementations such as Eclair will drop onion messages where the message packet
+    * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
     */
-   void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
+   LDKSendError_TooBigPacket,
    /**
-    * Registers interest in spends of a transaction output.
+    * The provided [`Destination`] was an invalid [`BlindedMessagePath`] due to not having any
+    * blinded hops.
+    */
+   LDKSendError_TooFewBlindedHops,
+   /**
+    * The first hop is not a peer and doesn't have a known [`SocketAddress`].
+    */
+   LDKSendError_InvalidFirstHop,
+   /**
+    * Indicates that a path could not be found by the [`MessageRouter`].
     *
-    * Note that this method might be called during processing of a new block. You therefore need
-    * to ensure that also dependent output spents within an already connected block are correctly
-    * handled, e.g., by re-scanning the block in question whenever new outputs have been
-    * registered mid-processing.
+    * This occurs when either:
+    * - No path from the sender to the destination was found to send the onion message
+    * - No reply path to the sender could be created when responding to an onion message
     */
-   void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
+   LDKSendError_PathNotFound,
    /**
-    * 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.
+    * Onion message contents must have a TLV type >= 64.
     */
-   void (*free)(void *this_arg);
-} LDKFilter;
-
-/**
- * An enum which can either contain a crate::lightning::chain::Filter or not
- */
-typedef enum LDKCOption_FilterZ_Tag {
+   LDKSendError_InvalidMessage,
    /**
-    * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
+    * Our next-hop peer's buffer was full or our total outbound buffer was full.
     */
-   LDKCOption_FilterZ_Some,
+   LDKSendError_BufferFull,
    /**
-    * When we're in this state, this COption_FilterZ contains nothing
+    * Failed to retrieve our node id from the provided [`NodeSigner`].
+    *
+    * [`NodeSigner`]: crate::sign::NodeSigner
     */
-   LDKCOption_FilterZ_None,
+   LDKSendError_GetNodeIdFailed,
+   /**
+    * The provided [`Destination`] has a blinded path with an unresolved introduction node. An
+    * attempt to resolve it in the [`MessageRouter`] when finding an [`OnionMessagePath`] likely
+    * failed.
+    */
+   LDKSendError_UnresolvedIntroductionNode,
+   /**
+    * We attempted to send to a blinded path where we are the introduction node, and failed to
+    * advance the blinded path to make the second hop the new introduction node. Either
+    * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
+    * new blinding point, or we were attempting to send to ourselves.
+    */
+   LDKSendError_BlindedPathAdvanceFailed,
    /**
     * Must be last for serialization purposes
     */
-   LDKCOption_FilterZ_Sentinel,
-} LDKCOption_FilterZ_Tag;
+   LDKSendError_Sentinel,
+} LDKSendError_Tag;
 
-typedef struct LDKCOption_FilterZ {
-   LDKCOption_FilterZ_Tag tag;
+typedef struct MUST_USE_STRUCT LDKSendError {
+   LDKSendError_Tag tag;
    union {
       struct {
-         struct LDKFilter some;
+         enum LDKSecp256k1Error secp256k1;
+      };
+      struct {
+         struct LDKPublicKey invalid_first_hop;
       };
    };
-} LDKCOption_FilterZ;
+} LDKSendError;
 
 /**
- * A dynamically-allocated array of crate::lightning::util::sweep::TrackedSpendableOutputs of arbitrary size.
- * This corresponds to std::vector in C++
+ * The contents of CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ
  */
-typedef struct LDKCVec_TrackedSpendableOutputZ {
+typedef union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr {
    /**
-    * 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 LDKTrackedSpendableOutput *data;
+   struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *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_TrackedSpendableOutputZ;
+   struct LDKSendError *err;
+} LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr;
 
 /**
- * A helper trait that describes an on-chain wallet capable of returning a (change) destination
- * script.
+ * A CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ on success and a crate::lightning::onion_message::messenger::SendError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKChangeDestinationSource {
-   /**
-    * An opaque pointer which is passed to your function implementations as an argument.
-    * This has no meaning in the LDK, and can be NULL or any other value.
-    */
-   void *this_arg;
+typedef struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ {
    /**
-    * Returns a script pubkey which can be used as a change destination for
-    * [`OutputSpender::spend_spendable_outputs`].
-    *
-    * This method should return a different value each time it is called, to avoid linking
-    * on-chain funds controlled to the same user.
+    * The contents of this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   struct LDKCResult_CVec_u8ZNoneZ (*get_change_destination_script)(const void *this_arg);
+   union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr contents;
    /**
-    * 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.
+    * Whether this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents a success state.
     */
-   void (*free)(void *this_arg);
-} LDKChangeDestinationSource;
+   bool result_ok;
+} LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ;
 
 /**
- * Provides an interface that allows storage and retrieval of persisted values that are associated
- * with given keys.
- *
- * In order to avoid collisions the key space is segmented based on the given `primary_namespace`s
- * and `secondary_namespace`s. Implementations of this trait are free to handle them in different
- * ways, as long as per-namespace key uniqueness is asserted.
- *
- * Keys and namespaces are required to be valid ASCII strings in the range of
- * [`KVSTORE_NAMESPACE_KEY_ALPHABET`] and no longer than [`KVSTORE_NAMESPACE_KEY_MAX_LEN`]. Empty
- * primary namespaces and secondary namespaces (`\"\"`) are assumed to be a valid, however, if
- * `primary_namespace` is empty, `secondary_namespace` is required to be empty, too. This means
- * that concerns should always be separated by primary namespace first, before secondary
- * namespaces are used. While the number of primary namespaces will be relatively small and is
- * determined at compile time, there may be many secondary namespaces per primary namespace. Note
- * that per-namespace uniqueness needs to also hold for keys *and* namespaces in any given
- * namespace, i.e., conflicts between keys and equally named
- * primary namespaces/secondary namespaces must be avoided.
+ * The next hop to forward an onion message along its path.
  *
- * **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
- * interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
- * recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
+ * Note that payment blinded paths always specify their next hop using an explicit node id.
  */
-typedef struct LDKKVStore {
+typedef enum LDKNextMessageHop_Tag {
    /**
-    * 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.
+    * The node id of the next hop.
     */
-   void *this_arg;
+   LDKNextMessageHop_NodeId,
    /**
-    * Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
-    * `key`.
-    *
-    * Returns an [`ErrorKind::NotFound`] if the given `key` could not be found in the given
-    * `primary_namespace` and `secondary_namespace`.
-    *
-    * [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
+    * The short channel id leading to the next hop.
     */
-   struct LDKCResult_CVec_u8ZIOErrorZ (*read)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key);
+   LDKNextMessageHop_ShortChannelId,
    /**
-    * Persists the given data under the given `key`.
-    *
-    * Will create the given `primary_namespace` and `secondary_namespace` if not already present
-    * in the store.
+    * Must be last for serialization purposes
     */
-   struct LDKCResult_NoneIOErrorZ (*write)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, struct LDKu8slice buf);
+   LDKNextMessageHop_Sentinel,
+} LDKNextMessageHop_Tag;
+
+typedef struct MUST_USE_STRUCT LDKNextMessageHop {
+   LDKNextMessageHop_Tag tag;
+   union {
+      struct {
+         struct LDKPublicKey node_id;
+      };
+      struct {
+         uint64_t short_channel_id;
+      };
+   };
+} LDKNextMessageHop;
+
+/**
+ * The contents of an [`OnionMessage`] as read from the wire.
+ *
+ * [`OnionMessage`]: crate::ln::msgs::OnionMessage
+ */
+typedef enum LDKParsedOnionMessageContents_Tag {
    /**
-    * Removes any data that had previously been persisted under the given `key`.
-    *
-    * If the `lazy` flag is set to `true`, the backend implementation might choose to lazily
-    * remove the given `key` at some point in time after the method returns, e.g., as part of an
-    * eventual batch deletion of multiple keys. As a consequence, subsequent calls to
-    * [`KVStore::list`] might include the removed key until the changes are actually persisted.
-    *
-    * Note that while setting the `lazy` flag reduces the I/O burden of multiple subsequent
-    * `remove` calls, it also influences the atomicity guarantees as lazy `remove`s could
-    * potentially get lost on crash after the method returns. Therefore, this flag should only be
-    * set for `remove` operations that can be safely replayed at a later time.
-    *
-    * Returns successfully if no data will be stored for the given `primary_namespace`,
-    * `secondary_namespace`, and `key`, independently of whether it was present before its
-    * invokation or not.
+    * A message related to BOLT 12 Offers.
     */
-   struct LDKCResult_NoneIOErrorZ (*remove)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, bool lazy);
+   LDKParsedOnionMessageContents_Offers,
    /**
-    * Returns a list of keys that are stored under the given `secondary_namespace` in
-    * `primary_namespace`.
-    *
-    * Returns the keys in arbitrary order, so users requiring a particular order need to sort the
-    * returned keys. Returns an empty list if `primary_namespace` or `secondary_namespace` is unknown.
+    * A custom onion message specified by the user.
     */
-   struct LDKCResult_CVec_StrZIOErrorZ (*list)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace);
+   LDKParsedOnionMessageContents_Custom,
    /**
-    * 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.
+    * Must be last for serialization purposes
     */
-   void (*free)(void *this_arg);
-} LDKKVStore;
+   LDKParsedOnionMessageContents_Sentinel,
+} LDKParsedOnionMessageContents_Tag;
+
+typedef struct MUST_USE_STRUCT LDKParsedOnionMessageContents {
+   LDKParsedOnionMessageContents_Tag tag;
+   union {
+      struct {
+         struct LDKOffersMessage offers;
+      };
+      struct {
+         struct LDKOnionMessageContents custom;
+      };
+   };
+} LDKParsedOnionMessageContents;
 
 /**
- * A trait that describes a wallet capable of creating a spending [`Transaction`] from a set of
- * [`SpendableOutputDescriptor`]s.
+ * A processed incoming onion message, containing either a Forward (another onion message)
+ * or a Receive payload with decrypted contents.
  */
-typedef struct LDKOutputSpender {
+typedef enum LDKPeeledOnion_Tag {
    /**
-    * 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.
+    * Forwarded onion, with the next node id and a new onion
     */
-   void *this_arg;
+   LDKPeeledOnion_Forward,
    /**
-    * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
-    * output to the given change destination (if sufficient change value remains). The
-    * transaction will have a feerate, at least, of the given value.
-    *
-    * The `locktime` argument is used to set the transaction's locktime. If `None`, the
-    * transaction will have a locktime of 0. It it recommended to set this to the current block
-    * height to avoid fee sniping, unless you have some specific reason to use a different
-    * locktime.
-    *
-    * Returns `Err(())` if the output value is greater than the input value minus required fee,
-    * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
-    * does not match the one we can spend.
+    * Received onion message, with decrypted contents, context, and reply path
     */
-   struct LDKCResult_TransactionNoneZ (*spend_spendable_outputs)(const void *this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
+   LDKPeeledOnion_Receive,
    /**
-    * 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.
+    * Must be last for serialization purposes
     */
-   void (*free)(void *this_arg);
-} LDKOutputSpender;
-
+   LDKPeeledOnion_Sentinel,
+} LDKPeeledOnion_Tag;
 
+typedef struct LDKPeeledOnion_LDKForward_Body {
+   struct LDKNextMessageHop _0;
+   struct LDKOnionMessage _1;
+} LDKPeeledOnion_LDKForward_Body;
 
-/**
- * A utility that keeps track of [`SpendableOutputDescriptor`]s, persists them in a given
- * [`KVStore`] and regularly retries sweeping them based on a callback given to the constructor
- * methods.
- *
- * Users should call [`Self::track_spendable_outputs`] for any [`SpendableOutputDescriptor`]s received via [`Event::SpendableOutputs`].
- *
- * This needs to be notified of chain state changes either via its [`Listen`] or [`Confirm`]
- * implementation and hence has to be connected with the utilized chain data sources.
- *
- * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users are
- * required to give their chain data sources (i.e., [`Filter`] implementation) to the respective
- * constructor.
- *
- * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
- */
-typedef struct MUST_USE_STRUCT LDKOutputSweeper {
-   /**
-    * A pointer to the opaque Rust object.
-    * Nearly everywhere, inner must be non-null, however in places where
-    * the Rust equivalent takes an Option, it may be set to null to indicate None.
-    */
-   LDKnativeOutputSweeper *inner;
+typedef struct LDKPeeledOnion_LDKReceive_Body {
+   struct LDKParsedOnionMessageContents _0;
+   struct LDKCOption_MessageContextZ _1;
    /**
-    * 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.
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   bool is_owned;
-} LDKOutputSweeper;
+   struct LDKBlindedMessagePath _2;
+} LDKPeeledOnion_LDKReceive_Body;
+
+typedef struct MUST_USE_STRUCT LDKPeeledOnion {
+   LDKPeeledOnion_Tag tag;
+   union {
+      LDKPeeledOnion_LDKForward_Body forward;
+      LDKPeeledOnion_LDKReceive_Body receive;
+   };
+} LDKPeeledOnion;
 
 /**
- * The contents of CResult_OutputSweeperDecodeErrorZ
+ * The contents of CResult_PeeledOnionNoneZ
  */
-typedef union LDKCResult_OutputSweeperDecodeErrorZPtr {
+typedef union LDKCResult_PeeledOnionNoneZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKOutputSweeper *result;
+   struct LDKPeeledOnion *result;
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * Note that this value is always NULL, as there are no contents in the Err variant
     */
-   struct LDKDecodeError *err;
-} LDKCResult_OutputSweeperDecodeErrorZPtr;
+   void *err;
+} LDKCResult_PeeledOnionNoneZPtr;
 
 /**
- * A CResult_OutputSweeperDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::util::sweep::OutputSweeper on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_PeeledOnionNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning::onion_message::messenger::PeeledOnion on success and a () on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_OutputSweeperDecodeErrorZ {
+typedef struct LDKCResult_PeeledOnionNoneZ {
    /**
-    * The contents of this CResult_OutputSweeperDecodeErrorZ, accessible via either
+    * The contents of this CResult_PeeledOnionNoneZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_OutputSweeperDecodeErrorZPtr contents;
+   union LDKCResult_PeeledOnionNoneZPtr contents;
    /**
-    * Whether this CResult_OutputSweeperDecodeErrorZ represents a success state.
+    * Whether this CResult_PeeledOnionNoneZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_OutputSweeperDecodeErrorZ;
+} LDKCResult_PeeledOnionNoneZ;
 
 /**
- * A tuple of 2 elements. See the individual fields for the types contained.
+ * Result of successfully [sending an onion message].
+ *
+ * [sending an onion message]: OnionMessenger::send_onion_message
  */
-typedef struct LDKC2Tuple_BestBlockOutputSweeperZ {
+typedef enum LDKSendSuccess_Tag {
    /**
-    * The element at position 0
+    * The message was buffered and will be sent once it is processed by
+    * [`OnionMessageHandler::next_onion_message_for_peer`].
     */
-   struct LDKBestBlock a;
+   LDKSendSuccess_Buffered,
    /**
-    * The element at position 1
+    * The message was buffered and will be sent once the node is connected as a peer and it is
+    * processed by [`OnionMessageHandler::next_onion_message_for_peer`].
     */
-   struct LDKOutputSweeper b;
-} LDKC2Tuple_BestBlockOutputSweeperZ;
+   LDKSendSuccess_BufferedAwaitingConnection,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKSendSuccess_Sentinel,
+} LDKSendSuccess_Tag;
+
+typedef struct MUST_USE_STRUCT LDKSendSuccess {
+   LDKSendSuccess_Tag tag;
+   union {
+      struct {
+         struct LDKPublicKey buffered_awaiting_connection;
+      };
+   };
+} LDKSendSuccess;
 
 /**
- * The contents of CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ
+ * The contents of CResult_SendSuccessSendErrorZ
  */
-typedef union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr {
+typedef union LDKCResult_SendSuccessSendErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKC2Tuple_BestBlockOutputSweeperZ *result;
+   struct LDKSendSuccess *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKDecodeError *err;
-} LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr;
+   struct LDKSendError *err;
+} LDKCResult_SendSuccessSendErrorZPtr;
 
 /**
- * A CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::c_types::derived::C2Tuple_BestBlockOutputSweeperZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_SendSuccessSendErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::onion_message::messenger::SendSuccess on success and a crate::lightning::onion_message::messenger::SendError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ {
+typedef struct LDKCResult_SendSuccessSendErrorZ {
    /**
-    * The contents of this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ, accessible via either
+    * The contents of this CResult_SendSuccessSendErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr contents;
+   union LDKCResult_SendSuccessSendErrorZPtr contents;
    /**
-    * Whether this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents a success state.
+    * Whether this CResult_SendSuccessSendErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ;
-
-
-
-/**
- * Base key used in conjunction with a `per_commitment_point` to generate a [`DelayedPaymentKey`].
- *
- * The delayed payment key is used to pay the commitment state broadcaster their
- * non-HTLC-encumbered funds after a delay to give their counterparty a chance to punish if the
- * state broadcasted was previously revoked.
- */
-typedef struct MUST_USE_STRUCT LDKDelayedPaymentBasepoint {
-   /**
-    * A pointer to the opaque Rust object.
-    * Nearly everywhere, inner must be non-null, however in places where
-    * the Rust equivalent takes an Option, it may be set to null to indicate None.
-    */
-   LDKnativeDelayedPaymentBasepoint *inner;
-   /**
-    * Indicates that this is the only struct which contains the same pointer.
-    * Rust functions which take ownership of an object provided via an argument require
-    * this to be true and invalidate the object pointed to by inner.
-    */
-   bool is_owned;
-} LDKDelayedPaymentBasepoint;
+} LDKCResult_SendSuccessSendErrorZ;
 
 /**
- * The contents of CResult_DelayedPaymentBasepointDecodeErrorZ
+ * The contents of CResult_NoneSendErrorZ
  */
-typedef union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr {
+typedef union LDKCResult_NoneSendErrorZPtr {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * Note that this value is always NULL, as there are no contents in the OK variant
     */
-   struct LDKDelayedPaymentBasepoint *result;
+   void *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
-   struct LDKDecodeError *err;
-} LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr;
+   struct LDKSendError *err;
+} LDKCResult_NoneSendErrorZPtr;
 
 /**
- * A CResult_DelayedPaymentBasepointDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::channel_keys::DelayedPaymentBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_NoneSendErrorZ represents the result of a fallible operation,
+ * containing a () on success and a crate::lightning::onion_message::messenger::SendError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ {
+typedef struct LDKCResult_NoneSendErrorZ {
    /**
-    * The contents of this CResult_DelayedPaymentBasepointDecodeErrorZ, accessible via either
+    * The contents of this CResult_NoneSendErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr contents;
+   union LDKCResult_NoneSendErrorZPtr contents;
    /**
-    * Whether this CResult_DelayedPaymentBasepointDecodeErrorZ represents a success state.
+    * Whether this CResult_NoneSendErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_DelayedPaymentBasepointDecodeErrorZ;
-
-
-
-/**
- * A derived key built from a [`DelayedPaymentBasepoint`] and `per_commitment_point`.
- *
- * The delayed payment key is used to pay the commitment state broadcaster their
- * non-HTLC-encumbered funds after a delay. This delay gives their counterparty a chance to
- * punish and claim all the channel funds if the state broadcasted was previously revoked.
- *
- * [See the BOLT specs]
- * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
- * for more information on key derivation details.
- */
-typedef struct MUST_USE_STRUCT LDKDelayedPaymentKey {
-   /**
-    * A pointer to the opaque Rust object.
-    * Nearly everywhere, inner must be non-null, however in places where
-    * the Rust equivalent takes an Option, it may be set to null to indicate None.
-    */
-   LDKnativeDelayedPaymentKey *inner;
-   /**
-    * Indicates that this is the only struct which contains the same pointer.
-    * Rust functions which take ownership of an object provided via an argument require
-    * this to be true and invalidate the object pointed to by inner.
-    */
-   bool is_owned;
-} LDKDelayedPaymentKey;
+} LDKCResult_NoneSendErrorZ;
 
 /**
- * The contents of CResult_DelayedPaymentKeyDecodeErrorZ
+ * The contents of CResult_BlindedHopDecodeErrorZ
  */
-typedef union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr {
+typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKDelayedPaymentKey *result;
+   struct LDKBlindedHop *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_DelayedPaymentKeyDecodeErrorZPtr;
+} LDKCResult_BlindedHopDecodeErrorZPtr;
 
 /**
- * A CResult_DelayedPaymentKeyDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::channel_keys::DelayedPaymentKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_DelayedPaymentKeyDecodeErrorZ {
+typedef struct LDKCResult_BlindedHopDecodeErrorZ {
    /**
-    * The contents of this CResult_DelayedPaymentKeyDecodeErrorZ, accessible via either
+    * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr contents;
+   union LDKCResult_BlindedHopDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_DelayedPaymentKeyDecodeErrorZ represents a success state.
+    * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_DelayedPaymentKeyDecodeErrorZ;
-
-
+} LDKCResult_BlindedHopDecodeErrorZ;
 
 /**
- * Base key used in conjunction with a `per_commitment_point` to generate an [`HtlcKey`].
- *
- * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
- * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
- * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
+ * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
+ * This corresponds to std::vector in C++
  */
-typedef struct MUST_USE_STRUCT LDKHtlcBasepoint {
+typedef struct LDKCVec_PhantomRouteHintsZ {
    /**
-    * A pointer to the opaque Rust object.
-    * Nearly everywhere, inner must be non-null, however in places where
-    * the Rust equivalent takes an Option, it may be set to null to indicate None.
-    */
-   LDKnativeHtlcBasepoint *inner;
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+    */
+   struct LDKPhantomRouteHints *data;
    /**
-    * 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.
+    * The number of elements pointed to by `data`.
     */
-   bool is_owned;
-} LDKHtlcBasepoint;
+   uintptr_t datalen;
+} LDKCVec_PhantomRouteHintsZ;
 
 /**
- * The contents of CResult_HtlcBasepointDecodeErrorZ
+ * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
+ * may occur.
  */
-typedef union LDKCResult_HtlcBasepointDecodeErrorZPtr {
+typedef enum LDKSignOrCreationError_Tag {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * An error occurred during signing
     */
-   struct LDKHtlcBasepoint *result;
+   LDKSignOrCreationError_SignError,
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * An error occurred while building the transaction
     */
-   struct LDKDecodeError *err;
-} LDKCResult_HtlcBasepointDecodeErrorZPtr;
+   LDKSignOrCreationError_CreationError,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKSignOrCreationError_Sentinel,
+} LDKSignOrCreationError_Tag;
+
+typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
+   LDKSignOrCreationError_Tag tag;
+   union {
+      struct {
+         enum LDKCreationError creation_error;
+      };
+   };
+} LDKSignOrCreationError;
 
 /**
- * A CResult_HtlcBasepointDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::channel_keys::HtlcBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ * The contents of CResult_Bolt11InvoiceSignOrCreationErrorZ
  */
-typedef struct LDKCResult_HtlcBasepointDecodeErrorZ {
+typedef union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr {
    /**
-    * The contents of this CResult_HtlcBasepointDecodeErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   union LDKCResult_HtlcBasepointDecodeErrorZPtr contents;
+   struct LDKBolt11Invoice *result;
    /**
-    * Whether this CResult_HtlcBasepointDecodeErrorZ represents a success state.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   bool result_ok;
-} LDKCResult_HtlcBasepointDecodeErrorZ;
-
-
+   struct LDKSignOrCreationError *err;
+} LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr;
 
 /**
- * A derived key built from a [`HtlcBasepoint`] and `per_commitment_point`.
- *
- * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
- * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
- * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
- *
- * [See the BOLT specs]
- * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
- * for more information on key derivation details.
+ * A CResult_Bolt11InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct MUST_USE_STRUCT LDKHtlcKey {
+typedef struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ {
    /**
-    * 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.
+    * The contents of this CResult_Bolt11InvoiceSignOrCreationErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   LDKnativeHtlcKey *inner;
+   union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr contents;
    /**
-    * 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.
+    * Whether this CResult_Bolt11InvoiceSignOrCreationErrorZ represents a success state.
     */
-   bool is_owned;
-} LDKHtlcKey;
+   bool result_ok;
+} LDKCResult_Bolt11InvoiceSignOrCreationErrorZ;
 
 /**
- * The contents of CResult_HtlcKeyDecodeErrorZ
+ * The contents of CResult_InvoiceErrorDecodeErrorZ
  */
-typedef union LDKCResult_HtlcKeyDecodeErrorZPtr {
+typedef union LDKCResult_InvoiceErrorDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKHtlcKey *result;
+   struct LDKInvoiceError *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_HtlcKeyDecodeErrorZPtr;
+} LDKCResult_InvoiceErrorDecodeErrorZPtr;
 
 /**
- * A CResult_HtlcKeyDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::channel_keys::HtlcKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_InvoiceErrorDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::offers::invoice_error::InvoiceError on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_HtlcKeyDecodeErrorZ {
+typedef struct LDKCResult_InvoiceErrorDecodeErrorZ {
    /**
-    * The contents of this CResult_HtlcKeyDecodeErrorZ, accessible via either
+    * The contents of this CResult_InvoiceErrorDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_HtlcKeyDecodeErrorZPtr contents;
+   union LDKCResult_InvoiceErrorDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_HtlcKeyDecodeErrorZ represents a success state.
+    * Whether this CResult_InvoiceErrorDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_HtlcKeyDecodeErrorZ;
+} LDKCResult_InvoiceErrorDecodeErrorZ;
 
 
 
 /**
- * Master key used in conjunction with per_commitment_point to generate [htlcpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#key-derivation) for the latest state of a channel.
- * A watcher can be given a [RevocationBasepoint] to generate per commitment [RevocationKey] to create justice transactions.
+ * The state of a spendable output currently tracked by an [`OutputSweeper`].
  */
-typedef struct MUST_USE_STRUCT LDKRevocationBasepoint {
+typedef struct MUST_USE_STRUCT LDKTrackedSpendableOutput {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeRevocationBasepoint *inner;
+   LDKnativeTrackedSpendableOutput *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKRevocationBasepoint;
+} LDKTrackedSpendableOutput;
 
 /**
- * The contents of CResult_RevocationBasepointDecodeErrorZ
+ * The contents of CResult_TrackedSpendableOutputDecodeErrorZ
  */
-typedef union LDKCResult_RevocationBasepointDecodeErrorZPtr {
+typedef union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKRevocationBasepoint *result;
+   struct LDKTrackedSpendableOutput *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_RevocationBasepointDecodeErrorZPtr;
+} LDKCResult_TrackedSpendableOutputDecodeErrorZPtr;
 
 /**
- * A CResult_RevocationBasepointDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::channel_keys::RevocationBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_TrackedSpendableOutputDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::util::sweep::TrackedSpendableOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_RevocationBasepointDecodeErrorZ {
+typedef struct LDKCResult_TrackedSpendableOutputDecodeErrorZ {
    /**
-    * The contents of this CResult_RevocationBasepointDecodeErrorZ, accessible via either
+    * The contents of this CResult_TrackedSpendableOutputDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_RevocationBasepointDecodeErrorZPtr contents;
+   union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_RevocationBasepointDecodeErrorZ represents a success state.
+    * Whether this CResult_TrackedSpendableOutputDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_RevocationBasepointDecodeErrorZ;
-
-
+} LDKCResult_TrackedSpendableOutputDecodeErrorZ;
 
 /**
- * The revocation key is used to allow a channel party to revoke their state - giving their
- * counterparty the required material to claim all of their funds if they broadcast that state.
- *
- * Each commitment transaction has a revocation key based on the basepoint and
- * per_commitment_point which is used in both commitment and HTLC transactions.
- *
- * See [the BOLT spec for derivation details]
- * (https://github.com/lightning/bolts/blob/master/03-transactions.md#revocationpubkey-derivation)
+ * The current status of the output spend.
  */
-typedef struct MUST_USE_STRUCT LDKRevocationKey {
+typedef enum LDKOutputSpendStatus_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.
+    * The output is tracked but an initial spending transaction hasn't been generated and
+    * broadcasted yet.
     */
-   LDKnativeRevocationKey *inner;
+   LDKOutputSpendStatus_PendingInitialBroadcast,
    /**
-    * 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 transaction spending the output has been broadcasted but is pending its first confirmation on-chain.
     */
-   bool is_owned;
-} LDKRevocationKey;
+   LDKOutputSpendStatus_PendingFirstConfirmation,
+   /**
+    * A transaction spending the output has been confirmed on-chain but will be tracked until it
+    * reaches [`ANTI_REORG_DELAY`] confirmations.
+    */
+   LDKOutputSpendStatus_PendingThresholdConfirmations,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKOutputSpendStatus_Sentinel,
+} LDKOutputSpendStatus_Tag;
+
+typedef struct LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body {
+   /**
+    * The height at which we will first generate and broadcast a spending transaction.
+    */
+   struct LDKCOption_u32Z delayed_until_height;
+} LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body;
+
+typedef struct LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body {
+   /**
+    * The hash of the chain tip when we first broadcast a transaction spending this output.
+    */
+   struct LDKThirtyTwoBytes first_broadcast_hash;
+   /**
+    * The best height when we last broadcast a transaction spending this output.
+    */
+   uint32_t latest_broadcast_height;
+   /**
+    * The transaction spending this output we last broadcasted.
+    */
+   struct LDKTransaction latest_spending_tx;
+} LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body;
+
+typedef struct LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body {
+   /**
+    * The hash of the chain tip when we first broadcast a transaction spending this output.
+    */
+   struct LDKThirtyTwoBytes first_broadcast_hash;
+   /**
+    * The best height when we last broadcast a transaction spending this output.
+    */
+   uint32_t latest_broadcast_height;
+   /**
+    * The transaction spending this output we saw confirmed on-chain.
+    */
+   struct LDKTransaction latest_spending_tx;
+   /**
+    * The height at which the spending transaction was confirmed.
+    */
+   uint32_t confirmation_height;
+   /**
+    * The hash of the block in which the spending transaction was confirmed.
+    */
+   struct LDKThirtyTwoBytes confirmation_hash;
+} LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body;
+
+typedef struct MUST_USE_STRUCT LDKOutputSpendStatus {
+   LDKOutputSpendStatus_Tag tag;
+   union {
+      LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body pending_initial_broadcast;
+      LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body pending_first_confirmation;
+      LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body pending_threshold_confirmations;
+   };
+} LDKOutputSpendStatus;
 
 /**
- * The contents of CResult_RevocationKeyDecodeErrorZ
+ * The contents of CResult_OutputSpendStatusDecodeErrorZ
  */
-typedef union LDKCResult_RevocationKeyDecodeErrorZPtr {
+typedef union LDKCResult_OutputSpendStatusDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKRevocationKey *result;
+   struct LDKOutputSpendStatus *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_RevocationKeyDecodeErrorZPtr;
+} LDKCResult_OutputSpendStatusDecodeErrorZPtr;
 
 /**
- * A CResult_RevocationKeyDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::channel_keys::RevocationKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_OutputSpendStatusDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::util::sweep::OutputSpendStatus on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_RevocationKeyDecodeErrorZ {
+typedef struct LDKCResult_OutputSpendStatusDecodeErrorZ {
    /**
-    * The contents of this CResult_RevocationKeyDecodeErrorZ, accessible via either
+    * The contents of this CResult_OutputSpendStatusDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_RevocationKeyDecodeErrorZPtr contents;
+   union LDKCResult_OutputSpendStatusDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_RevocationKeyDecodeErrorZ represents a success state.
+    * Whether this CResult_OutputSpendStatusDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_RevocationKeyDecodeErrorZ;
+} LDKCResult_OutputSpendStatusDecodeErrorZ;
 
 
 
 /**
- * A read-only reference to a current ChannelMonitor.
+ * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
  *
- * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
- * released.
+ * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
+ * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
+ * [`Confirm::transactions_confirmed`].
+ *
+ * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
+ * may have been spent there. See [`Filter::register_output`] for details.
+ *
+ * Depending on your block source, you may need one or both of either [`Self::outpoint`] or
+ * [`Self::script_pubkey`].
+ *
+ * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
+ * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
  */
-typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
+typedef struct MUST_USE_STRUCT LDKWatchedOutput {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeLockedChannelMonitor *inner;
+   LDKnativeWatchedOutput *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKLockedChannelMonitor;
+} LDKWatchedOutput;
 
 /**
- * The contents of CResult_LockedChannelMonitorNoneZ
+ * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
+ * channels.
+ *
+ * This is useful in order to have a [`Watch`] implementation convey to a chain source which
+ * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
+ * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
+ * receiving full blocks from a chain source, any further filtering is unnecessary.
+ *
+ * After an output has been registered, subsequent block retrievals from the chain source must not
+ * exclude any transactions matching the new criteria nor any in-block descendants of such
+ * transactions.
+ *
+ * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
+ * should not block on I/O. Implementations should instead queue the newly monitored data to be
+ * processed later. Then, in order to block until the data has been processed, any [`Watch`]
+ * invocation that has called the `Filter` must return [`InProgress`].
+ *
+ * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
+ * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
+ * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
  */
-typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
+typedef struct LDKFilter {
    /**
-    * 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.
     */
-   struct LDKLockedChannelMonitor *result;
+   void *this_arg;
    /**
-    * Note that this value is always NULL, as there are no contents in the Err variant
+    * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
+    * a spending condition.
+    *
+    * This may be used, for example, to monitor for when a funding transaction confirms.
+    *
+    * The `script_pubkey` is provided for informational purposes and may be useful for block
+    * sources which only support filtering on scripts.
     */
-   void *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 {
+   void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
    /**
-    * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * Registers interest in spends of a transaction output.
+    *
+    * Note that this method might be called during processing of a new block. You therefore need
+    * to ensure that also dependent output spents within an already connected block are correctly
+    * handled, e.g., by re-scanning the block in question whenever new outputs have been
+    * registered mid-processing.
+    *
+    * This may be used, for example, to monitor for when a funding output is spent (by any
+    * transaction).
     */
-   union LDKCResult_LockedChannelMonitorNoneZPtr contents;
+   void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
    /**
-    * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
+    * 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.
     */
-   bool result_ok;
-} LDKCResult_LockedChannelMonitorNoneZ;
+   void (*free)(void *this_arg);
+} LDKFilter;
 
 /**
- * A tuple of 2 elements. See the individual fields for the types contained.
+ * An enum which can either contain a crate::lightning::chain::Filter or not
  */
-typedef struct LDKC2Tuple_OutPointChannelIdZ {
-   /**
-    * The element at position 0
-    */
-   struct LDKOutPoint a;
+typedef enum LDKCOption_FilterZ_Tag {
    /**
-    * The element at position 1
+    * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
     */
-   struct LDKChannelId b;
-} LDKC2Tuple_OutPointChannelIdZ;
-
-/**
- * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointChannelIdZs of arbitrary size.
- * This corresponds to std::vector in C++
- */
-typedef struct LDKCVec_C2Tuple_OutPointChannelIdZZ {
+   LDKCOption_FilterZ_Some,
    /**
-    * The elements in the array.
-    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+    * When we're in this state, this COption_FilterZ contains nothing
     */
-   struct LDKC2Tuple_OutPointChannelIdZ *data;
+   LDKCOption_FilterZ_None,
    /**
-    * The number of elements pointed to by `data`.
+    * Must be last for serialization purposes
     */
-   uintptr_t datalen;
-} LDKCVec_C2Tuple_OutPointChannelIdZZ;
-
-
+   LDKCOption_FilterZ_Sentinel,
+} LDKCOption_FilterZ_Tag;
 
-/**
- * An opaque identifier describing a specific [`Persist`] method call.
- */
-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.
-    */
-   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;
-} LDKMonitorUpdateId;
+typedef struct LDKCOption_FilterZ {
+   LDKCOption_FilterZ_Tag tag;
+   union {
+      struct {
+         struct LDKFilter some;
+      };
+   };
+} LDKCOption_FilterZ;
 
 /**
- * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
+ * A dynamically-allocated array of crate::lightning::util::sweep::TrackedSpendableOutputs of arbitrary size.
  * This corresponds to std::vector in C++
  */
-typedef struct LDKCVec_MonitorUpdateIdZ {
+typedef struct LDKCVec_TrackedSpendableOutputZ {
    /**
     * The elements in the array.
     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
     */
-   struct LDKMonitorUpdateId *data;
+   struct LDKTrackedSpendableOutput *data;
    /**
     * The number of elements pointed to by `data`.
     */
    uintptr_t datalen;
-} LDKCVec_MonitorUpdateIdZ;
+} LDKCVec_TrackedSpendableOutputZ;
 
 /**
- * A tuple of 2 elements. See the individual fields for the types contained.
+ * A helper trait that describes an on-chain wallet capable of returning a (change) destination
+ * script.
  */
-typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
-   /**
-    * The element at position 0
-    */
-   struct LDKOutPoint a;
+typedef struct LDKChangeDestinationSource {
    /**
-    * The element at position 1
+    * 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.
     */
-   struct LDKCVec_MonitorUpdateIdZ b;
-} LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
-
-/**
- * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
- * This corresponds to std::vector in C++
- */
-typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
+   void *this_arg;
    /**
-    * The elements in the array.
-    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+    * Returns a script pubkey which can be used as a change destination for
+    * [`OutputSpender::spend_spendable_outputs`].
+    *
+    * This method should return a different value each time it is called, to avoid linking
+    * on-chain funds controlled to the same user.
     */
-   struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
+   struct LDKCResult_CVec_u8ZNoneZ (*get_change_destination_script)(const void *this_arg);
    /**
-    * The number of elements pointed to by `data`.
+    * 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.
     */
-   uintptr_t datalen;
-} LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
+   void (*free)(void *this_arg);
+} LDKChangeDestinationSource;
 
 /**
- * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
+ * Provides an interface that allows storage and retrieval of persisted values that are associated
+ * with given keys.
  *
- * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * In order to avoid collisions the key space is segmented based on the given `primary_namespace`s
+ * and `secondary_namespace`s. Implementations of this trait are free to handle them in different
+ * ways, as long as per-namespace key uniqueness is asserted.
+ *
+ * Keys and namespaces are required to be valid ASCII strings in the range of
+ * [`KVSTORE_NAMESPACE_KEY_ALPHABET`] and no longer than [`KVSTORE_NAMESPACE_KEY_MAX_LEN`]. Empty
+ * primary namespaces and secondary namespaces (`\"\"`) are assumed to be a valid, however, if
+ * `primary_namespace` is empty, `secondary_namespace` is required to be empty, too. This means
+ * that concerns should always be separated by primary namespace first, before secondary
+ * namespaces are used. While the number of primary namespaces will be relatively small and is
+ * determined at compile time, there may be many secondary namespaces per primary namespace. Note
+ * that per-namespace uniqueness needs to also hold for keys *and* namespaces in any given
+ * namespace, i.e., conflicts between keys and equally named
+ * primary namespaces/secondary namespaces must be avoided.
+ *
+ * **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
+ * interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
+ * recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
  */
-typedef struct LDKPersister {
+typedef struct LDKKVStore {
    /**
     * An opaque pointer which is passed to your function implementations as an argument.
     * This has no meaning in the LDK, and can be NULL or any other value.
     */
    void *this_arg;
    /**
-    * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
+    * Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
+    * `key`.
     *
-    * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+    * Returns an [`ErrorKind::NotFound`] if the given `key` could not be found in the given
+    * `primary_namespace` and `secondary_namespace`.
+    *
+    * [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
     */
-   struct LDKCResult_NoneIOErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
+   struct LDKCResult_CVec_u8ZIOErrorZ (*read)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key);
    /**
-    * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
+    * Persists the given data under the given `key`.
+    *
+    * Will create the given `primary_namespace` and `secondary_namespace` if not already present
+    * in the store.
     */
-   struct LDKCResult_NoneIOErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
+   struct LDKCResult_NoneIOErrorZ (*write)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, struct LDKu8slice buf);
    /**
-    * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
+    * Removes any data that had previously been persisted under the given `key`.
+    *
+    * If the `lazy` flag is set to `true`, the backend implementation might choose to lazily
+    * remove the given `key` at some point in time after the method returns, e.g., as part of an
+    * eventual batch deletion of multiple keys. As a consequence, subsequent calls to
+    * [`KVStore::list`] might include the removed key until the changes are actually persisted.
+    *
+    * Note that while setting the `lazy` flag reduces the I/O burden of multiple subsequent
+    * `remove` calls, it also influences the atomicity guarantees as lazy `remove`s could
+    * potentially get lost on crash after the method returns. Therefore, this flag should only be
+    * set for `remove` operations that can be safely replayed at a later time.
+    *
+    * Returns successfully if no data will be stored for the given `primary_namespace`,
+    * `secondary_namespace`, and `key`, independently of whether it was present before its
+    * invokation or not.
     */
-   struct LDKCResult_NoneIOErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
+   struct LDKCResult_NoneIOErrorZ (*remove)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, bool lazy);
+   /**
+    * Returns a list of keys that are stored under the given `secondary_namespace` in
+    * `primary_namespace`.
+    *
+    * Returns the keys in arbitrary order, so users requiring a particular order need to sort the
+    * returned keys. Returns an empty list if `primary_namespace` or `secondary_namespace` is unknown.
+    */
+   struct LDKCResult_CVec_StrZIOErrorZ (*list)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace);
    /**
     * Frees any resources associated with this object given its this_arg pointer.
     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
     */
    void (*free)(void *this_arg);
-} LDKPersister;
-
-
+} LDKKVStore;
 
 /**
- * Implements [`Persist`] in a way that writes and reads both [`ChannelMonitor`]s and
- * [`ChannelMonitorUpdate`]s.
- *
- * # Overview
- *
- * The main benefit this provides over the [`KVStore`]'s [`Persist`] implementation is decreased
- * I/O bandwidth and storage churn, at the expense of more IOPS (including listing, reading, and
- * deleting) and complexity. This is because it writes channel monitor differential updates,
- * whereas the other (default) implementation rewrites the entire monitor on each update. For
- * routing nodes, updates can happen many times per second to a channel, and monitors can be tens
- * of megabytes (or more). Updates can be as small as a few hundred bytes.
- *
- * Note that monitors written with `MonitorUpdatingPersister` are _not_ backward-compatible with
- * the default [`KVStore`]'s [`Persist`] implementation. They have a prepended byte sequence,
- * [`MONITOR_UPDATING_PERSISTER_PREPEND_SENTINEL`], applied to prevent deserialization with other
- * persisters. This is because monitors written by this struct _may_ have unapplied updates. In
- * order to downgrade, you must ensure that all updates are applied to the monitor, and remove the
- * sentinel bytes.
- *
- * # Storing monitors
- *
- * Monitors are stored by implementing the [`Persist`] trait, which has two functions:
- *
- *   - [`Persist::persist_new_channel`], which persists whole [`ChannelMonitor`]s.
- *   - [`Persist::update_persisted_channel`], which persists only a [`ChannelMonitorUpdate`]
- *
- * Whole [`ChannelMonitor`]s are stored in the [`CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE`],
- * using the familiar encoding of an [`OutPoint`] (for example, `[SOME-64-CHAR-HEX-STRING]_1`).
- *
- * Each [`ChannelMonitorUpdate`] is stored in a dynamic secondary namespace, as follows:
- *
- *   - primary namespace: [`CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE`]
- *   - secondary namespace: [the monitor's encoded outpoint name]
- *
- * Under that secondary namespace, each update is stored with a number string, like `21`, which
- * represents its `update_id` value.
- *
- * For example, consider this channel, named for its transaction ID and index, or [`OutPoint`]:
- *
- *   - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
- *   - Index: `1`
- *
- * Full channel monitors would be stored at a single key:
- *
- * `[CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
- *
- * Updates would be stored as follows (with `/` delimiting primary_namespace/secondary_namespace/key):
- *
- * ```text
- * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/1
- * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/2
- * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/3
- * ```
- * ... and so on.
- *
- * # Reading channel state from storage
- *
- * Channel state can be reconstructed by calling
- * [`MonitorUpdatingPersister::read_all_channel_monitors_with_updates`]. Alternatively, users can
- * list channel monitors themselves and load channels individually using
- * [`MonitorUpdatingPersister::read_channel_monitor_with_updates`].
- *
- * ## EXTREMELY IMPORTANT
- *
- * It is extremely important that your [`KVStore::read`] implementation uses the
- * [`io::ErrorKind::NotFound`] variant correctly: that is, when a file is not found, and _only_ in
- * that circumstance (not when there is really a permissions error, for example). This is because
- * neither channel monitor reading function lists updates. Instead, either reads the monitor, and
- * using its stored `update_id`, synthesizes update storage keys, and tries them in sequence until
- * one is not found. All _other_ errors will be bubbled up in the function's [`Result`].
- *
- * # Pruning stale channel updates
- *
- * Stale updates are pruned when the consolidation threshold is reached according to `maximum_pending_updates`.
- * Monitor updates in the range between the latest `update_id` and `update_id - maximum_pending_updates`
- * are deleted.
- * The `lazy` flag is used on the [`KVStore::remove`] method, so there are no guarantees that the deletions
- * will complete. However, stale updates are not a problem for data integrity, since updates are
- * only read that are higher than the stored [`ChannelMonitor`]'s `update_id`.
- *
- * If you have many stale updates stored (such as after a crash with pending lazy deletes), and
- * would like to get rid of them, consider using the
- * [`MonitorUpdatingPersister::cleanup_stale_updates`] function.
- */
-typedef struct MUST_USE_STRUCT LDKMonitorUpdatingPersister {
-   /**
-    * A pointer to the opaque Rust object.
-    * Nearly everywhere, inner must be non-null, however in places where
-    * the Rust equivalent takes an Option, it may be set to null to indicate None.
-    */
-   LDKnativeMonitorUpdatingPersister *inner;
-   /**
-    * Indicates that this is the only struct which contains the same pointer.
-    * Rust functions which take ownership of an object provided via an argument require
-    * this to be true and invalidate the object pointed to by inner.
-    */
-   bool is_owned;
-} LDKMonitorUpdatingPersister;
-
-/**
- * `Persist` defines behavior for persisting channel monitors: this could mean
- * writing once to disk, and/or uploading to one or more backup services.
- *
- * Persistence can happen in one of two ways - synchronously completing before the trait method
- * calls return or asynchronously in the background.
- *
- * # For those implementing synchronous persistence
- *
- *  * If persistence completes fully (including any relevant `fsync()` calls), the implementation
- *    should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal channel operation
- *    should continue.
- *
- *  * If persistence fails for some reason, implementations should consider returning
- *    [`ChannelMonitorUpdateStatus::InProgress`] and retry all pending persistence operations in
- *    the background with [`ChainMonitor::list_pending_monitor_updates`] and
- *    [`ChainMonitor::get_monitor`].
- *
- *    Once a full [`ChannelMonitor`] has been persisted, all pending updates for that channel can
- *    be marked as complete via [`ChainMonitor::channel_monitor_updated`].
- *
- *    If at some point no further progress can be made towards persisting the pending updates, the
- *    node should simply shut down.
- *
- *  * If the persistence has failed and cannot be retried further (e.g. because of an outage),
- *    [`ChannelMonitorUpdateStatus::UnrecoverableError`] can be used, though this will result in
- *    an immediate panic and future operations in LDK generally failing.
- *
- * # For those implementing asynchronous persistence
- *
- *  All calls should generally spawn a background task and immediately return
- *  [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes,
- *  [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding
- *  [`MonitorUpdateId`].
- *
- *  Note that unlike the direct [`chain::Watch`] interface,
- *  [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
- *
- *  If at some point no further progress can be made towards persisting a pending update, the node
- *  should simply shut down. Until then, the background task should either loop indefinitely, or
- *  persistence should be regularly retried with [`ChainMonitor::list_pending_monitor_updates`]
- *  and [`ChainMonitor::get_monitor`] (note that if a full monitor is persisted all pending
- *  monitor updates may be marked completed).
- *
- * # Using remote watchtowers
- *
- * Watchtowers may be updated as a part of an implementation of this trait, utilizing the async
- * update process described above while the watchtower is being updated. The following methods are
- * provided for bulding transactions for a watchtower:
- * [`ChannelMonitor::initial_counterparty_commitment_tx`],
- * [`ChannelMonitor::counterparty_commitment_txs_from_update`],
- * [`ChannelMonitor::sign_to_local_justice_tx`], [`TrustedCommitmentTransaction::revokeable_output_index`],
- * [`TrustedCommitmentTransaction::build_to_local_justice_tx`].
- *
- * [`TrustedCommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::TrustedCommitmentTransaction::revokeable_output_index
- * [`TrustedCommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::TrustedCommitmentTransaction::build_to_local_justice_tx
+ * A trait that describes a wallet capable of creating a spending [`Transaction`] from a set of
+ * [`SpendableOutputDescriptor`]s.
  */
-typedef struct LDKPersist {
+typedef struct LDKOutputSpender {
    /**
     * An opaque pointer which is passed to your function implementations as an argument.
     * This has no meaning in the LDK, and can be NULL or any other value.
     */
    void *this_arg;
    /**
-    * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
-    * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
-    *
-    * The data can be stored any way you want, but the identifier provided by LDK is the
-    * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
-    * and the stored channel data). Note that you **must** persist every new monitor to disk.
-    *
-    * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
-    * if you return [`ChannelMonitorUpdateStatus::InProgress`].
-    *
-    * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
-    * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
-    *
-    * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
-    * [`Writeable::write`]: crate::util::ser::Writeable::write
-    */
-   enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
-   /**
-    * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
-    * update.
-    *
-    * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
-    * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
-    * details.
-    *
-    * During blockchain synchronization operations, and in some rare cases, this may be called with
-    * no [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
-    * Note that after the full [`ChannelMonitor`] is persisted any previous
-    * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
-    * applied to the persisted [`ChannelMonitor`] as they were already applied.
-    *
-    * If an implementer chooses to persist the updates only, they need to make
-    * sure that all the updates are applied to the `ChannelMonitors` *before*
-    * the set of channel monitors is given to the `ChannelManager`
-    * deserialization routine. See [`ChannelMonitor::update_monitor`] for
-    * applying a monitor update to a monitor. If full `ChannelMonitors` are
-    * persisted, then there is no need to persist individual updates.
-    *
-    * Note that there could be a performance tradeoff between persisting complete
-    * channel monitors on every update vs. persisting only updates and applying
-    * them in batches. The size of each monitor grows `O(number of state updates)`
-    * whereas updates are small and `O(1)`.
-    *
-    * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
-    * if you return [`ChannelMonitorUpdateStatus::InProgress`].
-    *
-    * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
-    * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
-    * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
-    *
-    * [`Writeable::write`]: crate::util::ser::Writeable::write
+    * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
+    * output to the given change destination (if sufficient change value remains). The
+    * transaction will have a feerate, at least, of the given value.
     *
-    * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
-    */
-   enum LDKChannelMonitorUpdateStatus (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint, struct LDKChannelMonitorUpdate update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
-   /**
-    * Prevents the channel monitor from being loaded on startup.
+    * The `locktime` argument is used to set the transaction's locktime. If `None`, the
+    * transaction will have a locktime of 0. It it recommended to set this to the current block
+    * height to avoid fee sniping, unless you have some specific reason to use a different
+    * locktime.
     *
-    * Archiving the data in a backup location (rather than deleting it fully) is useful for
-    * hedging against data loss in case of unexpected failure.
+    * Returns `Err(())` if the output value is greater than the input value minus required fee,
+    * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
+    * does not match the one we can spend.
     */
-   void (*archive_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint);
+   struct LDKCResult_TransactionNoneZ (*spend_spendable_outputs)(const void *this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
    /**
     * Frees any resources associated with this object given its this_arg pointer.
     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
     */
    void (*free)(void *this_arg);
-} LDKPersist;
+} LDKOutputSpender;
 
 
 
 /**
- * A string that displays only printable characters, replacing control characters with
- * [`core::char::REPLACEMENT_CHARACTER`].
+ * A utility that keeps track of [`SpendableOutputDescriptor`]s, persists them in a given
+ * [`KVStore`] and regularly retries sweeping them based on a callback given to the constructor
+ * methods.
+ *
+ * Users should call [`Self::track_spendable_outputs`] for any [`SpendableOutputDescriptor`]s received via [`Event::SpendableOutputs`].
+ *
+ * This needs to be notified of chain state changes either via its [`Listen`] or [`Confirm`]
+ * implementation and hence has to be connected with the utilized chain data sources.
+ *
+ * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users are
+ * required to give their chain data sources (i.e., [`Filter`] implementation) to the respective
+ * constructor.
+ *
+ * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
  */
-typedef struct MUST_USE_STRUCT LDKPrintableString {
+typedef struct MUST_USE_STRUCT LDKOutputSweeper {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativePrintableString *inner;
+   LDKnativeOutputSweeper *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKPrintableString;
+} LDKOutputSweeper;
 
 /**
- * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
- * chain.
- *
- * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
- * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
- * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
- * when needed.
- *
- * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
- * entire header chain and only blocks with matching transaction data using BIP 157 filters or
- * other similar filtering.
+ * The contents of CResult_OutputSweeperDecodeErrorZ
  */
-typedef struct LDKListen {
-   /**
-    * An opaque pointer which is passed to your function implementations as an argument.
-    * This has no meaning in the LDK, and can be NULL or any other value.
-    */
-   void *this_arg;
+typedef union LDKCResult_OutputSweeperDecodeErrorZPtr {
    /**
-    * Notifies the listener that a block was added at the given height, with the transaction data
-    * possibly filtered.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
+   struct LDKOutputSweeper *result;
    /**
-    * Notifies the listener that a block was added at the given height.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
+   struct LDKDecodeError *err;
+} LDKCResult_OutputSweeperDecodeErrorZPtr;
+
+/**
+ * A CResult_OutputSweeperDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::util::sweep::OutputSweeper on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_OutputSweeperDecodeErrorZ {
    /**
-    * Notifies the listener that a block was removed at the given height.
+    * The contents of this CResult_OutputSweeperDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
+   union LDKCResult_OutputSweeperDecodeErrorZPtr contents;
    /**
-    * 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.
+    * Whether this CResult_OutputSweeperDecodeErrorZ represents a success state.
     */
-   void (*free)(void *this_arg);
-} LDKListen;
+   bool result_ok;
+} LDKCResult_OutputSweeperDecodeErrorZ;
 
 /**
- * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
- * chain or unconfirmed during a chain reorganization.
- *
- * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
- * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
- * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
- * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
- * with reference to the confirmation status of the monitored objects.
- *
- * # Use
- * The intended use is as follows:
- * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
- *   outputs are, respectively, confirmed or spent on chain.
- * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
- *   [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
- * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
- *
- * # Order
- *
- * Clients must call these methods in chain order. Specifically:
- * - Transactions which are confirmed in a particular block must be given before transactions
- *   confirmed in a later block.
- * - Dependent transactions within the same block must be given in topological order, possibly in
- *   separate calls.
- * - All unconfirmed transactions must be given after the original confirmations and before *any*
- *   reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
- *   never be interleaved, but always conduced *en bloc*.
- * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
- *   in regard to the new block.
- *
- * See individual method documentation for further details.
- *
- * [`transactions_confirmed`]: Self::transactions_confirmed
- * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
- * [`best_block_updated`]: Self::best_block_updated
- * [`get_relevant_txids`]: Self::get_relevant_txids
+ * A tuple of 2 elements. See the individual fields for the types contained.
  */
-typedef struct LDKConfirm {
+typedef struct LDKC2Tuple_BestBlockOutputSweeperZ {
    /**
-    * 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.
+    * The element at position 0
     */
-   void *this_arg;
+   struct LDKBestBlock a;
    /**
-    * Notifies LDK of transactions confirmed in a block with a given header and height.
-    *
-    * Must be called for any transactions registered by [`Filter::register_tx`] or any
-    * transactions spending an output registered by [`Filter::register_output`]. Such transactions
-    * appearing in the same block do not need to be included in the same call; instead, multiple
-    * calls with additional transactions may be made so long as they are made in [chain order].
-    *
-    * May be called before or after [`best_block_updated`] for the corresponding block. However,
-    * in the event of a chain reorganization, it must not be called with a `header` that is no
-    * longer in the chain as of the last call to [`best_block_updated`].
-    *
-    * [chain order]: Confirm#order
-    * [`best_block_updated`]: Self::best_block_updated
+    * The element at position 1
     */
-   void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
+   struct LDKOutputSweeper b;
+} LDKC2Tuple_BestBlockOutputSweeperZ;
+
+/**
+ * The contents of CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ
+ */
+typedef union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr {
    /**
-    * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
-    *
-    * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
-    * reorganized out of the best chain or if it is no longer confirmed in the block with the
-    * given block hash. Once called, the given transaction will not be returned
-    * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
-    *
-    * [`get_relevant_txids`]: Self::get_relevant_txids
-    * [`transactions_confirmed`]: Self::transactions_confirmed
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
+   struct LDKC2Tuple_BestBlockOutputSweeperZ *result;
    /**
-    * Notifies LDK of an update to the best header connected at the given height.
-    *
-    * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
-    * blocks.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
+   struct LDKDecodeError *err;
+} LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr;
+
+/**
+ * A CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::C2Tuple_BestBlockOutputSweeperZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ {
    /**
-    * Returns transactions that must be monitored for reorganization out of the chain along
-    * with the height and the hash of the block as part of which it had been previously confirmed.
-    *
-    * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
-    * 0.0.112 and prior, in which case you need to manually track previous confirmations.
-    *
-    * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
-    * confirmations to be safe from a chain reorganization. Will not include any transactions
-    * passed to [`transaction_unconfirmed`], unless later reconfirmed.
-    *
-    * Must be called to determine the subset of transactions that must be monitored for
-    * reorganization. Will be idempotent between calls but may change as a result of calls to the
-    * other interface methods. Thus, this is useful to determine which transactions must be
-    * given to [`transaction_unconfirmed`].
-    *
-    * If any of the returned transactions are confirmed in a block other than the one with the
-    * given hash at the given height, they need to be unconfirmed and reconfirmed via
-    * [`transaction_unconfirmed`] and [`transactions_confirmed`], respectively.
-    *
-    * [`transactions_confirmed`]: Self::transactions_confirmed
-    * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
+    * The contents of this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ (*get_relevant_txids)(const void *this_arg);
+   union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr contents;
    /**
-    * 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.
+    * Whether this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents a success state.
     */
-   void (*free)(void *this_arg);
-} LDKConfirm;
+   bool result_ok;
+} LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ;
+
+
 
 /**
- * A `enum` signalling to the [`OutputSweeper`] that it should delay spending an output until a
- * future block height is reached.
+ * Base key used in conjunction with a `per_commitment_point` to generate a [`DelayedPaymentKey`].
+ *
+ * The delayed payment key is used to pay the commitment state broadcaster their
+ * non-HTLC-encumbered funds after a delay to give their counterparty a chance to punish if the
+ * state broadcasted was previously revoked.
  */
-typedef enum LDKSpendingDelay_Tag {
-   /**
-    * A relative delay indicating we shouldn't spend the output before `cur_height + num_blocks`
-    * is reached.
-    */
-   LDKSpendingDelay_Relative,
+typedef struct MUST_USE_STRUCT LDKDelayedPaymentBasepoint {
    /**
-    * An absolute delay indicating we shouldn't spend the output before `height` is reached.
+    * 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.
     */
-   LDKSpendingDelay_Absolute,
+   LDKnativeDelayedPaymentBasepoint *inner;
    /**
-    * Must be last for serialization purposes
+    * 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.
     */
-   LDKSpendingDelay_Sentinel,
-} LDKSpendingDelay_Tag;
+   bool is_owned;
+} LDKDelayedPaymentBasepoint;
 
-typedef struct LDKSpendingDelay_LDKRelative_Body {
+/**
+ * The contents of CResult_DelayedPaymentBasepointDecodeErrorZ
+ */
+typedef union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr {
    /**
-    * The number of blocks until we'll generate and broadcast the spending transaction.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   uint32_t num_blocks;
-} LDKSpendingDelay_LDKRelative_Body;
-
-typedef struct LDKSpendingDelay_LDKAbsolute_Body {
+   struct LDKDelayedPaymentBasepoint *result;
    /**
-    * The height at which we'll generate and broadcast the spending transaction.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   uint32_t height;
-} LDKSpendingDelay_LDKAbsolute_Body;
-
-typedef struct MUST_USE_STRUCT LDKSpendingDelay {
-   LDKSpendingDelay_Tag tag;
-   union {
-      LDKSpendingDelay_LDKRelative_Body relative;
-      LDKSpendingDelay_LDKAbsolute_Body absolute;
-   };
-} LDKSpendingDelay;
+   struct LDKDecodeError *err;
+} LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr;
 
 /**
- * A callback which is called when a [`Future`] completes.
- *
- * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
- * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
- * instead.
- *
- * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
- * futures when they receive a wake, rather than immediately executing them.
+ * A CResult_DelayedPaymentBasepointDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::DelayedPaymentBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKFutureCallback {
-   /**
-    * An opaque pointer which is passed to your function implementations as an argument.
-    * This has no meaning in the LDK, and can be NULL or any other value.
-    */
-   void *this_arg;
+typedef struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ {
    /**
-    * The method which is called.
+    * The contents of this CResult_DelayedPaymentBasepointDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   void (*call)(const void *this_arg);
+   union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr contents;
    /**
-    * 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.
+    * Whether this CResult_DelayedPaymentBasepointDecodeErrorZ represents a success state.
     */
-   void (*free)(void *this_arg);
-} LDKFutureCallback;
+   bool result_ok;
+} LDKCResult_DelayedPaymentBasepointDecodeErrorZ;
 
 
 
 /**
- * A struct which can be used to select across many [`Future`]s at once without relying on a full
- * async context.
+ * A derived key built from a [`DelayedPaymentBasepoint`] and `per_commitment_point`.
+ *
+ * The delayed payment key is used to pay the commitment state broadcaster their
+ * non-HTLC-encumbered funds after a delay. This delay gives their counterparty a chance to
+ * punish and claim all the channel funds if the state broadcasted was previously revoked.
+ *
+ * [See the BOLT specs]
+ * <https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation>
+ * for more information on key derivation details.
  */
-typedef struct MUST_USE_STRUCT LDKSleeper {
+typedef struct MUST_USE_STRUCT LDKDelayedPaymentKey {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeSleeper *inner;
+   LDKnativeDelayedPaymentKey *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKSleeper;
-
-
+} LDKDelayedPaymentKey;
 
 /**
- * Configuration we set when applicable.
- *
- * Default::default() provides sane defaults.
+ * The contents of CResult_DelayedPaymentKeyDecodeErrorZ
  */
-typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
+typedef union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr {
    /**
-    * 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.
     */
-   LDKnativeChannelHandshakeConfig *inner;
+   struct LDKDelayedPaymentKey *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.
     */
-   bool is_owned;
-} LDKChannelHandshakeConfig;
+   struct LDKDecodeError *err;
+} LDKCResult_DelayedPaymentKeyDecodeErrorZPtr;
+
+/**
+ * A CResult_DelayedPaymentKeyDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::DelayedPaymentKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_DelayedPaymentKeyDecodeErrorZ {
+   /**
+    * The contents of this CResult_DelayedPaymentKeyDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr contents;
+   /**
+    * Whether this CResult_DelayedPaymentKeyDecodeErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_DelayedPaymentKeyDecodeErrorZ;
 
 
 
 /**
- * Optional channel limits which are applied during channel creation.
- *
- * These limits are only applied to our counterparty's limits, not our own.
- *
- * Use 0/`<type>::max_value()` as appropriate to skip checking.
- *
- * Provides sane defaults for most configurations.
+ * Base key used in conjunction with a `per_commitment_point` to generate an [`HtlcKey`].
  *
- * Most additional limits are disabled except those with which specify a default in individual
- * field documentation. Note that this may result in barely-usable channels, but since they
- * are applied mostly only to incoming channels that's not much of a problem.
+ * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
+ * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
+ * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
  */
-typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
+typedef struct MUST_USE_STRUCT LDKHtlcBasepoint {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeChannelHandshakeLimits *inner;
+   LDKnativeHtlcBasepoint *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKChannelHandshakeLimits;
-
+} LDKHtlcBasepoint;
 
+/**
+ * The contents of CResult_HtlcBasepointDecodeErrorZ
+ */
+typedef union LDKCResult_HtlcBasepointDecodeErrorZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKHtlcBasepoint *result;
+   /**
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
+    */
+   struct LDKDecodeError *err;
+} LDKCResult_HtlcBasepointDecodeErrorZPtr;
 
 /**
- * A parallel struct to [`ChannelConfig`] to define partial updates.
+ * A CResult_HtlcBasepointDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::HtlcBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct MUST_USE_STRUCT LDKChannelConfigUpdate {
+typedef struct LDKCResult_HtlcBasepointDecodeErrorZ {
    /**
-    * 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.
+    * The contents of this CResult_HtlcBasepointDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   LDKnativeChannelConfigUpdate *inner;
+   union LDKCResult_HtlcBasepointDecodeErrorZPtr contents;
    /**
-    * 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.
+    * Whether this CResult_HtlcBasepointDecodeErrorZ represents a success state.
     */
-   bool is_owned;
-} LDKChannelConfigUpdate;
+   bool result_ok;
+} LDKCResult_HtlcBasepointDecodeErrorZ;
 
 
 
 /**
- * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
+ * A derived key built from a [`HtlcBasepoint`] and `per_commitment_point`.
  *
- * Default::default() provides sane defaults for most configurations
- * (but currently with 0 relay fees!)
+ * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
+ * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
+ * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
+ *
+ * [See the BOLT specs]
+ * <https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation>
+ * for more information on key derivation details.
  */
-typedef struct MUST_USE_STRUCT LDKUserConfig {
+typedef struct MUST_USE_STRUCT LDKHtlcKey {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeUserConfig *inner;
+   LDKnativeHtlcKey *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKUserConfig;
+} LDKHtlcKey;
+
+/**
+ * The contents of CResult_HtlcKeyDecodeErrorZ
+ */
+typedef union LDKCResult_HtlcKeyDecodeErrorZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKHtlcKey *result;
+   /**
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
+    */
+   struct LDKDecodeError *err;
+} LDKCResult_HtlcKeyDecodeErrorZPtr;
+
+/**
+ * A CResult_HtlcKeyDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::HtlcKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_HtlcKeyDecodeErrorZ {
+   /**
+    * The contents of this CResult_HtlcKeyDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_HtlcKeyDecodeErrorZPtr contents;
+   /**
+    * Whether this CResult_HtlcKeyDecodeErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_HtlcKeyDecodeErrorZ;
 
 
 
 /**
- * An implementation of [`chain::Watch`] for monitoring channels.
- *
- * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
- * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
- * or used independently to monitor channels remotely. See the [module-level documentation] for
- * details.
- *
- * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
- * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
- * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
- * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
- * environment with spotty connections, like on mobile.
- *
- * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
- * [module-level documentation]: crate::chain::chainmonitor
- * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
+ * Master key used in conjunction with per_commitment_point to generate [htlcpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#key-derivation) for the latest state of a channel.
+ * A watcher can be given a [RevocationBasepoint] to generate per commitment [RevocationKey] to create justice transactions.
  */
-typedef struct MUST_USE_STRUCT LDKChainMonitor {
+typedef struct MUST_USE_STRUCT LDKRevocationBasepoint {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeChainMonitor *inner;
+   LDKnativeRevocationBasepoint *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKChainMonitor;
+} LDKRevocationBasepoint;
 
 /**
- * A trait implemented for objects handling events from [`EventsProvider`].
- *
- * An async variation also exists for implementations of [`EventsProvider`] that support async
- * event handling. The async event handler should satisfy the generic bounds: `F:
- * core::future::Future, H: Fn(Event) -> F`.
+ * The contents of CResult_RevocationBasepointDecodeErrorZ
  */
-typedef struct LDKEventHandler {
+typedef union LDKCResult_RevocationBasepointDecodeErrorZPtr {
    /**
-    * An opaque pointer which is passed to your function implementations as an argument.
-    * This has no meaning in the LDK, and can be NULL or any other value.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   void *this_arg;
+   struct LDKRevocationBasepoint *result;
    /**
-    * Handles the given [`Event`].
-    *
-    * See [`EventsProvider`] for details that must be considered when implementing this method.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
+    */
+   struct LDKDecodeError *err;
+} LDKCResult_RevocationBasepointDecodeErrorZPtr;
+
+/**
+ * A CResult_RevocationBasepointDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::RevocationBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_RevocationBasepointDecodeErrorZ {
+   /**
+    * The contents of this CResult_RevocationBasepointDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   void (*handle_event)(const void *this_arg, struct LDKEvent event);
+   union LDKCResult_RevocationBasepointDecodeErrorZPtr contents;
    /**
-    * 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.
+    * Whether this CResult_RevocationBasepointDecodeErrorZ represents a success state.
     */
-   void (*free)(void *this_arg);
-} LDKEventHandler;
+   bool result_ok;
+} LDKCResult_RevocationBasepointDecodeErrorZ;
+
+
 
 /**
- * A trait indicating an object may generate events.
- *
- * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
- *
- * Implementations of this trait may also feature an async version of event handling, as shown with
- * [`ChannelManager::process_pending_events_async`] and
- * [`ChainMonitor::process_pending_events_async`].
- *
- * # Requirements
- *
- * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
- * event since the last invocation.
- *
- * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
- * and replay any unhandled events on startup. An [`Event`] is considered handled when
- * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
- * relevant changes to disk *before* returning.
- *
- * Further, because an application may crash between an [`Event`] being handled and the
- * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
- * effect, [`Event`]s may be replayed.
- *
- * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
- * consult the provider's documentation on the implication of processing events and how a handler
- * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
- * [`ChainMonitor::process_pending_events`]).
+ * The revocation key is used to allow a channel party to revoke their state - giving their
+ * counterparty the required material to claim all of their funds if they broadcast that state.
  *
- * (C-not implementable) As there is likely no reason for a user to implement this trait on their
- * own type(s).
+ * Each commitment transaction has a revocation key based on the basepoint and
+ * per_commitment_point which is used in both commitment and HTLC transactions.
  *
- * [`process_pending_events`]: Self::process_pending_events
- * [`handle_event`]: EventHandler::handle_event
- * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
- * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
- * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
- * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
+ * See [the BOLT spec for derivation details]
+ * <https://github.com/lightning/bolts/blob/master/03-transactions.md#revocationpubkey-derivation>
  */
-typedef struct LDKEventsProvider {
-   /**
-    * An opaque pointer which is passed to your function implementations as an argument.
-    * This has no meaning in the LDK, and can be NULL or any other value.
-    */
-   void *this_arg;
+typedef struct MUST_USE_STRUCT LDKRevocationKey {
    /**
-    * Processes any events generated since the last call using the given event handler.
-    *
-    * See the trait-level documentation for requirements.
+    * 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.
     */
-   void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
+   LDKnativeRevocationKey *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);
-} LDKEventsProvider;
+   bool is_owned;
+} LDKRevocationKey;
 
 /**
- * This enum is used to specify which error data to send to peers when failing back an HTLC
- * using [`ChannelManager::fail_htlc_backwards_with_reason`].
- *
- * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
+ * The contents of CResult_RevocationKeyDecodeErrorZ
  */
-typedef enum LDKFailureCode_Tag {
-   /**
-    * We had a temporary error processing the payment. Useful if no other error codes fit
-    * and you want to indicate that the payer may want to retry.
-    */
-   LDKFailureCode_TemporaryNodeFailure,
+typedef union LDKCResult_RevocationKeyDecodeErrorZPtr {
    /**
-    * We have a required feature which was not in this onion. For example, you may require
-    * some additional metadata that was not provided with this payment.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   LDKFailureCode_RequiredNodeFeatureMissing,
+   struct LDKRevocationKey *result;
    /**
-    * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
-    * the HTLC is too close to the current block height for safe handling.
-    * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
-    * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   LDKFailureCode_IncorrectOrUnknownPaymentDetails,
+   struct LDKDecodeError *err;
+} LDKCResult_RevocationKeyDecodeErrorZPtr;
+
+/**
+ * A CResult_RevocationKeyDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::RevocationKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_RevocationKeyDecodeErrorZ {
    /**
-    * We failed to process the payload after the onion was decrypted. You may wish to
-    * use this when receiving custom HTLC TLVs with even type numbers that you don't recognize.
-    *
-    * If available, the tuple data may include the type number and byte offset in the
-    * decrypted byte stream where the failure occurred.
+    * The contents of this CResult_RevocationKeyDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   LDKFailureCode_InvalidOnionPayload,
+   union LDKCResult_RevocationKeyDecodeErrorZPtr contents;
    /**
-    * Must be last for serialization purposes
+    * Whether this CResult_RevocationKeyDecodeErrorZ represents a success state.
     */
-   LDKFailureCode_Sentinel,
-} LDKFailureCode_Tag;
-
-typedef struct MUST_USE_STRUCT LDKFailureCode {
-   LDKFailureCode_Tag tag;
-   union {
-      struct {
-         struct LDKCOption_C2Tuple_u64u16ZZ invalid_onion_payload;
-      };
-   };
-} LDKFailureCode;
+   bool result_ok;
+} LDKCResult_RevocationKeyDecodeErrorZ;
 
 
 
 /**
- * Chain-related parameters used to construct a new `ChannelManager`.
+ * A read-only reference to a current ChannelMonitor.
  *
- * Typically, the block-specific parameters are derived from the best block hash for the network,
- * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
- * are not needed when deserializing a previously constructed `ChannelManager`.
+ * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
+ * released.
  */
-typedef struct MUST_USE_STRUCT LDKChainParameters {
+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.
     */
-   LDKnativeChainParameters *inner;
+   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;
-} LDKChainParameters;
+} LDKLockedChannelMonitor;
 
 /**
- * A trait indicating an object may generate message send events
+ * The contents of CResult_LockedChannelMonitorNoneZ
  */
-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 union LDKCResult_LockedChannelMonitorNoneZPtr {
    /**
-    * Gets the list of pending events which were generated by previous actions, clearing the list
-    * in the process.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
+   struct LDKLockedChannelMonitor *result;
    /**
-    * 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.
+    * Note that this value is always NULL, as there are no contents in the Err variant
     */
-   void (*free)(void *this_arg);
-} LDKMessageSendEventsProvider;
+   void *err;
+} LDKCResult_LockedChannelMonitorNoneZPtr;
 
 /**
- * A trait to describe an object which can receive channel messages.
- *
- * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
- * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
+ * 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 LDKChannelMessageHandler {
-   /**
-    * An opaque pointer which is passed to your function implementations as an argument.
-    * This has no meaning in the LDK, and can be NULL or any other value.
-    */
-   void *this_arg;
+typedef struct LDKCResult_LockedChannelMonitorNoneZ {
    /**
-    * Handle an incoming `open_channel` message from the given peer.
+    * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
+   union LDKCResult_LockedChannelMonitorNoneZPtr contents;
    /**
-    * Handle an incoming `open_channel2` message from the given peer.
+    * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
     */
-   void (*handle_open_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg);
+   bool result_ok;
+} LDKCResult_LockedChannelMonitorNoneZ;
+
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple_OutPointChannelIdZ {
    /**
-    * Handle an incoming `accept_channel` message from the given peer.
+    * The element at position 0
     */
-   void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
+   struct LDKOutPoint a;
    /**
-    * Handle an incoming `accept_channel2` message from the given peer.
+    * The element at position 1
     */
-   void (*handle_accept_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg);
+   struct LDKChannelId b;
+} LDKC2Tuple_OutPointChannelIdZ;
+
+/**
+ * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointChannelIdZs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_C2Tuple_OutPointChannelIdZZ {
    /**
-    * Handle an incoming `funding_created` message from the given peer.
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
     */
-   void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
+   struct LDKC2Tuple_OutPointChannelIdZ *data;
    /**
-    * Handle an incoming `funding_signed` message from the given peer.
+    * The number of elements pointed to by `data`.
     */
-   void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
+   uintptr_t datalen;
+} LDKCVec_C2Tuple_OutPointChannelIdZZ;
+
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple_OutPointCVec_u64ZZ {
    /**
-    * Handle an incoming `channel_ready` message from the given peer.
+    * The element at position 0
     */
-   void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
+   struct LDKOutPoint a;
    /**
-    * Handle an incoming `shutdown` message from the given peer.
+    * The element at position 1
     */
-   void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
+   struct LDKCVec_u64Z b;
+} LDKC2Tuple_OutPointCVec_u64ZZ;
+
+/**
+ * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_u64ZZs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_C2Tuple_OutPointCVec_u64ZZZ {
    /**
-    * Handle an incoming `closing_signed` message from the given peer.
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
     */
-   void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
+   struct LDKC2Tuple_OutPointCVec_u64ZZ *data;
    /**
-    * Handle an incoming `stfu` message from the given peer.
+    * The number of elements pointed to by `data`.
     */
-   void (*handle_stfu)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKStfu *NONNULL_PTR msg);
+   uintptr_t datalen;
+} LDKCVec_C2Tuple_OutPointCVec_u64ZZZ;
+
+/**
+ * The contents of CResult_BlindedMessagePathDecodeErrorZ
+ */
+typedef union LDKCResult_BlindedMessagePathDecodeErrorZPtr {
    /**
-    * Handle an incoming `tx_add_input message` from the given peer.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   void (*handle_tx_add_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg);
+   struct LDKBlindedMessagePath *result;
    /**
-    * Handle an incoming `tx_add_output` message from the given peer.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   void (*handle_tx_add_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg);
+   struct LDKDecodeError *err;
+} LDKCResult_BlindedMessagePathDecodeErrorZPtr;
+
+/**
+ * A CResult_BlindedMessagePathDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::message::BlindedMessagePath on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_BlindedMessagePathDecodeErrorZ {
    /**
-    * Handle an incoming `tx_remove_input` message from the given peer.
+    * The contents of this CResult_BlindedMessagePathDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   void (*handle_tx_remove_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg);
+   union LDKCResult_BlindedMessagePathDecodeErrorZPtr contents;
    /**
-    * Handle an incoming `tx_remove_output` message from the given peer.
+    * Whether this CResult_BlindedMessagePathDecodeErrorZ represents a success state.
     */
-   void (*handle_tx_remove_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg);
+   bool result_ok;
+} LDKCResult_BlindedMessagePathDecodeErrorZ;
+
+/**
+ * The contents of CResult_BlindedMessagePathNoneZ
+ */
+typedef union LDKCResult_BlindedMessagePathNoneZPtr {
    /**
-    * Handle an incoming `tx_complete message` from the given peer.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   void (*handle_tx_complete)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg);
+   struct LDKBlindedMessagePath *result;
    /**
-    * Handle an incoming `tx_signatures` message from the given peer.
+    * Note that this value is always NULL, as there are no contents in the Err variant
     */
-   void (*handle_tx_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg);
+   void *err;
+} LDKCResult_BlindedMessagePathNoneZPtr;
+
+/**
+ * A CResult_BlindedMessagePathNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::message::BlindedMessagePath on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_BlindedMessagePathNoneZ {
    /**
-    * Handle an incoming `tx_init_rbf` message from the given peer.
+    * The contents of this CResult_BlindedMessagePathNoneZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   void (*handle_tx_init_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg);
+   union LDKCResult_BlindedMessagePathNoneZPtr contents;
    /**
-    * Handle an incoming `tx_ack_rbf` message from the given peer.
+    * Whether this CResult_BlindedMessagePathNoneZ represents a success state.
     */
-   void (*handle_tx_ack_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg);
+   bool result_ok;
+} LDKCResult_BlindedMessagePathNoneZ;
+
+/**
+ * The contents of CResult_MessageContextDecodeErrorZ
+ */
+typedef union LDKCResult_MessageContextDecodeErrorZPtr {
    /**
-    * Handle an incoming `tx_abort message` from the given peer.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   void (*handle_tx_abort)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg);
+   struct LDKMessageContext *result;
    /**
-    * Handle an incoming `update_add_htlc` message from the given peer.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
+   struct LDKDecodeError *err;
+} LDKCResult_MessageContextDecodeErrorZPtr;
+
+/**
+ * A CResult_MessageContextDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::message::MessageContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_MessageContextDecodeErrorZ {
    /**
-    * Handle an incoming `update_fulfill_htlc` message from the given peer.
+    * The contents of this CResult_MessageContextDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
+   union LDKCResult_MessageContextDecodeErrorZPtr contents;
    /**
-    * Handle an incoming `update_fail_htlc` message from the given peer.
+    * Whether this CResult_MessageContextDecodeErrorZ represents a success state.
     */
-   void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
+   bool result_ok;
+} LDKCResult_MessageContextDecodeErrorZ;
+
+/**
+ * The contents of CResult_OffersContextDecodeErrorZ
+ */
+typedef union LDKCResult_OffersContextDecodeErrorZPtr {
    /**
-    * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
+   struct LDKOffersContext *result;
    /**
-    * Handle an incoming `commitment_signed` message from the given peer.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
+   struct LDKDecodeError *err;
+} LDKCResult_OffersContextDecodeErrorZPtr;
+
+/**
+ * A CResult_OffersContextDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::message::OffersContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_OffersContextDecodeErrorZ {
    /**
-    * Handle an incoming `revoke_and_ack` message from the given peer.
+    * The contents of this CResult_OffersContextDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
     */
-   void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
+   union LDKCResult_OffersContextDecodeErrorZPtr contents;
    /**
-    * Handle an incoming `update_fee` message from the given peer.
+    * Whether this CResult_OffersContextDecodeErrorZ represents a success state.
     */
-   void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
+   bool result_ok;
+} LDKCResult_OffersContextDecodeErrorZ;
+
+/**
+ * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ */
+typedef struct LDKPersister {
    /**
-    * Handle an incoming `announcement_signatures` message from the given peer.
+    * 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 (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
+   void *this_arg;
    /**
-    * Indicates a connection to the peer failed/an existing connection was lost.
+    * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
+    *
+    * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
     */
-   void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
+   struct LDKCResult_NoneIOErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
    /**
-    * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
-    *
-    * May return an `Err(())` if the features the peer supports are not sufficient to communicate
-    * with us. Implementors should be somewhat conservative about doing so, however, as other
-    * message handlers may still wish to communicate with this peer.
+    * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
     */
-   struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
+   struct LDKCResult_NoneIOErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
    /**
-    * Handle an incoming `channel_reestablish` message from the given peer.
+    * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
     */
-   void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
+   struct LDKCResult_NoneIOErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
    /**
-    * Handle an incoming `channel_update` message from the given peer.
+    * 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 (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
+   void (*free)(void *this_arg);
+} LDKPersister;
+
+
+
+/**
+ * Implements [`Persist`] in a way that writes and reads both [`ChannelMonitor`]s and
+ * [`ChannelMonitorUpdate`]s.
+ *
+ * # Overview
+ *
+ * The main benefit this provides over the [`KVStore`]'s [`Persist`] implementation is decreased
+ * I/O bandwidth and storage churn, at the expense of more IOPS (including listing, reading, and
+ * deleting) and complexity. This is because it writes channel monitor differential updates,
+ * whereas the other (default) implementation rewrites the entire monitor on each update. For
+ * routing nodes, updates can happen many times per second to a channel, and monitors can be tens
+ * of megabytes (or more). Updates can be as small as a few hundred bytes.
+ *
+ * Note that monitors written with `MonitorUpdatingPersister` are _not_ backward-compatible with
+ * the default [`KVStore`]'s [`Persist`] implementation. They have a prepended byte sequence,
+ * [`MONITOR_UPDATING_PERSISTER_PREPEND_SENTINEL`], applied to prevent deserialization with other
+ * persisters. This is because monitors written by this struct _may_ have unapplied updates. In
+ * order to downgrade, you must ensure that all updates are applied to the monitor, and remove the
+ * sentinel bytes.
+ *
+ * # Storing monitors
+ *
+ * Monitors are stored by implementing the [`Persist`] trait, which has two functions:
+ *
+ *   - [`Persist::persist_new_channel`], which persists whole [`ChannelMonitor`]s.
+ *   - [`Persist::update_persisted_channel`], which persists only a [`ChannelMonitorUpdate`]
+ *
+ * Whole [`ChannelMonitor`]s are stored in the [`CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE`],
+ * using the familiar encoding of an [`OutPoint`] (for example, `[SOME-64-CHAR-HEX-STRING]_1`).
+ *
+ * Each [`ChannelMonitorUpdate`] is stored in a dynamic secondary namespace, as follows:
+ *
+ *   - primary namespace: [`CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE`]
+ *   - secondary namespace: [the monitor's encoded outpoint name]
+ *
+ * Under that secondary namespace, each update is stored with a number string, like `21`, which
+ * represents its `update_id` value.
+ *
+ * For example, consider this channel, named for its transaction ID and index, or [`OutPoint`]:
+ *
+ *   - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
+ *   - Index: `1`
+ *
+ * Full channel monitors would be stored at a single key:
+ *
+ * `[CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
+ *
+ * Updates would be stored as follows (with `/` delimiting primary_namespace/secondary_namespace/key):
+ *
+ * ```text
+ * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/1
+ * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/2
+ * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/3
+ * ```
+ * ... and so on.
+ *
+ * # Reading channel state from storage
+ *
+ * Channel state can be reconstructed by calling
+ * [`MonitorUpdatingPersister::read_all_channel_monitors_with_updates`]. Alternatively, users can
+ * list channel monitors themselves and load channels individually using
+ * [`MonitorUpdatingPersister::read_channel_monitor_with_updates`].
+ *
+ * ## EXTREMELY IMPORTANT
+ *
+ * It is extremely important that your [`KVStore::read`] implementation uses the
+ * [`io::ErrorKind::NotFound`] variant correctly: that is, when a file is not found, and _only_ in
+ * that circumstance (not when there is really a permissions error, for example). This is because
+ * neither channel monitor reading function lists updates. Instead, either reads the monitor, and
+ * using its stored `update_id`, synthesizes update storage keys, and tries them in sequence until
+ * one is not found. All _other_ errors will be bubbled up in the function's [`Result`].
+ *
+ * # Pruning stale channel updates
+ *
+ * Stale updates are pruned when the consolidation threshold is reached according to `maximum_pending_updates`.
+ * Monitor updates in the range between the latest `update_id` and `update_id - maximum_pending_updates`
+ * are deleted.
+ * The `lazy` flag is used on the [`KVStore::remove`] method, so there are no guarantees that the deletions
+ * will complete. However, stale updates are not a problem for data integrity, since updates are
+ * only read that are higher than the stored [`ChannelMonitor`]'s `update_id`.
+ *
+ * If you have many stale updates stored (such as after a crash with pending lazy deletes), and
+ * would like to get rid of them, consider using the
+ * [`MonitorUpdatingPersister::cleanup_stale_updates`] function.
+ */
+typedef struct MUST_USE_STRUCT LDKMonitorUpdatingPersister {
    /**
-    * Handle an incoming `error` message from the given peer.
+    * 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.
     */
-   void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
+   LDKnativeMonitorUpdatingPersister *inner;
    /**
-    * Gets the node feature flags which this handler itself supports. All available handlers are
-    * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
-    * which are broadcasted in our [`NodeAnnouncement`] message.
+    * 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.
     */
-   struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
+   bool is_owned;
+} LDKMonitorUpdatingPersister;
+
+/**
+ * `Persist` defines behavior for persisting channel monitors: this could mean
+ * writing once to disk, and/or uploading to one or more backup services.
+ *
+ * Persistence can happen in one of two ways - synchronously completing before the trait method
+ * calls return or asynchronously in the background.
+ *
+ * # For those implementing synchronous persistence
+ *
+ *  * If persistence completes fully (including any relevant `fsync()` calls), the implementation
+ *    should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal channel operation
+ *    should continue.
+ *
+ *  * If persistence fails for some reason, implementations should consider returning
+ *    [`ChannelMonitorUpdateStatus::InProgress`] and retry all pending persistence operations in
+ *    the background with [`ChainMonitor::list_pending_monitor_updates`] and
+ *    [`ChainMonitor::get_monitor`].
+ *
+ *    Once a full [`ChannelMonitor`] has been persisted, all pending updates for that channel can
+ *    be marked as complete via [`ChainMonitor::channel_monitor_updated`].
+ *
+ *    If at some point no further progress can be made towards persisting the pending updates, the
+ *    node should simply shut down.
+ *
+ *  * If the persistence has failed and cannot be retried further (e.g. because of an outage),
+ *    [`ChannelMonitorUpdateStatus::UnrecoverableError`] can be used, though this will result in
+ *    an immediate panic and future operations in LDK generally failing.
+ *
+ * # For those implementing asynchronous persistence
+ *
+ *  All calls should generally spawn a background task and immediately return
+ *  [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes,
+ *  [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding
+ *  [`ChannelMonitor::get_latest_update_id`] or [`ChannelMonitorUpdate::update_id`].
+ *
+ *  Note that unlike the direct [`chain::Watch`] interface,
+ *  [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
+ *
+ *  If at some point no further progress can be made towards persisting a pending update, the node
+ *  should simply shut down. Until then, the background task should either loop indefinitely, or
+ *  persistence should be regularly retried with [`ChainMonitor::list_pending_monitor_updates`]
+ *  and [`ChainMonitor::get_monitor`] (note that if a full monitor is persisted all pending
+ *  monitor updates may be marked completed).
+ *
+ * # Using remote watchtowers
+ *
+ * Watchtowers may be updated as a part of an implementation of this trait, utilizing the async
+ * update process described above while the watchtower is being updated. The following methods are
+ * provided for bulding transactions for a watchtower:
+ * [`ChannelMonitor::initial_counterparty_commitment_tx`],
+ * [`ChannelMonitor::counterparty_commitment_txs_from_update`],
+ * [`ChannelMonitor::sign_to_local_justice_tx`], [`TrustedCommitmentTransaction::revokeable_output_index`],
+ * [`TrustedCommitmentTransaction::build_to_local_justice_tx`].
+ *
+ * [`TrustedCommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::TrustedCommitmentTransaction::revokeable_output_index
+ * [`TrustedCommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::TrustedCommitmentTransaction::build_to_local_justice_tx
+ */
+typedef struct LDKPersist {
    /**
-    * Gets the init feature flags which should be sent to the given peer. All available handlers
-    * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
-    * which are sent in our [`Init`] message.
+    * An opaque pointer which is passed to your function implementations as an argument.
+    * This has no meaning in the LDK, and can be NULL or any other value.
+    */
+   void *this_arg;
+   /**
+    * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
+    * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
     *
-    * Note that this method is called before [`Self::peer_connected`].
+    * The data can be stored any way you want, but the identifier provided by LDK is the
+    * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
+    * and the stored channel data). Note that you **must** persist every new monitor to disk.
+    *
+    * The [`ChannelMonitor::get_latest_update_id`] uniquely links this call to [`ChainMonitor::channel_monitor_updated`].
+    * For [`Persist::persist_new_channel`], it is only necessary to call [`ChainMonitor::channel_monitor_updated`]
+    * when you return [`ChannelMonitorUpdateStatus::InProgress`].
+    *
+    * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
+    * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
+    *
+    * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+    * [`Writeable::write`]: crate::util::ser::Writeable::write
     */
-   struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
+   enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint, const struct LDKChannelMonitor *NONNULL_PTR monitor);
    /**
-    * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports.
+    * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
+    * update.
     *
-    * If it's `None`, then no particular network chain hash compatibility will be enforced when
-    * connecting to peers.
+    * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
+    * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
+    * details.
+    *
+    * During blockchain synchronization operations, and in some rare cases, this may be called with
+    * no [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
+    * Note that after the full [`ChannelMonitor`] is persisted any previous
+    * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
+    * applied to the persisted [`ChannelMonitor`] as they were already applied.
+    *
+    * If an implementer chooses to persist the updates only, they need to make
+    * sure that all the updates are applied to the `ChannelMonitors` *before*
+    * the set of channel monitors is given to the `ChannelManager`
+    * deserialization routine. If there are any gaps in the persisted [`ChannelMonitorUpdate`]s,
+    * implementer can safely ignore [`ChannelMonitorUpdate`]s after the gap and load without them.
+    * See [`ChannelMonitor::update_monitor`] for
+    * applying a monitor update to a monitor. If full `ChannelMonitors` are
+    * persisted, then there is no need to persist individual updates.
+    *
+    * Note that there could be a performance tradeoff between persisting complete
+    * channel monitors on every update vs. persisting only updates and applying
+    * them in batches. The size of each monitor grows `O(number of state updates)`
+    * whereas updates are small and `O(1)`.
+    *
+    * The [`ChannelMonitorUpdate::update_id`] or [`ChannelMonitor::get_latest_update_id`] uniquely
+    * links this call to [`ChainMonitor::channel_monitor_updated`].
+    * For [`Persist::update_persisted_channel`], it is only necessary to call [`ChainMonitor::channel_monitor_updated`]
+    * when a [`ChannelMonitorUpdate`] is provided and when you return [`ChannelMonitorUpdateStatus::InProgress`].
+    *
+    * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
+    * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
+    * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
+    *
+    * [`Writeable::write`]: crate::util::ser::Writeable::write
+    *
+    * Note that monitor_update (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   struct LDKCOption_CVec_ThirtyTwoBytesZZ (*get_chain_hashes)(const void *this_arg);
+   enum LDKChannelMonitorUpdateStatus (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint, struct LDKChannelMonitorUpdate monitor_update, const struct LDKChannelMonitor *NONNULL_PTR monitor);
    /**
-    * Implementation of MessageSendEventsProvider for this object.
+    * Prevents the channel monitor from being loaded on startup.
+    *
+    * Archiving the data in a backup location (rather than deleting it fully) is useful for
+    * hedging against data loss in case of unexpected failure.
     */
-   struct LDKMessageSendEventsProvider MessageSendEventsProvider;
+   void (*archive_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint);
    /**
     * Frees any resources associated with this object given its this_arg pointer.
     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
     */
    void (*free)(void *this_arg);
-} LDKChannelMessageHandler;
+} LDKPersist;
 
 /**
- * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload.
+ * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
+ * chain.
  *
- * [`OnionMessage`]: crate::ln::msgs::OnionMessage
+ * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
+ * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
+ * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
+ * when needed.
+ *
+ * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
+ * entire header chain and only blocks with matching transaction data using BIP 157 filters or
+ * other similar filtering.
  */
-typedef struct LDKOffersMessageHandler {
+typedef struct LDKListen {
    /**
     * An opaque pointer which is passed to your function implementations as an argument.
     * This has no meaning in the LDK, and can be NULL or any other value.
     */
    void *this_arg;
    /**
-    * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment,
-    * or replying with an error.
-    *
-    * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
-    *
-    * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
+    * Notifies the listener that a block was added at the given height, with the transaction data
+    * possibly filtered.
     */
-   struct LDKCOption_OffersMessageZ (*handle_message)(const void *this_arg, struct LDKOffersMessage message);
+   void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
    /**
-    * Releases any [`OffersMessage`]s that need to be sent.
-    *
-    * Typically, this is used for messages initiating a payment flow rather than in response to
-    * another message. The latter should use the return value of [`Self::handle_message`].
+    * Notifies the listener that a block was added at the given height.
+    */
+   void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
+   /**
+    * Notifies the listener that a block was removed at the given height.
     */
-   struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ (*release_pending_messages)(const void *this_arg);
+   void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
    /**
     * Frees any resources associated with this object given its this_arg pointer.
     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
     */
    void (*free)(void *this_arg);
-} LDKOffersMessageHandler;
+} LDKListen;
 
 /**
- * An interface for looking up the node id of a channel counterparty for the purpose of forwarding
- * an [`OnionMessage`].
+ * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
+ * chain or unconfirmed during a chain reorganization.
  *
- * [`OnionMessage`]: crate::ln::msgs::OnionMessage
+ * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
+ * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
+ * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
+ * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
+ * with reference to the confirmation status of the monitored objects.
+ *
+ * # Use
+ * The intended use is as follows:
+ * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
+ *   outputs are, respectively, confirmed or spent on chain.
+ * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
+ *   [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
+ * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
+ *
+ * # Order
+ *
+ * Clients must call these methods in chain order. Specifically:
+ * - Transactions which are confirmed in a particular block must be given before transactions
+ *   confirmed in a later block.
+ * - Dependent transactions within the same block must be given in topological order, possibly in
+ *   separate calls.
+ * - All unconfirmed transactions must be given after the original confirmations and before *any*
+ *   reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
+ *   never be interleaved, but always conduced *en bloc*.
+ * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
+ *   in regard to the new block.
+ *
+ * See individual method documentation for further details.
+ *
+ * [`transactions_confirmed`]: Self::transactions_confirmed
+ * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
+ * [`best_block_updated`]: Self::best_block_updated
+ * [`get_relevant_txids`]: Self::get_relevant_txids
  */
-typedef struct LDKNodeIdLookUp {
+typedef struct LDKConfirm {
    /**
     * An opaque pointer which is passed to your function implementations as an argument.
     * This has no meaning in the LDK, and can be NULL or any other value.
     */
    void *this_arg;
    /**
-    * Returns the node id of the forwarding node's channel counterparty with `short_channel_id`.
+    * Notifies LDK of transactions confirmed in a block with a given header and height.
     *
-    * Here, the forwarding node is referring to the node of the [`OnionMessenger`] parameterized
-    * by the [`NodeIdLookUp`] and the counterparty to one of that node's peers.
+    * Must be called for any transactions registered by [`Filter::register_tx`] or any
+    * transactions spending an output registered by [`Filter::register_output`]. Such transactions
+    * appearing in the same block do not need to be included in the same call; instead, multiple
+    * calls with additional transactions may be made so long as they are made in [chain order].
     *
-    * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
+    * May be called before or after [`best_block_updated`] for the corresponding block. However,
+    * in the event of a chain reorganization, it must not be called with a `header` that is no
+    * longer in the chain as of the last call to [`best_block_updated`].
     *
-    * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * [chain order]: Confirm#order
+    * [`best_block_updated`]: Self::best_block_updated
     */
-   struct LDKPublicKey (*next_node_id)(const void *this_arg, uint64_t short_channel_id);
+   void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
+   /**
+    * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
+    *
+    * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
+    * reorganized out of the best chain or if it is no longer confirmed in the block with the
+    * given block hash. Once called, the given transaction will not be returned
+    * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
+    *
+    * [`get_relevant_txids`]: Self::get_relevant_txids
+    * [`transactions_confirmed`]: Self::transactions_confirmed
+    */
+   void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
+   /**
+    * Notifies LDK of an update to the best header connected at the given height.
+    *
+    * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
+    * blocks.
+    */
+   void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
+   /**
+    * Returns transactions that must be monitored for reorganization out of the chain along
+    * with the height and the hash of the block as part of which it had been previously confirmed.
+    *
+    * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
+    * 0.0.112 and prior, in which case you need to manually track previous confirmations.
+    *
+    * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
+    * confirmations to be safe from a chain reorganization. Will not include any transactions
+    * passed to [`transaction_unconfirmed`], unless later reconfirmed.
+    *
+    * Must be called to determine the subset of transactions that must be monitored for
+    * reorganization. Will be idempotent between calls but may change as a result of calls to the
+    * other interface methods. Thus, this is useful to determine which transactions must be
+    * given to [`transaction_unconfirmed`].
+    *
+    * If any of the returned transactions are confirmed in a block other than the one with the
+    * given hash at the given height, they need to be unconfirmed and reconfirmed via
+    * [`transaction_unconfirmed`] and [`transactions_confirmed`], respectively.
+    *
+    * [`transactions_confirmed`]: Self::transactions_confirmed
+    * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
+    */
+   struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ (*get_relevant_txids)(const void *this_arg);
    /**
     * Frees any resources associated with this object given its this_arg pointer.
     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
     */
    void (*free)(void *this_arg);
-} LDKNodeIdLookUp;
-
-
+} LDKConfirm;
 
 /**
- * Arguments for the creation of a ChannelManager that are not deserialized.
- *
- * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
- * is:
- * 1) Deserialize all stored [`ChannelMonitor`]s.
- * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
- *    `<(BlockHash, ChannelManager)>::read(reader, args)`
- *    This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
- *    [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
- * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
- *    same way you would handle a [`chain::Filter`] call using
- *    [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
- * 4) Reconnect blocks on your [`ChannelMonitor`]s.
- * 5) Disconnect/connect blocks on the [`ChannelManager`].
- * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
- *    Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
- *    will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
- *    the next step.
- * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
- *    [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
- *
- * Note that the ordering of #4-7 is not of importance, however all four must occur before you
- * call any other methods on the newly-deserialized [`ChannelManager`].
- *
- * Note that because some channels may be closed during deserialization, it is critical that you
- * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
- * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
- * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
- * not force-close the same channels but consider them live), you may end up revoking a state for
- * which you've already broadcasted the transaction.
- *
- * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
+ * A `enum` signalling to the [`OutputSweeper`] that it should delay spending an output until a
+ * future block height is reached.
  */
-typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
+typedef enum LDKSpendingDelay_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.
+    * A relative delay indicating we shouldn't spend the output before `cur_height + num_blocks`
+    * is reached.
     */
-   LDKnativeChannelManagerReadArgs *inner;
+   LDKSpendingDelay_Relative,
    /**
-    * 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.
+    * An absolute delay indicating we shouldn't spend the output before `height` is reached.
     */
-   bool is_owned;
-} LDKChannelManagerReadArgs;
+   LDKSpendingDelay_Absolute,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKSpendingDelay_Sentinel,
+} LDKSpendingDelay_Tag;
+
+typedef struct LDKSpendingDelay_LDKRelative_Body {
+   /**
+    * The number of blocks until we'll generate and broadcast the spending transaction.
+    */
+   uint32_t num_blocks;
+} LDKSpendingDelay_LDKRelative_Body;
 
+typedef struct LDKSpendingDelay_LDKAbsolute_Body {
+   /**
+    * The height at which we'll generate and broadcast the spending transaction.
+    */
+   uint32_t height;
+} LDKSpendingDelay_LDKAbsolute_Body;
 
+typedef struct MUST_USE_STRUCT LDKSpendingDelay {
+   LDKSpendingDelay_Tag tag;
+   union {
+      LDKSpendingDelay_LDKRelative_Body relative;
+      LDKSpendingDelay_LDKAbsolute_Body absolute;
+   };
+} LDKSpendingDelay;
 
 /**
- * A set of keys that were HKDF-expanded from an initial call to
- * [`NodeSigner::get_inbound_payment_key_material`].
+ * A callback which is called when a [`Future`] completes.
  *
- * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
+ * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
+ * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
+ * instead.
+ *
+ * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
+ * futures when they receive a wake, rather than immediately executing them.
  */
-typedef struct MUST_USE_STRUCT LDKExpandedKey {
+typedef struct LDKFutureCallback {
    /**
-    * 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.
     */
-   LDKnativeExpandedKey *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.
+    * The method which is called.
     */
-   bool is_owned;
-} LDKExpandedKey;
+   void (*call)(const void *this_arg);
+   /**
+    * Frees any resources associated with this object given its this_arg pointer.
+    * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+    */
+   void (*free)(void *this_arg);
+} LDKFutureCallback;
 
 
 
 /**
- * Contains fields that are both common to [`open_channel`] and `open_channel2` messages.
- *
- * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
+ * A struct which can be used to select across many [`Future`]s at once without relying on a full
+ * async context.
  */
-typedef struct MUST_USE_STRUCT LDKCommonOpenChannelFields {
+typedef struct MUST_USE_STRUCT LDKSleeper {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeCommonOpenChannelFields *inner;
+   LDKnativeSleeper *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKCommonOpenChannelFields;
+} LDKSleeper;
 
 
 
 /**
- * Contains fields that are both common to [`accept_channel`] and `accept_channel2` messages.
+ * Configuration we set when applicable.
  *
- * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
+ * `Default::default()` provides sane defaults.
  */
-typedef struct MUST_USE_STRUCT LDKCommonAcceptChannelFields {
+typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeCommonAcceptChannelFields *inner;
+   LDKnativeChannelHandshakeConfig *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKCommonAcceptChannelFields;
+} LDKChannelHandshakeConfig;
 
 
 
 /**
- * Packet of hop data for next peer
+ * Optional channel limits which are applied during channel creation.
+ *
+ * These limits are only applied to our counterparty's limits, not our own.
+ *
+ * Use `0` or `<type>::max_value()` as appropriate to skip checking.
+ *
+ * Provides sane defaults for most configurations.
+ *
+ * Most additional limits are disabled except those with which specify a default in individual
+ * field documentation. Note that this may result in barely-usable channels, but since they
+ * are applied mostly only to incoming channels that's not much of a problem.
  */
-typedef struct MUST_USE_STRUCT LDKPacket {
+typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativePacket *inner;
+   LDKnativeChannelHandshakeLimits *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKPacket;
+} LDKChannelHandshakeLimits;
+
+
 
 /**
- * A trait to describe an object which can receive routing messages.
- *
- * # Implementor DoS Warnings
- *
- * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
- * handling inbound queries. Implementors using an on-disk network graph should be aware of
- * repeated disk I/O for queries accessing different parts of the network graph.
+ * A parallel struct to [`ChannelConfig`] to define partial updates.
  */
-typedef struct LDKRoutingMessageHandler {
-   /**
-    * An opaque pointer which is passed to your function implementations as an argument.
-    * This has no meaning in the LDK, and can be NULL or any other value.
-    */
-   void *this_arg;
-   /**
-    * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
-    * `false` or returning an `Err` otherwise.
-    */
-   struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
-   /**
-    * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
-    * or returning an `Err` otherwise.
-    */
-   struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
-   /**
-    * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
-    * `false` or returning an `Err` otherwise.
-    */
-   struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
-   /**
-    * Gets channel announcements and updates required to dump our routing table to a remote node,
-    * starting at the `short_channel_id` indicated by `starting_point` and including announcements
-    * for a single channel.
-    */
-   struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
-   /**
-    * Gets a node announcement required to dump our routing table to a remote node, starting at
-    * the node *after* the provided pubkey and including up to one announcement immediately
-    * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
-    * If `None` is provided for `starting_point`, we start at the first node.
-    *
-    * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
-    * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
-    */
-   struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
+typedef struct MUST_USE_STRUCT LDKChannelConfigUpdate {
    /**
-    * Called when a connection is established with a peer. This can be used to
-    * perform routing table synchronization using a strategy defined by the
-    * implementor.
-    *
-    * May return an `Err(())` if the features the peer supports are not sufficient to communicate
-    * with us. Implementors should be somewhat conservative about doing so, however, as other
-    * message handlers may still wish to communicate with this peer.
+    * 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_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
+   LDKnativeChannelConfigUpdate *inner;
    /**
-    * Handles the reply of a query we initiated to learn about channels
-    * for a given range of blocks. We can expect to receive one or more
-    * replies to a single query.
+    * 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.
     */
-   struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
+   bool is_owned;
+} LDKChannelConfigUpdate;
+
+
+
+/**
+ * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
+ *
+ * `Default::default()` provides sane defaults for most configurations
+ * (but currently with zero relay fees!)
+ */
+typedef struct MUST_USE_STRUCT LDKUserConfig {
    /**
-    * Handles the reply of a query we initiated asking for routing gossip
-    * messages for a list of channels. We should receive this message when
-    * a node has completed its best effort to send us the pertaining routing
-    * gossip messages.
+    * 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_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
+   LDKnativeUserConfig *inner;
    /**
-    * Handles when a peer asks us to send a list of `short_channel_id`s
-    * for the requested range of blocks.
+    * 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.
     */
-   struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
+   bool is_owned;
+} LDKUserConfig;
+
+
+
+/**
+ * An implementation of [`chain::Watch`] for monitoring channels.
+ *
+ * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
+ * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
+ * or used independently to monitor channels remotely. See the [module-level documentation] for
+ * details.
+ *
+ * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
+ * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
+ * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
+ * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
+ * environment with spotty connections, like on mobile.
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [module-level documentation]: crate::chain::chainmonitor
+ * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
+ */
+typedef struct MUST_USE_STRUCT LDKChainMonitor {
    /**
-    * Handles when a peer asks us to send routing gossip messages for a
-    * list of `short_channel_id`s.
+    * 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_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
+   LDKnativeChainMonitor *inner;
    /**
-    * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
-    * pending some async action. While there is no guarantee of the rate of future messages, the
-    * caller should seek to reduce the rate of new gossip messages handled, especially
-    * [`ChannelAnnouncement`]s.
+    * 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 (*processing_queue_high)(const void *this_arg);
+   bool is_owned;
+} LDKChainMonitor;
+
+/**
+ * A trait implemented for objects handling events from [`EventsProvider`].
+ *
+ * An async variation also exists for implementations of [`EventsProvider`] that support async
+ * event handling. The async event handler should satisfy the generic bounds: `F:
+ * core::future::Future<Output = Result<(), ReplayEvent>>, H: Fn(Event) -> F`.
+ */
+typedef struct LDKEventHandler {
    /**
-    * Gets the node feature flags which this handler itself supports. All available handlers are
-    * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
-    * which are broadcasted in our [`NodeAnnouncement`] message.
+    * 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.
     */
-   struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
+   void *this_arg;
    /**
-    * Gets the init feature flags which should be sent to the given peer. All available handlers
-    * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
-    * which are sent in our [`Init`] message.
+    * Handles the given [`Event`].
     *
-    * Note that this method is called before [`Self::peer_connected`].
-    */
-   struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
-   /**
-    * Implementation of MessageSendEventsProvider for this object.
+    * See [`EventsProvider`] for details that must be considered when implementing this method.
     */
-   struct LDKMessageSendEventsProvider MessageSendEventsProvider;
+   struct LDKCResult_NoneReplayEventZ (*handle_event)(const void *this_arg, struct LDKEvent event);
    /**
     * Frees any resources associated with this object given its this_arg pointer.
     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
     */
    void (*free)(void *this_arg);
-} LDKRoutingMessageHandler;
+} LDKEventHandler;
 
 /**
- * A handler for received [`OnionMessage`]s and for providing generated ones to send.
+ * A trait indicating an object may generate events.
+ *
+ * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
+ *
+ * Implementations of this trait may also feature an async version of event handling, as shown with
+ * [`ChannelManager::process_pending_events_async`] and
+ * [`ChainMonitor::process_pending_events_async`].
+ *
+ * # Requirements
+ *
+ * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
+ * event since the last invocation.
+ *
+ * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
+ * and replay any unhandled events on startup. An [`Event`] is considered handled when
+ * [`process_pending_events`] returns `Ok(())`, thus handlers MUST fully handle [`Event`]s and
+ * persist any relevant changes to disk *before* returning `Ok(())`. In case of an error (e.g.,
+ * persistence failure) implementors should return `Err(ReplayEvent())`, signalling to the
+ * [`EventsProvider`] to replay unhandled events on the next invocation (generally immediately).
+ * Note that some events might not be replayed, please refer to the documentation for
+ * the individual [`Event`] variants for more detail.
+ *
+ * Further, because an application may crash between an [`Event`] being handled and the
+ * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
+ * effect, [`Event`]s may be replayed.
+ *
+ * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
+ * consult the provider's documentation on the implication of processing events and how a handler
+ * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
+ * [`ChainMonitor::process_pending_events`]).
+ *
+ * (C-not implementable) As there is likely no reason for a user to implement this trait on their
+ * own type(s).
+ *
+ * [`process_pending_events`]: Self::process_pending_events
+ * [`handle_event`]: EventHandler::handle_event
+ * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
+ * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
+ * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
+ * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
  */
-typedef struct LDKOnionMessageHandler {
+typedef struct LDKEventsProvider {
    /**
     * An opaque pointer which is passed to your function implementations as an argument.
     * This has no meaning in the LDK, and can be NULL or any other value.
     */
    void *this_arg;
    /**
-    * Because much of the lightning network does not yet support forwarding onion messages, we
-    * may need to directly connect to a node which will forward a message for us. In such a case,
-    * this method will return the set of nodes which need connection by node_id and the
-    * corresponding socket addresses where they may accept incoming connections.
-    *
-    * Thus, this method should be polled regularly to detect messages await such a direct
-    * connection.
-    */
-   struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ (*get_and_clear_connections_needed)(const void *this_arg);
-   /**
-    * Handle an incoming `onion_message` message from the given peer.
-    */
-   void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
-   /**
-    * Returns the next pending onion message for the peer with the given node id.
+    * Processes any events generated since the last call using the given event handler.
     *
-    * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * See the trait-level documentation for requirements.
     */
-   struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
+   void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
    /**
-    * Called when a connection is established with a peer. Can be used to track which peers
-    * advertise onion message support and are online.
-    *
-    * May return an `Err(())` if the features the peer supports are not sufficient to communicate
-    * with us. Implementors should be somewhat conservative about doing so, however, as other
-    * message handlers may still wish to communicate with this peer.
+    * 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.
     */
-   struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
+   void (*free)(void *this_arg);
+} LDKEventsProvider;
+
+/**
+ * This enum is used to specify which error data to send to peers when failing back an HTLC
+ * using [`ChannelManager::fail_htlc_backwards_with_reason`].
+ *
+ * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
+ */
+typedef enum LDKFailureCode_Tag {
    /**
-    * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
-    * drop and refuse to forward onion messages to this peer.
+    * We had a temporary error processing the payment. Useful if no other error codes fit
+    * and you want to indicate that the payer may want to retry.
     */
-   void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
+   LDKFailureCode_TemporaryNodeFailure,
    /**
-    * Performs actions that should happen roughly every ten seconds after startup. Allows handlers
-    * to drop any buffered onion messages intended for prospective peers.
+    * We have a required feature which was not in this onion. For example, you may require
+    * some additional metadata that was not provided with this payment.
     */
-   void (*timer_tick_occurred)(const void *this_arg);
+   LDKFailureCode_RequiredNodeFeatureMissing,
    /**
-    * Gets the node feature flags which this handler itself supports. All available handlers are
-    * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
-    * which are broadcasted in our [`NodeAnnouncement`] message.
+    * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
+    * the HTLC is too close to the current block height for safe handling.
+    * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
+    * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
     */
-   struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
+   LDKFailureCode_IncorrectOrUnknownPaymentDetails,
    /**
-    * Gets the init feature flags which should be sent to the given peer. All available handlers
-    * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
-    * which are sent in our [`Init`] message.
+    * We failed to process the payload after the onion was decrypted. You may wish to
+    * use this when receiving custom HTLC TLVs with even type numbers that you don't recognize.
     *
-    * Note that this method is called before [`Self::peer_connected`].
+    * If available, the tuple data may include the type number and byte offset in the
+    * decrypted byte stream where the failure occurred.
     */
-   struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
+   LDKFailureCode_InvalidOnionPayload,
    /**
-    * 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.
+    * Must be last for serialization purposes
     */
-   void (*free)(void *this_arg);
-} LDKOnionMessageHandler;
+   LDKFailureCode_Sentinel,
+} LDKFailureCode_Tag;
+
+typedef struct MUST_USE_STRUCT LDKFailureCode {
+   LDKFailureCode_Tag tag;
+   union {
+      struct {
+         struct LDKCOption_C2Tuple_u64u16ZZ invalid_onion_payload;
+      };
+   };
+} LDKFailureCode;
 
 
 
 /**
- * BOLT 4 onion packet including hop data for the next peer.
+ * Chain-related parameters used to construct a new `ChannelManager`.
+ *
+ * Typically, the block-specific parameters are derived from the best block hash for the network,
+ * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
+ * are not needed when deserializing a previously constructed `ChannelManager`.
  */
-typedef struct MUST_USE_STRUCT LDKTrampolineOnionPacket {
+typedef struct MUST_USE_STRUCT LDKChainParameters {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeTrampolineOnionPacket *inner;
+   LDKnativeChainParameters *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKTrampolineOnionPacket;
+} LDKChainParameters;
 
 /**
- * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
- * decoders.
+ * A trait indicating an object may generate message send events
  */
-typedef struct LDKCustomMessageReader {
+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;
    /**
-    * 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.
+    * Gets the list of pending events which were generated by previous actions, clearing the list
+    * in the process.
     */
-   struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
+   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);
-} LDKCustomMessageReader;
+} LDKMessageSendEventsProvider;
 
 /**
- * A handler provided to [`PeerManager`] for reading and handling custom messages.
- *
- * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
- * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
- * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
+ * A trait to describe an object which can receive channel messages.
  *
- * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
- * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
+ * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
+ * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
  */
-typedef struct LDKCustomMessageHandler {
+typedef struct LDKChannelMessageHandler {
    /**
     * An opaque pointer which is passed to your function implementations as an argument.
     * This has no meaning in the LDK, and can be NULL or any other value.
     */
    void *this_arg;
    /**
-    * Handles the given message sent from `sender_node_id`, possibly producing messages for
-    * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
-    * to send.
+    * Handle an incoming `open_channel` message from the given peer.
     */
-   struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
+   void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
    /**
-    * Returns the list of pending messages that were generated by the handler, clearing the list
-    * in the process. Each message is paired with the node id of the intended recipient. If no
-    * connection to the node exists, then the message is simply not sent.
+    * Handle an incoming `open_channel2` message from the given peer.
     */
-   struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
+   void (*handle_open_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg);
    /**
-    * Gets the node feature flags which this handler itself supports. All available handlers are
-    * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
-    * which are broadcasted in our [`NodeAnnouncement`] message.
-    *
-    * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement
+    * Handle an incoming `accept_channel` message from the given peer.
     */
-   struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
+   void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
    /**
-    * Gets the init feature flags which should be sent to the given peer. All available handlers
-    * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
-    * which are sent in our [`Init`] message.
-    *
-    * [`Init`]: crate::ln::msgs::Init
+    * Handle an incoming `accept_channel2` message from the given peer.
     */
-   struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
+   void (*handle_accept_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg);
    /**
-    * Implementation of CustomMessageReader for this object.
+    * Handle an incoming `funding_created` message from the given peer.
     */
-   struct LDKCustomMessageReader CustomMessageReader;
+   void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
    /**
-    * 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.
+    * Handle an incoming `funding_signed` message from the given peer.
     */
-   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 {
+   void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
    /**
-    * 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.
+    * Handle an incoming `channel_ready` message from the given peer.
     */
-   LDKnativeIgnoringMessageHandler *inner;
+   void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
    /**
-    * 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.
+    * Handle an incoming `shutdown` message from the given peer.
     */
-   bool is_owned;
-} LDKIgnoringMessageHandler;
-
-/**
- * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
- * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
- * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
- * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
- * message types.
- *
- * See [`OnionMessenger`] for example usage.
- *
- * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
- * [`CustomMessage`]: Self::CustomMessage
- */
-typedef struct LDKCustomOnionMessageHandler {
+   void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
    /**
-    * 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.
+    * Handle an incoming `closing_signed` message from the given peer.
     */
-   void *this_arg;
+   void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
    /**
-    * Called with the custom message that was received, returning a response to send, if any.
-    *
-    * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
+    * Handle an incoming `stfu` message from the given peer.
     */
-   struct LDKCOption_OnionMessageContentsZ (*handle_custom_message)(const void *this_arg, struct LDKOnionMessageContents msg);
+   void (*handle_stfu)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKStfu *NONNULL_PTR msg);
    /**
-    * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
-    * message type is unknown.
+    * Handle an incoming `tx_add_input message` from the given peer.
     */
-   struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
+   void (*handle_tx_add_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg);
    /**
-    * Releases any [`Self::CustomMessage`]s that need to be sent.
-    *
-    * Typically, this is used for messages initiating a message flow rather than in response to
-    * another message. The latter should use the return value of [`Self::handle_custom_message`].
+    * Handle an incoming `tx_add_output` message from the given peer.
     */
-   struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ (*release_pending_custom_messages)(const void *this_arg);
+   void (*handle_tx_add_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg);
    /**
-    * 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.
+    * Handle an incoming `tx_remove_input` message from the given peer.
     */
-   void (*free)(void *this_arg);
-} LDKCustomOnionMessageHandler;
-
-
-
-/**
- * A dummy struct which implements `ChannelMessageHandler` without having any channels.
- * You can provide one of these as the route_handler in a MessageHandler.
- */
-typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
+   void (*handle_tx_remove_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg);
    /**
-    * 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.
+    * Handle an incoming `tx_remove_output` message from the given peer.
     */
-   LDKnativeErroringMessageHandler *inner;
+   void (*handle_tx_remove_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg);
    /**
-    * 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.
+    * Handle an incoming `tx_complete message` from the given peer.
     */
-   bool is_owned;
-} LDKErroringMessageHandler;
-
-
-
-/**
- * Provides references to trait impls which handle different types of messages.
- */
-typedef struct MUST_USE_STRUCT LDKMessageHandler {
+   void (*handle_tx_complete)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg);
    /**
-    * 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.
+    * Handle an incoming `tx_signatures` message from the given peer.
     */
-   LDKnativeMessageHandler *inner;
+   void (*handle_tx_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg);
    /**
-    * 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.
+    * Handle an incoming `tx_init_rbf` message from the given peer.
     */
-   bool is_owned;
-} LDKMessageHandler;
-
-/**
- * Provides an object which can be used to send data to and which uniquely identifies a connection
- * to a remote host. You will need to be able to generate multiple of these which meet Eq and
- * implement Hash to meet the PeerManager API.
- *
- * For efficiency, [`Clone`] should be relatively cheap for this type.
- *
- * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
- * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
- * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
- * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
- * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
- * to simply use another value which is guaranteed to be globally unique instead.
+   void (*handle_tx_init_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg);
+   /**
+    * Handle an incoming `tx_ack_rbf` message from the given peer.
+    */
+   void (*handle_tx_ack_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg);
+   /**
+    * Handle an incoming `tx_abort message` from the given peer.
+    */
+   void (*handle_tx_abort)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg);
+   /**
+    * Handle an incoming `update_add_htlc` message from the given peer.
+    */
+   void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
+   /**
+    * Handle an incoming `update_fulfill_htlc` message from the given peer.
+    */
+   void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
+   /**
+    * Handle an incoming `update_fail_htlc` message from the given peer.
+    */
+   void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
+   /**
+    * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
+    */
+   void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
+   /**
+    * Handle an incoming `commitment_signed` message from the given peer.
+    */
+   void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
+   /**
+    * Handle an incoming `revoke_and_ack` message from the given peer.
+    */
+   void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
+   /**
+    * Handle an incoming `update_fee` message from the given peer.
+    */
+   void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
+   /**
+    * Handle an incoming `announcement_signatures` message from the given peer.
+    */
+   void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
+   /**
+    * Indicates a connection to the peer failed/an existing connection was lost.
+    */
+   void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
+   /**
+    * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
+    *
+    * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+    * with us. Implementors should be somewhat conservative about doing so, however, as other
+    * message handlers may still wish to communicate with this peer.
+    */
+   struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
+   /**
+    * Handle an incoming `channel_reestablish` message from the given peer.
+    */
+   void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
+   /**
+    * Handle an incoming `channel_update` message from the given peer.
+    */
+   void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
+   /**
+    * Handle an incoming `error` message from the given peer.
+    */
+   void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
+   /**
+    * Gets the node feature flags which this handler itself supports. All available handlers are
+    * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
+    * which are broadcasted in our [`NodeAnnouncement`] message.
+    */
+   struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
+   /**
+    * Gets the init feature flags which should be sent to the given peer. All available handlers
+    * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
+    * which are sent in our [`Init`] message.
+    *
+    * Note that this method is called before [`Self::peer_connected`].
+    */
+   struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
+   /**
+    * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports.
+    *
+    * If it's `None`, then no particular network chain hash compatibility will be enforced when
+    * connecting to peers.
+    */
+   struct LDKCOption_CVec_ThirtyTwoBytesZZ (*get_chain_hashes)(const void *this_arg);
+   /**
+    * Implementation of MessageSendEventsProvider for this object.
+    */
+   struct LDKMessageSendEventsProvider MessageSendEventsProvider;
+   /**
+    * Frees any resources associated with this object given its this_arg pointer.
+    * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+    */
+   void (*free)(void *this_arg);
+} LDKChannelMessageHandler;
+
+/**
+ * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload.
+ *
+ * [`OnionMessage`]: crate::ln::msgs::OnionMessage
  */
-typedef struct LDKSocketDescriptor {
+typedef struct LDKOffersMessageHandler {
    /**
     * An opaque pointer which is passed to your function implementations as an argument.
     * This has no meaning in the LDK, and can be NULL or any other value.
     */
    void *this_arg;
    /**
-    * Attempts to send some data from the given slice to the peer.
+    * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment,
+    * or replying with an error.
     *
-    * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
-    * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
-    * called and further write attempts may occur until that time.
+    * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
     *
-    * 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.
+    * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
     *
-    * 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.
+    * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
+   struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ (*handle_message)(const void *this_arg, struct LDKOffersMessage message, struct LDKCOption_OffersContextZ context, struct LDKResponder responder);
    /**
-    * Disconnect the socket pointed to by this SocketDescriptor.
+    * Releases any [`OffersMessage`]s that need to be sent.
     *
-    * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
-    * call (doing so is a noop).
+    * Typically, this is used for messages initiating a payment flow rather than in response to
+    * another message. The latter should use the return value of [`Self::handle_message`].
     */
-   void (*disconnect_socket)(void *this_arg);
+   struct LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ (*release_pending_messages)(const void *this_arg);
    /**
-    * Checks if two objects are equal given this object's this_arg pointer and another object.
+    * 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.
     */
-   bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
+   void (*free)(void *this_arg);
+} LDKOffersMessageHandler;
+
+/**
+ * A handler for an [`OnionMessage`] containing an async payments message as its payload.
+ *
+ * [`OnionMessage`]: crate::ln::msgs::OnionMessage
+ */
+typedef struct LDKAsyncPaymentsMessageHandler {
    /**
-    * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
-    * This is used, for example, for inclusion of this object in a hash map.
+    * 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.
     */
-   uint64_t (*hash)(const void *this_arg);
+   void *this_arg;
    /**
-    * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
-    * The new SocketDescriptor is provided, and should be mutated as needed to perform a
-    * deep copy of the object pointed to by this_arg or avoid any double-freeing.
+    * Handle a [`HeldHtlcAvailable`] message. A [`ReleaseHeldHtlc`] should be returned to release
+    * the held funds.
+    *
+    * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
+   struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ (*held_htlc_available)(const void *this_arg, struct LDKHeldHtlcAvailable message, struct LDKResponder responder);
+   /**
+    * Handle a [`ReleaseHeldHtlc`] message. If authentication of the message succeeds, an HTLC
+    * should be released to the corresponding payee.
+    */
+   void (*release_held_htlc)(const void *this_arg, struct LDKReleaseHeldHtlc message);
+   /**
+    * Release any [`AsyncPaymentsMessage`]s that need to be sent.
+    *
+    * Typically, this is used for messages initiating an async payment flow rather than in response
+    * to another message.
+    */
+   struct LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ (*release_pending_messages)(const void *this_arg);
    /**
     * Frees any resources associated with this object given its this_arg pointer.
     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
     */
    void (*free)(void *this_arg);
-} LDKSocketDescriptor;
+} LDKAsyncPaymentsMessageHandler;
+
+/**
+ * An interface for looking up the node id of a channel counterparty for the purpose of forwarding
+ * an [`OnionMessage`].
+ *
+ * [`OnionMessage`]: crate::ln::msgs::OnionMessage
+ */
+typedef struct LDKNodeIdLookUp {
+   /**
+    * An opaque pointer which is passed to your function implementations as an argument.
+    * This has no meaning in the LDK, and can be NULL or any other value.
+    */
+   void *this_arg;
+   /**
+    * Returns the node id of the forwarding node's channel counterparty with `short_channel_id`.
+    *
+    * Here, the forwarding node is referring to the node of the [`OnionMessenger`] parameterized
+    * by the [`NodeIdLookUp`] and the counterparty to one of that node's peers.
+    *
+    * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
+    *
+    * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+    */
+   struct LDKPublicKey (*next_node_id)(const void *this_arg, uint64_t short_channel_id);
+   /**
+    * Frees any resources associated with this object given its this_arg pointer.
+    * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+    */
+   void (*free)(void *this_arg);
+} LDKNodeIdLookUp;
 
 
 
 /**
- * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
- * socket events into messages which it passes on to its [`MessageHandler`].
+ * Arguments for the creation of a ChannelManager that are not deserialized.
  *
- * Locks are taken internally, so you must never assume that reentrancy from a
- * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
+ * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
+ * is:
+ * 1) Deserialize all stored [`ChannelMonitor`]s.
+ * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
+ *    `<(BlockHash, ChannelManager)>::read(reader, args)`
+ *    This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
+ *    [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
+ * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
+ *    same way you would handle a [`chain::Filter`] call using
+ *    [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
+ * 4) Reconnect blocks on your [`ChannelMonitor`]s.
+ * 5) Disconnect/connect blocks on the [`ChannelManager`].
+ * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
+ *    Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
+ *    will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
+ *    the next step.
+ * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
+ *    [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
  *
- * 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.
+ * 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`].
  *
- * 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.
+ * Note that because some channels may be closed during deserialization, it is critical that you
+ * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
+ * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
+ * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
+ * not force-close the same channels but consider them live), you may end up revoking a state for
+ * which you've already broadcasted the transaction.
  *
- * [`read_event`]: PeerManager::read_event
+ * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
  */
-typedef struct MUST_USE_STRUCT LDKPeerManager {
+typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativePeerManager *inner;
+   LDKnativeChannelManagerReadArgs *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKPeerManager;
+} LDKChannelManagerReadArgs;
 
 
 
 /**
- * Static channel fields used to build transactions given per-commitment fields, organized by
- * broadcaster/countersignatory.
+ * A set of keys that were HKDF-expanded from an initial call to
+ * [`NodeSigner::get_inbound_payment_key_material`].
  *
- * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
- * as_holder_broadcastable and as_counterparty_broadcastable functions.
+ * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
  */
-typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
+typedef struct MUST_USE_STRUCT LDKExpandedKey {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeDirectedChannelTransactionParameters *inner;
+   LDKnativeExpandedKey *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKDirectedChannelTransactionParameters;
+} LDKExpandedKey;
 
 
 
 /**
- * Features used within an `offer`.
+ * Contains fields that are both common to [`open_channel`] and `open_channel2` messages.
+ *
+ * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
  */
-typedef struct MUST_USE_STRUCT LDKOfferFeatures {
+typedef struct MUST_USE_STRUCT LDKCommonOpenChannelFields {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeOfferFeatures *inner;
+   LDKnativeCommonOpenChannelFields *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKOfferFeatures;
+} LDKCommonOpenChannelFields;
 
 
 
 /**
- * Features used within an `invoice_request`.
+ * Contains fields that are both common to [`accept_channel`] and `accept_channel2` messages.
+ *
+ * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
  */
-typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
+typedef struct MUST_USE_STRUCT LDKCommonAcceptChannelFields {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeInvoiceRequestFeatures *inner;
+   LDKnativeCommonAcceptChannelFields *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKInvoiceRequestFeatures;
+} LDKCommonAcceptChannelFields;
 
 
 
 /**
- * Builds an [`Offer`] for the \"offer to be paid\" flow.
- *
- * See [module-level documentation] for usage.
- *
- * [module-level documentation]: self
+ * Packet of hop data for next peer
  */
-typedef struct MUST_USE_STRUCT LDKOfferWithExplicitMetadataBuilder {
+typedef struct MUST_USE_STRUCT LDKPacket {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeOfferWithExplicitMetadataBuilder *inner;
+   LDKnativePacket *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKOfferWithExplicitMetadataBuilder;
-
-/**
- * Represents a tweaked X-only public key as required for BIP 340 (Taproot).
- */
-typedef struct LDKTweakedPublicKey {
-   /**
-    * The bytes of the public key X coordinate
-    */
-   uint8_t x_coordinate[32];
-} LDKTweakedPublicKey;
+} LDKPacket;
 
 /**
- * A function for signing an [`UnsignedBolt12Invoice`].
+ * A trait to describe an object which can receive routing messages.
+ *
+ * # Implementor DoS Warnings
+ *
+ * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
+ * handling inbound queries. Implementors using an on-disk network graph should be aware of
+ * repeated disk I/O for queries accessing different parts of the network graph.
  */
-typedef struct LDKSignBolt12InvoiceFn {
+typedef struct LDKRoutingMessageHandler {
    /**
     * An opaque pointer which is passed to your function implementations as an argument.
     * This has no meaning in the LDK, and can be NULL or any other value.
     */
    void *this_arg;
    /**
-    * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
+    * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
+    * `false` or returning an `Err` otherwise.
     */
-   struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR message);
+   struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
+   /**
+    * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
+    * or returning an `Err` otherwise.
+    */
+   struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
+   /**
+    * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
+    * `false` or returning an `Err` otherwise.
+    */
+   struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
+   /**
+    * Gets channel announcements and updates required to dump our routing table to a remote node,
+    * starting at the `short_channel_id` indicated by `starting_point` and including announcements
+    * for a single channel.
+    */
+   struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
+   /**
+    * Gets a node announcement required to dump our routing table to a remote node, starting at
+    * the node *after* the provided pubkey and including up to one announcement immediately
+    * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
+    * If `None` is provided for `starting_point`, we start at the first node.
+    *
+    * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+    */
+   struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
+   /**
+    * Called when a connection is established with a peer. This can be used to
+    * perform routing table synchronization using a strategy defined by the
+    * implementor.
+    *
+    * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+    * with us. Implementors should be somewhat conservative about doing so, however, as other
+    * message handlers may still wish to communicate with this peer.
+    */
+   struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
+   /**
+    * Handles the reply of a query we initiated to learn about channels
+    * for a given range of blocks. We can expect to receive one or more
+    * replies to a single query.
+    */
+   struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
+   /**
+    * Handles the reply of a query we initiated asking for routing gossip
+    * messages for a list of channels. We should receive this message when
+    * a node has completed its best effort to send us the pertaining routing
+    * gossip messages.
+    */
+   struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
+   /**
+    * Handles when a peer asks us to send a list of `short_channel_id`s
+    * for the requested range of blocks.
+    */
+   struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
+   /**
+    * Handles when a peer asks us to send routing gossip messages for a
+    * list of `short_channel_id`s.
+    */
+   struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
+   /**
+    * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
+    * pending some async action. While there is no guarantee of the rate of future messages, the
+    * caller should seek to reduce the rate of new gossip messages handled, especially
+    * [`ChannelAnnouncement`]s.
+    */
+   bool (*processing_queue_high)(const void *this_arg);
+   /**
+    * Gets the node feature flags which this handler itself supports. All available handlers are
+    * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
+    * which are broadcasted in our [`NodeAnnouncement`] message.
+    */
+   struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
+   /**
+    * Gets the init feature flags which should be sent to the given peer. All available handlers
+    * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
+    * which are sent in our [`Init`] message.
+    *
+    * Note that this method is called before [`Self::peer_connected`].
+    */
+   struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
+   /**
+    * Implementation of MessageSendEventsProvider for this object.
+    */
+   struct LDKMessageSendEventsProvider MessageSendEventsProvider;
    /**
     * Frees any resources associated with this object given its this_arg pointer.
     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
     */
    void (*free)(void *this_arg);
-} LDKSignBolt12InvoiceFn;
-
-
+} LDKRoutingMessageHandler;
 
 /**
- * A hash for use in a specific context by tweaking with a context-dependent tag as per [BIP 340]
- * and computed over the merkle root of a TLV stream to sign as defined in [BOLT 12].
- *
- * [BIP 340]: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
- * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md#signature-calculation
+ * A handler for received [`OnionMessage`]s and for providing generated ones to send.
  */
-typedef struct MUST_USE_STRUCT LDKTaggedHash {
+typedef struct LDKOnionMessageHandler {
    /**
-    * 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.
     */
-   LDKnativeTaggedHash *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.
+    * Handle an incoming `onion_message` message from the given peer.
     */
-   bool is_owned;
-} LDKTaggedHash;
+   void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
+   /**
+    * Returns the next pending onion message for the peer with the given node id.
+    *
+    * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+    */
+   struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
+   /**
+    * Called when a connection is established with a peer. Can be used to track which peers
+    * advertise onion message support and are online.
+    *
+    * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+    * with us. Implementors should be somewhat conservative about doing so, however, as other
+    * message handlers may still wish to communicate with this peer.
+    */
+   struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
+   /**
+    * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
+    * drop and refuse to forward onion messages to this peer.
+    */
+   void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
+   /**
+    * Performs actions that should happen roughly every ten seconds after startup. Allows handlers
+    * to drop any buffered onion messages intended for prospective peers.
+    */
+   void (*timer_tick_occurred)(const void *this_arg);
+   /**
+    * Gets the node feature flags which this handler itself supports. All available handlers are
+    * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
+    * which are broadcasted in our [`NodeAnnouncement`] message.
+    */
+   struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
+   /**
+    * Gets the init feature flags which should be sent to the given peer. All available handlers
+    * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
+    * which are sent in our [`Init`] message.
+    *
+    * Note that this method is called before [`Self::peer_connected`].
+    */
+   struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
+   /**
+    * Frees any resources associated with this object given its this_arg pointer.
+    * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+    */
+   void (*free)(void *this_arg);
+} LDKOnionMessageHandler;
 
 
 
 /**
- * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
- *
- * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * BOLT 4 onion packet including hop data for the next peer.
  */
-typedef struct MUST_USE_STRUCT LDKErroneousField {
+typedef struct MUST_USE_STRUCT LDKTrampolineOnionPacket {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeErroneousField *inner;
+   LDKnativeTrampolineOnionPacket *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKErroneousField;
+} LDKTrampolineOnionPacket;
 
 /**
- * A function for signing an [`UnsignedInvoiceRequest`].
+ * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
+ * decoders.
  */
-typedef struct LDKSignInvoiceRequestFn {
+typedef struct LDKCustomMessageReader {
    /**
     * An opaque pointer which is passed to your function implementations as an argument.
     * This has no meaning in the LDK, and can be NULL or any other value.
     */
    void *this_arg;
    /**
-    * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
+    * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
+    * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
+    * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
+    * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
     */
-   struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR message);
+   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);
-} LDKSignInvoiceRequestFn;
+} LDKCustomMessageReader;
 
 /**
- * Error when signing messages.
+ * A handler provided to [`PeerManager`] for reading and handling custom messages.
+ *
+ * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
+ * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
+ * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
+ *
+ * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
+ * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
  */
-typedef enum LDKSignError_Tag {
+typedef struct LDKCustomMessageHandler {
    /**
-    * User-defined error when signing the message.
+    * 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.
     */
-   LDKSignError_Signing,
+   void *this_arg;
    /**
-    * Error when verifying the produced signature using the given pubkey.
+    * Handles the given message sent from `sender_node_id`, possibly producing messages for
+    * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
+    * to send.
     */
-   LDKSignError_Verification,
+   struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
    /**
-    * Must be last for serialization purposes
+    * Returns the list of pending messages that were generated by the handler, clearing the list
+    * in the process. Each message is paired with the node id of the intended recipient. If no
+    * connection to the node exists, then the message is simply not sent.
     */
-   LDKSignError_Sentinel,
-} LDKSignError_Tag;
-
-typedef struct MUST_USE_STRUCT LDKSignError {
-   LDKSignError_Tag tag;
-   union {
-      struct {
-         enum LDKSecp256k1Error verification;
-      };
-   };
-} LDKSignError;
+   struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
+   /**
+    * Indicates a peer disconnected.
+    */
+   void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
+   /**
+    * Handle a peer connecting.
+    *
+    * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+    * with us. Implementors should be somewhat conservative about doing so, however, as other
+    * message handlers may still wish to communicate with this peer.
+    */
+   struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
+   /**
+    * Gets the node feature flags which this handler itself supports. All available handlers are
+    * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
+    * which are broadcasted in our [`NodeAnnouncement`] message.
+    *
+    * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement
+    */
+   struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
+   /**
+    * Gets the init feature flags which should be sent to the given peer. All available handlers
+    * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
+    * which are sent in our [`Init`] message.
+    *
+    * [`Init`]: crate::ln::msgs::Init
+    */
+   struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
+   /**
+    * Implementation of CustomMessageReader for this object.
+    */
+   struct LDKCustomMessageReader CustomMessageReader;
+   /**
+    * Frees any resources associated with this object given its this_arg pointer.
+    * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+    */
+   void (*free)(void *this_arg);
+} LDKCustomMessageHandler;
 
 
 
 /**
- * Receives and validates network updates from peers,
- * stores authentic and relevant data as a network graph.
- * This network graph is then used for routing payments.
- * Provides interface to help with initial routing sync by
- * serving historical announcements.
+ * 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 LDKP2PGossipSync {
+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.
     */
-   LDKnativeP2PGossipSync *inner;
+   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;
-} LDKP2PGossipSync;
+} LDKIgnoringMessageHandler;
+
+/**
+ * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
+ * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
+ * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
+ * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
+ * message types.
+ *
+ * See [`OnionMessenger`] for example usage.
+ *
+ * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
+ * [`CustomMessage`]: Self::CustomMessage
+ */
+typedef struct LDKCustomOnionMessageHandler {
+   /**
+    * An opaque pointer which is passed to your function implementations as an argument.
+    * This has no meaning in the LDK, and can be NULL or any other value.
+    */
+   void *this_arg;
+   /**
+    * Called with the custom message that was received, returning a response to send, if any.
+    *
+    * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
+    *
+    * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None
+    */
+   struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ (*handle_custom_message)(const void *this_arg, struct LDKOnionMessageContents message, struct LDKCOption_CVec_u8ZZ context, struct LDKResponder responder);
+   /**
+    * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
+    * message type is unknown.
+    */
+   struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
+   /**
+    * Releases any [`Self::CustomMessage`]s that need to be sent.
+    *
+    * Typically, this is used for messages initiating a message flow rather than in response to
+    * another message. The latter should use the return value of [`Self::handle_custom_message`].
+    */
+   struct LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ (*release_pending_custom_messages)(const void *this_arg);
+   /**
+    * Frees any resources associated with this object given its this_arg pointer.
+    * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+    */
+   void (*free)(void *this_arg);
+} LDKCustomOnionMessageHandler;
 
 
 
 /**
- * A read-only view of [`NetworkGraph`].
+ * A dummy struct which implements `ChannelMessageHandler` without having any channels.
+ * You can provide one of these as the route_handler in a MessageHandler.
  */
-typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
+typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeReadOnlyNetworkGraph *inner;
+   LDKnativeErroringMessageHandler *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKReadOnlyNetworkGraph;
+} LDKErroringMessageHandler;
 
 
 
 /**
- * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
- * source node to a target node.
+ * Provides references to trait impls which handle different types of messages.
  */
-typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
+typedef struct MUST_USE_STRUCT LDKMessageHandler {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeDirectedChannelInfo *inner;
+   LDKnativeMessageHandler *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKDirectedChannelInfo;
+} LDKMessageHandler;
 
 /**
- * The effective capacity of a channel for routing purposes.
+ * Provides an object which can be used to send data to and which uniquely identifies a connection
+ * to a remote host. You will need to be able to generate multiple of these which meet Eq and
+ * implement Hash to meet the PeerManager API.
  *
- * While this may be smaller than the actual channel capacity, amounts greater than
- * [`Self::as_msat`] should not be routed through the channel.
+ * For efficiency, [`Clone`] should be relatively cheap for this type.
+ *
+ * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
+ * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
+ * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
+ * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
+ * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
+ * to simply use another value which is guaranteed to be globally unique instead.
  */
-typedef enum LDKEffectiveCapacity_Tag {
+typedef struct LDKSocketDescriptor {
    /**
-    * The available liquidity in the channel known from being a channel counterparty, and thus a
-    * direct hop.
+    * 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.
     */
-   LDKEffectiveCapacity_ExactLiquidity,
+   void *this_arg;
    /**
-    * The maximum HTLC amount in one direction as advertised on the gossip network.
+    * Attempts to send some data from the given slice to the peer.
+    *
+    * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
+    * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
+    * called and further write attempts may occur until that time.
+    *
+    * If the returned size is smaller than `data.len()`, a
+    * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
+    * written. Additionally, until a `send_data` event completes fully, no further
+    * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
+    * prevent denial-of-service issues, you should not read or buffer any data from the socket
+    * until then.
+    *
+    * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
+    * (indicating that read events should be paused to prevent DoS in the send buffer),
+    * `resume_read` may be set indicating that read events on this descriptor should resume. A
+    * `resume_read` of false carries no meaning, and should not cause any action.
     */
-   LDKEffectiveCapacity_AdvertisedMaxHTLC,
+   uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
    /**
-    * The total capacity of the channel as determined by the funding transaction.
+    * 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).
     */
-   LDKEffectiveCapacity_Total,
+   void (*disconnect_socket)(void *this_arg);
    /**
-    * A capacity sufficient to route any payment, typically used for private channels provided by
-    * an invoice.
+    * Checks if two objects are equal given this object's this_arg pointer and another object.
     */
-   LDKEffectiveCapacity_Infinite,
+   bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
    /**
-    * The maximum HTLC amount as provided by an invoice route hint.
+    * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
+    * This is used, for example, for inclusion of this object in a hash map.
     */
-   LDKEffectiveCapacity_HintMaxHTLC,
+   uint64_t (*hash)(const void *this_arg);
    /**
-    * A capacity that is unknown possibly because either the chain state is unavailable to know
-    * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
+    * 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.
     */
-   LDKEffectiveCapacity_Unknown,
+   void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
    /**
-    * Must be last for serialization purposes
+    * 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.
     */
-   LDKEffectiveCapacity_Sentinel,
-} LDKEffectiveCapacity_Tag;
+   void (*free)(void *this_arg);
+} LDKSocketDescriptor;
 
-typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
-   /**
-    * Either the inbound or outbound liquidity depending on the direction, denominated in
-    * millisatoshi.
-    */
-   uint64_t liquidity_msat;
-} LDKEffectiveCapacity_LDKExactLiquidity_Body;
 
-typedef struct LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body {
-   /**
-    * The maximum HTLC amount denominated in millisatoshi.
-    */
-   uint64_t amount_msat;
-} LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body;
 
-typedef struct LDKEffectiveCapacity_LDKTotal_Body {
+/**
+ * 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 {
    /**
-    * The funding amount denominated in millisatoshi.
+    * 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.
     */
-   uint64_t capacity_msat;
+   LDKnativePeerManager *inner;
    /**
-    * The maximum HTLC amount denominated in millisatoshi.
+    * 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.
     */
-   uint64_t htlc_maximum_msat;
-} LDKEffectiveCapacity_LDKTotal_Body;
+   bool is_owned;
+} LDKPeerManager;
 
-typedef struct LDKEffectiveCapacity_LDKHintMaxHTLC_Body {
+/**
+ * Represents a valid secp256k1 secret key serialized as a 32 byte array.
+ */
+typedef struct LDKSecretKey {
    /**
-    * The maximum HTLC amount denominated in millisatoshi.
+    * The bytes of the secret key
     */
-   uint64_t amount_msat;
-} LDKEffectiveCapacity_LDKHintMaxHTLC_Body;
-
-typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
-   LDKEffectiveCapacity_Tag tag;
-   union {
-      LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
-      LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body advertised_max_htlc;
-      LDKEffectiveCapacity_LDKTotal_Body total;
-      LDKEffectiveCapacity_LDKHintMaxHTLC_Body hint_max_htlc;
-   };
-} LDKEffectiveCapacity;
+   uint8_t bytes[32];
+} LDKSecretKey;
 
 
 
 /**
- * A [`Router`] implemented using [`find_route`].
+ * Static channel fields used to build transactions given per-commitment fields, organized by
+ * broadcaster/countersignatory.
+ *
+ * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
+ * as_holder_broadcastable and as_counterparty_broadcastable functions.
  */
-typedef struct MUST_USE_STRUCT LDKDefaultRouter {
+typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeDefaultRouter *inner;
+   LDKnativeDirectedChannelTransactionParameters *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKDefaultRouter;
+} LDKDirectedChannelTransactionParameters;
 
 
 
 /**
- * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
- *
- * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
- * [`find_route`].
- *
- * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
+ * SHA-256 hash
  */
-typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
+typedef struct MUST_USE_STRUCT LDKSha256 {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeScorerAccountingForInFlightHtlcs *inner;
+   LDKnativeSha256 *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKScorerAccountingForInFlightHtlcs;
+} LDKSha256;
 
 /**
- * The recipient of a payment, differing based on whether they've hidden their identity with route
- * blinding.
+ * An error when attempting to pay a [`Bolt12Invoice`].
  */
-typedef enum LDKPayee_Tag {
-   /**
-    * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
-    * will be included in the final [`Route`].
-    */
-   LDKPayee_Blinded,
-   /**
-    * The recipient included these route hints in their BOLT11 invoice.
-    */
-   LDKPayee_Clear,
-   /**
-    * Must be last for serialization purposes
-    */
-   LDKPayee_Sentinel,
-} LDKPayee_Tag;
-
-typedef struct LDKPayee_LDKBlinded_Body {
-   /**
-    * Aggregated routing info and blinded paths, for routing to the payee without knowing their
-    * node id.
-    */
-   struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints;
+typedef enum LDKBolt12PaymentError_Tag {
    /**
-    * Features supported by the payee.
-    *
-    * May be set from the payee's invoice. May be `None` if the invoice does not contain any
-    * features.
-    *
-    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * The invoice was not requested.
     */
-   struct LDKBolt12InvoiceFeatures features;
-} LDKPayee_LDKBlinded_Body;
-
-typedef struct LDKPayee_LDKClear_Body {
+   LDKBolt12PaymentError_UnexpectedInvoice,
    /**
-    * The node id of the payee.
+    * Payment for an invoice with the corresponding [`PaymentId`] was already initiated.
     */
-   struct LDKPublicKey node_id;
+   LDKBolt12PaymentError_DuplicateInvoice,
    /**
-    * Hints for routing to the payee, containing channels connecting the payee to public nodes.
+    * The invoice was valid for the corresponding [`PaymentId`], but required unknown features.
     */
-   struct LDKCVec_RouteHintZ route_hints;
+   LDKBolt12PaymentError_UnknownRequiredFeatures,
    /**
-    * Features supported by the payee.
-    *
-    * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
-    * does not contain any features.
-    *
-    * [`for_keysend`]: PaymentParameters::for_keysend
-    *
-    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    * The invoice was valid for the corresponding [`PaymentId`], but sending the payment failed.
     */
-   struct LDKBolt11InvoiceFeatures features;
+   LDKBolt12PaymentError_SendingFailed,
    /**
-    * The minimum CLTV delta at the end of the route. This value must not be zero.
+    * Must be last for serialization purposes
     */
-   uint32_t final_cltv_expiry_delta;
-} LDKPayee_LDKClear_Body;
+   LDKBolt12PaymentError_Sentinel,
+} LDKBolt12PaymentError_Tag;
 
-typedef struct MUST_USE_STRUCT LDKPayee {
-   LDKPayee_Tag tag;
+typedef struct MUST_USE_STRUCT LDKBolt12PaymentError {
+   LDKBolt12PaymentError_Tag tag;
    union {
-      LDKPayee_LDKBlinded_Body blinded;
-      LDKPayee_LDKClear_Body clear;
+      struct {
+         enum LDKRetryableSendFailure sending_failed;
+      };
    };
-} LDKPayee;
-
-/**
- * A trait which can both lookup and update routing channel penalty scores.
- *
- * This is used in places where both bounds are required and implemented for all types which
- * implement [`ScoreLookUp`] and [`ScoreUpdate`].
- *
- * Bindings users may need to manually implement this for their custom scoring implementations.
- */
-typedef struct LDKScore {
-   /**
-    * An opaque pointer which is passed to your function implementations as an argument.
-    * This has no meaning in the LDK, and can be NULL or any other value.
-    */
-   void *this_arg;
-   /**
-    * Implementation of ScoreLookUp for this object.
-    */
-   struct LDKScoreLookUp ScoreLookUp;
-   /**
-    * Implementation of ScoreUpdate for this object.
-    */
-   struct LDKScoreUpdate ScoreUpdate;
-   /**
-    * Serialize the object into a byte array
-    */
-   struct LDKCVec_u8Z (*write)(const void *this_arg);
-   /**
-    * Frees any resources associated with this object given its this_arg pointer.
-    * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
-    */
-   void (*free)(void *this_arg);
-} LDKScore;
+} LDKBolt12PaymentError;
 
 
 
 /**
- * A concrete implementation of [`LockableScore`] which supports multi-threading.
+ * Builds an [`Offer`] for the \"offer to be paid\" flow.
+ *
+ * See [module-level documentation] for usage.
+ *
+ * [module-level documentation]: self
  */
-typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
+typedef struct MUST_USE_STRUCT LDKOfferWithExplicitMetadataBuilder {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeMultiThreadedLockableScore *inner;
+   LDKnativeOfferWithExplicitMetadataBuilder *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKMultiThreadedLockableScore;
+} LDKOfferWithExplicitMetadataBuilder;
 
 
 
 /**
- * A locked `MultiThreadedLockableScore`.
+ * A string that displays only printable characters, replacing control characters with
+ * [`core::char::REPLACEMENT_CHARACTER`].
  */
-typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockRead {
+typedef struct MUST_USE_STRUCT LDKPrintableString {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeMultiThreadedScoreLockRead *inner;
+   LDKnativePrintableString *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKMultiThreadedScoreLockRead;
+} LDKPrintableString;
 
 
 
 /**
- * A locked `MultiThreadedLockableScore`.
+ * Features used within an `offer`.
  */
-typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockWrite {
+typedef struct MUST_USE_STRUCT LDKOfferFeatures {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeMultiThreadedScoreLockWrite *inner;
+   LDKnativeOfferFeatures *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKMultiThreadedScoreLockWrite;
-
+} LDKOfferFeatures;
 
+/**
+ * Represents a tweaked X-only public key as required for BIP 340 (Taproot).
+ */
+typedef struct LDKTweakedPublicKey {
+   /**
+    * The bytes of the public key X coordinate
+    */
+   uint8_t x_coordinate[32];
+} LDKTweakedPublicKey;
 
 /**
- * Parameters for configuring [`ProbabilisticScorer`].
- *
- * Used to configure decay parameters that are static throughout the lifetime of the scorer.
- * these decay parameters affect the score of the channel penalty and are not changed on a
- * per-route penalty cost call.
+ * A function for signing an [`UnsignedBolt12Invoice`].
  */
-typedef struct MUST_USE_STRUCT LDKProbabilisticScoringDecayParameters {
+typedef struct LDKSignBolt12InvoiceFn {
    /**
-    * 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.
     */
-   LDKnativeProbabilisticScoringDecayParameters *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.
+    * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
     */
-   bool is_owned;
-} LDKProbabilisticScoringDecayParameters;
+   struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR message);
+   /**
+    * Frees any resources associated with this object given its this_arg pointer.
+    * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+    */
+   void (*free)(void *this_arg);
+} LDKSignBolt12InvoiceFn;
 
 
 
 /**
- * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
- * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
- *
- * Your `node_id` is seed/0'.
- * Unilateral closes may use seed/1'.
- * Cooperative closes may use seed/2'.
- * The two close keys may be needed to claim on-chain funds!
- *
- * This struct cannot be used for nodes that wish to support receiving phantom payments;
- * [`PhantomKeysManager`] must be used instead.
+ * A hash for use in a specific context by tweaking with a context-dependent tag as per [BIP 340]
+ * and computed over the merkle root of a TLV stream to sign as defined in [BOLT 12].
  *
- * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
- * previously issued invoices and attempts to pay previous invoices will fail.
+ * [BIP 340]: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
+ * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md#signature-calculation
  */
-typedef struct MUST_USE_STRUCT LDKKeysManager {
+typedef struct MUST_USE_STRUCT LDKTaggedHash {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeKeysManager *inner;
+   LDKnativeTaggedHash *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKKeysManager;
+} LDKTaggedHash;
 
 
 
 /**
- * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
- * payments.
- *
- * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
- * paid to one of multiple nodes. This works because we encode the invoice route hints such that
- * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
- * itself without ever needing to forward to this fake node.
- *
- * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
- * provide some fault tolerance, because payers will automatically retry paying other provided
- * nodes in the case that one node goes down.
- *
- * Note that multi-path payments are not supported in phantom invoices for security reasons.
- * Switching between this struct and [`KeysManager`] will invalidate any previously issued
- * invoices and attempts to pay previous invoices will fail.
+ * Features used within an `invoice_request`.
  */
-typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
+typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativePhantomKeysManager *inner;
+   LDKnativeInvoiceRequestFeatures *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKPhantomKeysManager;
+} LDKInvoiceRequestFeatures;
 
 
 
 /**
- * An implementation of [`EntropySource`] using ChaCha20.
+ * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
+ *
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
  */
-typedef struct MUST_USE_STRUCT LDKRandomBytes {
+typedef struct MUST_USE_STRUCT LDKErroneousField {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeRandomBytes *inner;
+   LDKnativeErroneousField *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKRandomBytes;
-
-
+} LDKErroneousField;
 
 /**
- * A sender, receiver and forwarder of [`OnionMessage`]s.
- *
- * # Handling Messages
- *
- * `OnionMessenger` implements [`OnionMessageHandler`], making it responsible for either forwarding
- * messages to peers or delegating to the appropriate handler for the message type. Currently, the
- * available handlers are:
- * * [`OffersMessageHandler`], for responding to [`InvoiceRequest`]s and paying [`Bolt12Invoice`]s
- * * [`CustomOnionMessageHandler`], for handling user-defined message types
- *
- * # Sending Messages
- *
- * [`OnionMessage`]s are sent initially using [`OnionMessenger::send_onion_message`]. When handling
- * a message, the matched handler may return a response message which `OnionMessenger` will send
- * on its behalf.
- *
- * # Example
- *
- * ```
- * # extern crate bitcoin;
- * # use bitcoin::hashes::_export::_core::time::Duration;
- * # use bitcoin::hashes::hex::FromHex;
- * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey, self};
- * # use lightning::blinded_path::{BlindedPath, EmptyNodeIdLookUp};
- * # use lightning::sign::{EntropySource, KeysManager};
- * # use lightning::ln::peer_handler::IgnoringMessageHandler;
- * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath, OnionMessenger};
- * # use lightning::onion_message::packet::OnionMessageContents;
- * # use lightning::util::logger::{Logger, Record};
- * # use lightning::util::ser::{Writeable, Writer};
- * # use lightning::io;
- * # use std::sync::Arc;
- * # struct FakeLogger;
- * # impl Logger for FakeLogger {
- * #     fn log(&self, record: Record) { println!(\"{:?}\" , record); }
- * # }
- * # struct FakeMessageRouter {}
- * # impl MessageRouter for FakeMessageRouter {
- * #     fn find_path(&self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination) -> Result<OnionMessagePath, ()> {
- * #         let secp_ctx = Secp256k1::new();
- * #         let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
- * #         let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
- * #         let hop_node_id2 = hop_node_id1;
- * #         Ok(OnionMessagePath {
- * #             intermediate_nodes: vec![hop_node_id1, hop_node_id2],
- * #             destination,
- * #             first_node_addresses: None,
- * #         })
- * #     }
- * #     fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
- * #         &self, _recipient: PublicKey, _peers: Vec<PublicKey>, _secp_ctx: &Secp256k1<T>
- * #     ) -> Result<Vec<BlindedPath>, ()> {
- * #         unreachable!()
- * #     }
- * # }
- * # let seed = [42u8; 32];
- * # let time = Duration::from_secs(123456);
- * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
- * # let logger = Arc::new(FakeLogger {});
- * # let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
- * # let secp_ctx = Secp256k1::new();
- * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
- * # let (hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1);
- * # let destination_node_id = hop_node_id1;
- * # let node_id_lookup = EmptyNodeIdLookUp {};
- * # let message_router = Arc::new(FakeMessageRouter {});
- * # let custom_message_handler = IgnoringMessageHandler {};
- * # let offers_message_handler = IgnoringMessageHandler {};
- * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
- * // ChannelManager.
- * let onion_messenger = OnionMessenger::new(
- *     &keys_manager, &keys_manager, logger, &node_id_lookup, message_router,
- *     &offers_message_handler, &custom_message_handler
- * );
- *
- * # #[derive(Debug, Clone)]
- * # struct YourCustomMessage {}
- * impl Writeable for YourCustomMessage {
- * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
- * \t\t# Ok(())
- * \t\t// Write your custom onion message to `w`
- * \t}
- * }
- * impl OnionMessageContents for YourCustomMessage {
- * \tfn tlv_type(&self) -> u64 {
- * \t\t# let your_custom_message_type = 42;
- * \t\tyour_custom_message_type
- * \t}
- * }
- * // Send a custom onion message to a node id.
- * let destination = Destination::Node(destination_node_id);
- * let reply_path = None;
- * # let message = YourCustomMessage {};
- * onion_messenger.send_onion_message(message, destination, reply_path);
- *
- * // Create a blinded path to yourself, for someone to send an onion message to.
- * # let your_node_id = hop_node_id1;
- * let hops = [hop_node_id3, hop_node_id4, your_node_id];
- * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap();
- *
- * // Send a custom onion message to a blinded path.
- * let destination = Destination::BlindedPath(blinded_path);
- * let reply_path = None;
- * # let message = YourCustomMessage {};
- * onion_messenger.send_onion_message(message, destination, reply_path);
- * ```
- *
- * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * A function for signing an [`UnsignedInvoiceRequest`].
  */
-typedef struct MUST_USE_STRUCT LDKOnionMessenger {
+typedef struct LDKSignInvoiceRequestFn {
+   /**
+    * An opaque pointer which is passed to your function implementations as an argument.
+    * This has no meaning in the LDK, and can be NULL or any other value.
+    */
+   void *this_arg;
+   /**
+    * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
+    */
+   struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR message);
+   /**
+    * Frees any resources associated with this object given its this_arg pointer.
+    * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+    */
+   void (*free)(void *this_arg);
+} LDKSignInvoiceRequestFn;
+
+/**
+ * Error when signing messages.
+ */
+typedef enum LDKSignError_Tag {
+   /**
+    * User-defined error when signing the message.
+    */
+   LDKSignError_Signing,
+   /**
+    * Error when verifying the produced signature using the given pubkey.
+    */
+   LDKSignError_Verification,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKSignError_Sentinel,
+} LDKSignError_Tag;
+
+typedef struct MUST_USE_STRUCT LDKSignError {
+   LDKSignError_Tag tag;
+   union {
+      struct {
+         enum LDKSecp256k1Error verification;
+      };
+   };
+} LDKSignError;
+
+
+
+/**
+ * Receives and validates network updates from peers,
+ * stores authentic and relevant data as a network graph.
+ * This network graph is then used for routing payments.
+ * Provides interface to help with initial routing sync by
+ * serving historical announcements.
+ */
+typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeOnionMessenger *inner;
+   LDKnativeP2PGossipSync *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKOnionMessenger;
+} LDKP2PGossipSync;
 
 
 
 /**
- * A [`MessageRouter`] that can only route to a directly connected [`Destination`].
+ * A read-only view of [`NetworkGraph`].
  */
-typedef struct MUST_USE_STRUCT LDKDefaultMessageRouter {
+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.
     */
-   LDKnativeDefaultMessageRouter *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;
-} LDKDefaultMessageRouter;
+} LDKReadOnlyNetworkGraph;
+
+
 
 /**
- * The unblinded node in a [`BlindedPath`].
+ * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
+ * source node to a target node.
  */
-typedef enum LDKIntroductionNode_Tag {
+typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
    /**
-    * The node id of the introduction node.
+    * 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.
     */
-   LDKIntroductionNode_NodeId,
+   LDKnativeDirectedChannelInfo *inner;
    /**
-    * The short channel id of the channel leading to the introduction node. The [`Direction`]
-    * identifies which side of the channel is the introduction node.
+    * 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.
     */
-   LDKIntroductionNode_DirectedShortChannelId,
+   bool is_owned;
+} LDKDirectedChannelInfo;
+
+/**
+ * The effective capacity of a channel for routing purposes.
+ *
+ * While this may be smaller than the actual channel capacity, amounts greater than
+ * [`Self::as_msat`] should not be routed through the channel.
+ */
+typedef enum LDKEffectiveCapacity_Tag {
+   /**
+    * The available liquidity in the channel known from being a channel counterparty, and thus a
+    * direct hop.
+    */
+   LDKEffectiveCapacity_ExactLiquidity,
+   /**
+    * The maximum HTLC amount in one direction as advertised on the gossip network.
+    */
+   LDKEffectiveCapacity_AdvertisedMaxHTLC,
+   /**
+    * The total capacity of the channel as determined by the funding transaction.
+    */
+   LDKEffectiveCapacity_Total,
+   /**
+    * A capacity sufficient to route any payment, typically used for private channels provided by
+    * an invoice.
+    */
+   LDKEffectiveCapacity_Infinite,
+   /**
+    * The maximum HTLC amount as provided by an invoice route hint.
+    */
+   LDKEffectiveCapacity_HintMaxHTLC,
+   /**
+    * A capacity that is unknown possibly because either the chain state is unavailable to know
+    * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
+    */
+   LDKEffectiveCapacity_Unknown,
    /**
     * Must be last for serialization purposes
     */
-   LDKIntroductionNode_Sentinel,
-} LDKIntroductionNode_Tag;
+   LDKEffectiveCapacity_Sentinel,
+} LDKEffectiveCapacity_Tag;
 
-typedef struct LDKIntroductionNode_LDKDirectedShortChannelId_Body {
-   enum LDKDirection _0;
-   uint64_t _1;
-} LDKIntroductionNode_LDKDirectedShortChannelId_Body;
+typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
+   /**
+    * Either the inbound or outbound liquidity depending on the direction, denominated in
+    * millisatoshi.
+    */
+   uint64_t liquidity_msat;
+} LDKEffectiveCapacity_LDKExactLiquidity_Body;
 
-typedef struct MUST_USE_STRUCT LDKIntroductionNode {
-   LDKIntroductionNode_Tag tag;
+typedef struct LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body {
+   /**
+    * The maximum HTLC amount denominated in millisatoshi.
+    */
+   uint64_t amount_msat;
+} LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body;
+
+typedef struct LDKEffectiveCapacity_LDKTotal_Body {
+   /**
+    * The funding amount denominated in millisatoshi.
+    */
+   uint64_t capacity_msat;
+   /**
+    * The maximum HTLC amount denominated in millisatoshi.
+    */
+   uint64_t htlc_maximum_msat;
+} LDKEffectiveCapacity_LDKTotal_Body;
+
+typedef struct LDKEffectiveCapacity_LDKHintMaxHTLC_Body {
+   /**
+    * The maximum HTLC amount denominated in millisatoshi.
+    */
+   uint64_t amount_msat;
+} LDKEffectiveCapacity_LDKHintMaxHTLC_Body;
+
+typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
+   LDKEffectiveCapacity_Tag tag;
    union {
-      struct {
-         struct LDKPublicKey node_id;
-      };
-      LDKIntroductionNode_LDKDirectedShortChannelId_Body directed_short_channel_id;
+      LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
+      LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body advertised_max_htlc;
+      LDKEffectiveCapacity_LDKTotal_Body total;
+      LDKEffectiveCapacity_LDKHintMaxHTLC_Body hint_max_htlc;
    };
-} LDKIntroductionNode;
+} LDKEffectiveCapacity;
 
 
 
 /**
- * A [`NodeIdLookUp`] that always returns `None`.
+ * A [`Router`] implemented using [`find_route`].
+ *
+ * # Privacy
+ *
+ * Implements [`MessageRouter`] by delegating to [`DefaultMessageRouter`]. See those docs for
+ * privacy implications.
  */
-typedef struct MUST_USE_STRUCT LDKEmptyNodeIdLookUp {
+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.
     */
-   LDKnativeEmptyNodeIdLookUp *inner;
+   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;
-} LDKEmptyNodeIdLookUp;
+} LDKDefaultRouter;
 
 
 
 /**
- * Data to construct a [`BlindedHop`] for forwarding a payment.
+ * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
+ *
+ * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
+ * [`find_route`].
+ *
+ * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
  */
-typedef struct MUST_USE_STRUCT LDKForwardTlvs {
+typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeForwardTlvs *inner;
+   LDKnativeScorerAccountingForInFlightHtlcs *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKForwardTlvs;
+} LDKScorerAccountingForInFlightHtlcs;
 
 /**
- * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can
- * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC,
- * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`],
- * which can provide a default implementation of this trait when used with [`Wallet`].
+ * The recipient of a payment, differing based on whether they've hidden their identity with route
+ * blinding.
  */
-typedef struct LDKCoinSelectionSource {
+typedef enum LDKPayee_Tag {
    /**
-    * 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.
+    * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
+    * will be included in the final [`Route`].
     */
-   void *this_arg;
+   LDKPayee_Blinded,
    /**
-    * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
-    * available to spend. Implementations are free to pick their coin selection algorithm of
-    * choice, as long as the following requirements are met:
-    *
-    * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction
-    *    throughout coin selection, but must not be returned as part of the result.
-    * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction
-    *    throughout coin selection. In some cases, like when funding an anchor transaction, this
-    *    set is empty. Implementations should ensure they handle this correctly on their end,
-    *    e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be
-    *    provided, in which case a zero-value empty OP_RETURN output can be used instead.
-    * 3. Enough inputs must be selected/contributed for the resulting transaction (including the
-    *    inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`.
+    * The recipient included these route hints in their BOLT11 invoice.
+    */
+   LDKPayee_Clear,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKPayee_Sentinel,
+} LDKPayee_Tag;
+
+typedef struct LDKPayee_LDKBlinded_Body {
+   /**
+    * Aggregated routing info and blinded paths, for routing to the payee without knowing their
+    * node id.
+    */
+   struct LDKCVec_BlindedPaymentPathZ route_hints;
+   /**
+    * Features supported by the payee.
     *
-    * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of
-    * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require
-    * providing the full input weight. Failing to do so may lead to underestimating fee bumps and
-    * delaying block inclusion.
+    * May be set from the payee's invoice. May be `None` if the invoice does not contain any
+    * features.
     *
-    * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they
-    * can be re-used within new fee-bumped iterations of the original claiming transaction,
-    * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a
-    * transaction associated with it, and all of the available UTXOs have already been assigned to
-    * other claims, implementations must be willing to double spend their UTXOs. The choice of
-    * which UTXOs to double spend is left to the implementation, but it must strive to keep the
-    * set of other claims being double spent to a minimum.
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   struct LDKCResult_CoinSelectionNoneZ (*select_confirmed_utxos)(const void *this_arg, struct LDKThirtyTwoBytes claim_id, struct LDKCVec_InputZ must_spend, struct LDKCVec_TxOutZ must_pay_to, uint32_t target_feerate_sat_per_1000_weight);
+   struct LDKBolt12InvoiceFeatures features;
+} LDKPayee_LDKBlinded_Body;
+
+typedef struct LDKPayee_LDKClear_Body {
    /**
-    * Signs and provides the full witness for all inputs within the transaction known to the
-    * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
+    * The node id of the payee.
+    */
+   struct LDKPublicKey node_id;
+   /**
+    * Hints for routing to the payee, containing channels connecting the payee to public nodes.
+    */
+   struct LDKCVec_RouteHintZ route_hints;
+   /**
+    * Features supported by the payee.
     *
-    * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
-    * unsigned transaction and then sign it with your wallet.
+    * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
+    * does not contain any features.
+    *
+    * [`for_keysend`]: PaymentParameters::for_keysend
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
+   struct LDKBolt11InvoiceFeatures features;
    /**
-    * 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.
+    * The minimum CLTV delta at the end of the route. This value must not be zero.
     */
-   void (*free)(void *this_arg);
-} LDKCoinSelectionSource;
+   uint32_t final_cltv_expiry_delta;
+} LDKPayee_LDKClear_Body;
+
+typedef struct MUST_USE_STRUCT LDKPayee {
+   LDKPayee_Tag tag;
+   union {
+      LDKPayee_LDKBlinded_Body blinded;
+      LDKPayee_LDKClear_Body clear;
+   };
+} LDKPayee;
 
 /**
- * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
- * provide a default implementation to [`CoinSelectionSource`].
+ * A trait which can both lookup and update routing channel penalty scores.
+ *
+ * This is used in places where both bounds are required and implemented for all types which
+ * implement [`ScoreLookUp`] and [`ScoreUpdate`].
+ *
+ * Bindings users may need to manually implement this for their custom scoring implementations.
  */
-typedef struct LDKWalletSource {
+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 all UTXOs, with at least 1 confirmation each, that are available to spend.
+    * Implementation of ScoreLookUp for this object.
     */
-   struct LDKCResult_CVec_UtxoZNoneZ (*list_confirmed_utxos)(const void *this_arg);
+   struct LDKScoreLookUp ScoreLookUp;
    /**
-    * Returns a script to use for change above dust resulting from a successful coin selection
-    * attempt.
+    * Implementation of ScoreUpdate for this object.
     */
-   struct LDKCResult_CVec_u8ZNoneZ (*get_change_script)(const void *this_arg);
+   struct LDKScoreUpdate ScoreUpdate;
    /**
-    * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
-    * the transaction known to the wallet (i.e., any provided via
-    * [`WalletSource::list_confirmed_utxos`]).
-    *
-    * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
-    * unsigned transaction and then sign it with your wallet.
+    * Serialize the object into a byte array
     */
-   struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
+   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);
-} LDKWalletSource;
+} LDKScore;
 
 
 
 /**
- * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
- * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
- * spends may happen.
+ * A concrete implementation of [`LockableScore`] which supports multi-threading.
  */
-typedef struct MUST_USE_STRUCT LDKWallet {
+typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeWallet *inner;
+   LDKnativeMultiThreadedLockableScore *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKWallet;
+} LDKMultiThreadedLockableScore;
 
 
 
 /**
- * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
- * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
- * Replace-By-Fee (RBF).
- *
- * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
+ * A locked `MultiThreadedLockableScore`.
  */
-typedef struct MUST_USE_STRUCT LDKBumpTransactionEventHandler {
+typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockRead {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeBumpTransactionEventHandler *inner;
+   LDKnativeMultiThreadedScoreLockRead *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKBumpTransactionEventHandler;
+} LDKMultiThreadedScoreLockRead;
 
 
 
 /**
- * A [`KVStore`] implementation that writes to and reads from the file system.
+ * A locked `MultiThreadedLockableScore`.
  */
-typedef struct MUST_USE_STRUCT LDKFilesystemStore {
+typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockWrite {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeFilesystemStore *inner;
+   LDKnativeMultiThreadedScoreLockWrite *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKFilesystemStore;
+} LDKMultiThreadedScoreLockWrite;
 
 
 
 /**
- * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
- * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
- * responsibilities are:
- * * Processing [`Event`]s with a user-provided [`EventHandler`].
- * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
- *   writing it to disk/backups by invoking the callback given to it at startup.
- *   [`ChannelManager`] persistence should be done in the background.
- * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
- *   and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
- * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
- *   [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
- *
- * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
- * upon as doing so may result in high latency.
- *
- * # Note
- *
- * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
- * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
- * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
- * unilateral chain closure fees are at risk.
+ * Parameters for configuring [`ProbabilisticScorer`].
  *
- * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
- * [`ChannelManager::timer_tick_occurred`]: lightning::ln::channelmanager::ChannelManager::timer_tick_occurred
- * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
- * [`Event`]: lightning::events::Event
- * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred
- * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
- *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
+ * Used to configure decay parameters that are static throughout the lifetime of the scorer.
+ * these decay parameters affect the score of the channel penalty and are not changed on a
+ * per-route penalty cost call.
  */
-typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
+typedef struct MUST_USE_STRUCT LDKProbabilisticScoringDecayParameters {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeBackgroundProcessor *inner;
+   LDKnativeProbabilisticScoringDecayParameters *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKBackgroundProcessor;
+} LDKProbabilisticScoringDecayParameters;
 
 
 
 /**
- * The main Rapid Gossip Sync object.
+ * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
+ * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
  *
- * See [crate-level documentation] for usage.
+ * Your `node_id` is seed/0'.
+ * Unilateral closes may use seed/1'.
+ * Cooperative closes may use seed/2'.
+ * The two close keys may be needed to claim on-chain funds!
  *
- * [crate-level documentation]: crate
+ * This struct cannot be used for nodes that wish to support receiving phantom payments;
+ * [`PhantomKeysManager`] must be used instead.
+ *
+ * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
+ * previously issued invoices and attempts to pay previous invoices will fail.
  */
-typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
+typedef struct MUST_USE_STRUCT LDKKeysManager {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeRapidGossipSync *inner;
+   LDKnativeKeysManager *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKRapidGossipSync;
+} LDKKeysManager;
+
+
 
 /**
- * Either [`P2PGossipSync`] or [`RapidGossipSync`].
- */
-typedef enum LDKGossipSync_Tag {
-   /**
-    * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
-    */
-   LDKGossipSync_P2P,
-   /**
-    * Rapid gossip sync from a trusted server.
-    */
-   LDKGossipSync_Rapid,
-   /**
-    * No gossip sync.
-    */
-   LDKGossipSync_None,
-   /**
-    * Must be last for serialization purposes
-    */
-   LDKGossipSync_Sentinel,
-} LDKGossipSync_Tag;
-
-typedef struct MUST_USE_STRUCT LDKGossipSync {
-   LDKGossipSync_Tag tag;
-   union {
-      struct {
-         /**
-          * Note that this field is expected to be a reference.
-          */
-         struct LDKP2PGossipSync p2p;
-      };
-      struct {
-         /**
-          * Note that this field is expected to be a reference.
-          */
-         struct LDKRapidGossipSync rapid;
-      };
-   };
-} LDKGossipSync;
-
-
-
-/**
- * Data of the [`RawBolt11Invoice`] that is encoded in the data part
+ * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
+ * payments.
+ *
+ * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
+ * paid to one of multiple nodes. This works because we encode the invoice route hints such that
+ * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
+ * itself without ever needing to forward to this fake node.
+ *
+ * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
+ * provide some fault tolerance, because payers will automatically retry paying other provided
+ * nodes in the case that one node goes down.
+ *
+ * Note that multi-path payments are not supported in phantom invoices for security reasons.
+ * Switching between this struct and [`KeysManager`] will invalidate any previously issued
+ * invoices and attempts to pay previous invoices will fail.
  */
-typedef struct MUST_USE_STRUCT LDKRawDataPart {
+typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeRawDataPart *inner;
+   LDKnativePhantomKeysManager *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKRawDataPart;
+} LDKPhantomKeysManager;
 
 
 
 /**
- * SHA-256 hash
+ * An implementation of [`EntropySource`] using ChaCha20.
  */
-typedef struct MUST_USE_STRUCT LDKSha256 {
+typedef struct MUST_USE_STRUCT LDKRandomBytes {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeSha256 *inner;
+   LDKnativeRandomBytes *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKSha256;
+} LDKRandomBytes;
 
 
 
 /**
- * Positive duration that defines when (relatively to the timestamp) in the future the invoice
- * expires
+ * A sender, receiver and forwarder of [`OnionMessage`]s.
+ *
+ * # Handling Messages
+ *
+ * `OnionMessenger` implements [`OnionMessageHandler`], making it responsible for either forwarding
+ * messages to peers or delegating to the appropriate handler for the message type. Currently, the
+ * available handlers are:
+ * * [`OffersMessageHandler`], for responding to [`InvoiceRequest`]s and paying [`Bolt12Invoice`]s
+ * * [`CustomOnionMessageHandler`], for handling user-defined message types
+ *
+ * # Sending Messages
+ *
+ * [`OnionMessage`]s are sent initially using [`OnionMessenger::send_onion_message`]. When handling
+ * a message, the matched handler may return a response message which `OnionMessenger` will send
+ * on its behalf.
+ *
+ * # Example
+ *
+ * ```
+ * # extern crate bitcoin;
+ * # use bitcoin::hashes::_export::_core::time::Duration;
+ * # use bitcoin::hex::FromHex;
+ * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey, self};
+ * # use lightning::blinded_path::EmptyNodeIdLookUp;
+ * # use lightning::blinded_path::message::{BlindedMessagePath, MessageForwardNode, MessageContext};
+ * # use lightning::sign::{EntropySource, KeysManager};
+ * # use lightning::ln::peer_handler::IgnoringMessageHandler;
+ * # use lightning::onion_message::messenger::{Destination, MessageRouter, MessageSendInstructions, OnionMessagePath, OnionMessenger};
+ * # use lightning::onion_message::packet::OnionMessageContents;
+ * # use lightning::util::logger::{Logger, Record};
+ * # use lightning::util::ser::{Writeable, Writer};
+ * # use lightning::io;
+ * # use std::sync::Arc;
+ * # struct FakeLogger;
+ * # impl Logger for FakeLogger {
+ * #     fn log(&self, record: Record) { println!(\"{:?}\" , record); }
+ * # }
+ * # struct FakeMessageRouter {}
+ * # impl MessageRouter for FakeMessageRouter {
+ * #     fn find_path(&self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination) -> Result<OnionMessagePath, ()> {
+ * #         let secp_ctx = Secp256k1::new();
+ * #         let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
+ * #         let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
+ * #         let hop_node_id2 = hop_node_id1;
+ * #         Ok(OnionMessagePath {
+ * #             intermediate_nodes: vec![hop_node_id1, hop_node_id2],
+ * #             destination,
+ * #             first_node_addresses: None,
+ * #         })
+ * #     }
+ * #     fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
+ * #         &self, _recipient: PublicKey, _context: MessageContext, _peers: Vec<PublicKey>, _secp_ctx: &Secp256k1<T>
+ * #     ) -> Result<Vec<BlindedMessagePath>, ()> {
+ * #         unreachable!()
+ * #     }
+ * # }
+ * # let seed = [42u8; 32];
+ * # let time = Duration::from_secs(123456);
+ * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
+ * # let logger = Arc::new(FakeLogger {});
+ * # let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
+ * # let secp_ctx = Secp256k1::new();
+ * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
+ * # let (hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1);
+ * # let destination_node_id = hop_node_id1;
+ * # let node_id_lookup = EmptyNodeIdLookUp {};
+ * # let message_router = Arc::new(FakeMessageRouter {});
+ * # let custom_message_handler = IgnoringMessageHandler {};
+ * # let offers_message_handler = IgnoringMessageHandler {};
+ * # let async_payments_message_handler = IgnoringMessageHandler {};
+ * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
+ * // ChannelManager.
+ * let onion_messenger = OnionMessenger::new(
+ *     &keys_manager, &keys_manager, logger, &node_id_lookup, message_router,
+ *     &offers_message_handler, &async_payments_message_handler, &custom_message_handler
+ * );
+ *
+ * # #[derive(Debug, Clone)]
+ * # struct YourCustomMessage {}
+ * impl Writeable for YourCustomMessage {
+ * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
+ * \t\t# Ok(())
+ * \t\t// Write your custom onion message to `w`
+ * \t}
+ * }
+ * impl OnionMessageContents for YourCustomMessage {
+ * \tfn tlv_type(&self) -> u64 {
+ * \t\t# let your_custom_message_type = 42;
+ * \t\tyour_custom_message_type
+ * \t}
+ * \tfn msg_type(&self) -> &'static str { \"YourCustomMessageType\" }
+ * }
+ * // Send a custom onion message to a node id.
+ * let destination = Destination::Node(destination_node_id);
+ * let instructions = MessageSendInstructions::WithoutReplyPath { destination };
+ * # let message = YourCustomMessage {};
+ * onion_messenger.send_onion_message(message, instructions);
+ *
+ * // Create a blinded path to yourself, for someone to send an onion message to.
+ * # let your_node_id = hop_node_id1;
+ * let hops = [
+ * \tMessageForwardNode { node_id: hop_node_id3, short_channel_id: None },
+ * \tMessageForwardNode { node_id: hop_node_id4, short_channel_id: None },
+ * ];
+ * let context = MessageContext::Custom(Vec::new());
+ * let blinded_path = BlindedMessagePath::new(&hops, your_node_id, context, &keys_manager, &secp_ctx).unwrap();
+ *
+ * // Send a custom onion message to a blinded path.
+ * let destination = Destination::BlindedPath(blinded_path);
+ * let instructions = MessageSendInstructions::WithoutReplyPath { destination };
+ * # let message = YourCustomMessage {};
+ * onion_messenger.send_onion_message(message, instructions);
+ * ```
+ *
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
  */
-typedef struct MUST_USE_STRUCT LDKExpiryTime {
+typedef struct MUST_USE_STRUCT LDKOnionMessenger {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeExpiryTime *inner;
+   LDKnativeOnionMessenger *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKExpiryTime;
+} LDKOnionMessenger;
 
 
 
 /**
- * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
+ * A [`MessageRouter`] that can only route to a directly connected [`Destination`].
+ *
+ * # Privacy
+ *
+ * Creating [`BlindedMessagePath`]s may affect privacy since, if a suitable path cannot be found,
+ * it will create a one-hop path using the recipient as the introduction node if it is a announced
+ * node. Otherwise, there is no way to find a path to the introduction node in order to send a
+ * message, and thus an `Err` is returned.
  */
-typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
+typedef struct MUST_USE_STRUCT LDKDefaultMessageRouter {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeMinFinalCltvExpiryDelta *inner;
+   LDKnativeDefaultMessageRouter *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKMinFinalCltvExpiryDelta;
+} LDKDefaultMessageRouter;
 
 /**
- * A 20-byte byte array.
+ * The unblinded node in a blinded path.
  */
-typedef struct LDKTwentyBytes {
+typedef enum LDKIntroductionNode_Tag {
    /**
-    * The twenty bytes
+    * The node id of the introduction node.
     */
-   uint8_t data[20];
-} LDKTwentyBytes;
-
-/**
- * Fallback address in case no LN payment is possible
- */
-typedef enum LDKFallback_Tag {
-   LDKFallback_SegWitProgram,
-   LDKFallback_PubKeyHash,
-   LDKFallback_ScriptHash,
+   LDKIntroductionNode_NodeId,
+   /**
+    * The short channel id of the channel leading to the introduction node. The [`Direction`]
+    * identifies which side of the channel is the introduction node.
+    */
+   LDKIntroductionNode_DirectedShortChannelId,
    /**
     * Must be last for serialization purposes
     */
-   LDKFallback_Sentinel,
-} LDKFallback_Tag;
+   LDKIntroductionNode_Sentinel,
+} LDKIntroductionNode_Tag;
 
-typedef struct LDKFallback_LDKSegWitProgram_Body {
-   struct LDKWitnessVersion version;
-   struct LDKCVec_u8Z program;
-} LDKFallback_LDKSegWitProgram_Body;
+typedef struct LDKIntroductionNode_LDKDirectedShortChannelId_Body {
+   enum LDKDirection _0;
+   uint64_t _1;
+} LDKIntroductionNode_LDKDirectedShortChannelId_Body;
 
-typedef struct MUST_USE_STRUCT LDKFallback {
-   LDKFallback_Tag tag;
+typedef struct MUST_USE_STRUCT LDKIntroductionNode {
+   LDKIntroductionNode_Tag tag;
    union {
-      LDKFallback_LDKSegWitProgram_Body seg_wit_program;
-      struct {
-         struct LDKTwentyBytes pub_key_hash;
-      };
       struct {
-         struct LDKTwentyBytes script_hash;
+         struct LDKPublicKey node_id;
       };
+      LDKIntroductionNode_LDKDirectedShortChannelId_Body directed_short_channel_id;
    };
-} LDKFallback;
-
-extern const uintptr_t MAX_BUF_SIZE;
-
-extern const uintptr_t KVSTORE_NAMESPACE_KEY_MAX_LEN;
-
-extern const uint64_t MAX_SCID_BLOCK;
-
-extern const uint64_t MAX_SCID_TX_INDEX;
-
-extern const uint64_t MAX_SCID_VOUT_INDEX;
-
-extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
-
-extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
-
-extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
-
-extern const uint32_t ANTI_REORG_DELAY;
-
-extern const uint16_t BREAKDOWN_TIMEOUT;
-
-extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
-
-extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
-
-extern const uint16_t MAX_HTLCS;
-
-extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
-
-extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
-
-extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
-
-extern const uint64_t ANCHOR_INPUT_WITNESS_WEIGHT;
-
-extern const uint64_t HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT;
-
-extern const uint64_t HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT;
-
-extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
-
-extern const uintptr_t PAYER_NOTE_LIMIT;
-
-extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
-
-extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
-
-extern const uint8_t DEFAULT_MAX_PATH_COUNT;
-
-extern const uint64_t MAX_TIMESTAMP;
-
-extern const uint64_t DEFAULT_EXPIRY_TIME;
-
-extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
-
-extern const uint8_t TAG_PAYMENT_HASH;
-
-extern const uint8_t TAG_DESCRIPTION;
-
-extern const uint8_t TAG_PAYEE_PUB_KEY;
-
-extern const uint8_t TAG_DESCRIPTION_HASH;
-
-extern const uint8_t TAG_EXPIRY_TIME;
-
-extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
-
-extern const uint8_t TAG_FALLBACK;
-
-extern const uint8_t TAG_PRIVATE_ROUTE;
-
-extern const uint8_t TAG_PAYMENT_SECRET;
-
-extern const uint8_t TAG_PAYMENT_METADATA;
-
-extern const uint8_t TAG_FEATURES;
+} LDKIntroductionNode;
 
-struct LDKStr _ldk_get_compiled_version(void);
 
-struct LDKStr _ldk_c_bindings_get_compiled_version(void);
 
 /**
- * Gets the 128-bit integer, as 16 little-endian bytes
+ * A [`NodeIdLookUp`] that always returns `None`.
  */
-struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
+typedef struct MUST_USE_STRUCT LDKEmptyNodeIdLookUp {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeEmptyNodeIdLookUp *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKEmptyNodeIdLookUp;
 
-/**
- * Constructs a new U128 from 16 little-endian bytes
- */
-struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
 
-/**
- * Constructs a new WitnessProgram given a version and program bytes.
- *
- * The program MUST be at least 2 bytes and no longer than 40 bytes long.
- * Further, if the version is 0, the program MUST be either exactly 20 or exactly 32 bytes long.
- */
-struct LDKWitnessProgram WitnessProgram_new(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
 
 /**
- * Gets the `WitnessVersion` of the given `WitnessProgram`
+ * Data to construct a [`BlindedHop`] for forwarding a payment.
  */
-struct LDKWitnessVersion WitnessProgram_get_version(const struct LDKWitnessProgram *NONNULL_PTR prog);
+typedef struct MUST_USE_STRUCT LDKForwardTlvs {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeForwardTlvs *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKForwardTlvs;
 
 /**
- * Gets the witness program bytes of the given `WitnessProgram`
+ * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can
+ * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC,
+ * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`],
+ * which can provide a default implementation of this trait when used with [`Wallet`].
  */
-struct LDKu8slice WitnessProgram_get_program(const struct LDKWitnessProgram *NONNULL_PTR prog);
+typedef struct LDKCoinSelectionSource {
+   /**
+    * An opaque pointer which is passed to your function implementations as an argument.
+    * This has no meaning in the LDK, and can be NULL or any other value.
+    */
+   void *this_arg;
+   /**
+    * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
+    * available to spend. Implementations are free to pick their coin selection algorithm of
+    * choice, as long as the following requirements are met:
+    *
+    * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction
+    *    throughout coin selection, but must not be returned as part of the result.
+    * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction
+    *    throughout coin selection. In some cases, like when funding an anchor transaction, this
+    *    set is empty. Implementations should ensure they handle this correctly on their end,
+    *    e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be
+    *    provided, in which case a zero-value empty OP_RETURN output can be used instead.
+    * 3. Enough inputs must be selected/contributed for the resulting transaction (including the
+    *    inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`.
+    *
+    * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of
+    * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require
+    * providing the full input weight. Failing to do so may lead to underestimating fee bumps and
+    * delaying block inclusion.
+    *
+    * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they
+    * can be re-used within new fee-bumped iterations of the original claiming transaction,
+    * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a
+    * transaction associated with it, and all of the available UTXOs have already been assigned to
+    * other claims, implementations must be willing to double spend their UTXOs. The choice of
+    * which UTXOs to double spend is left to the implementation, but it must strive to keep the
+    * set of other claims being double spent to a minimum.
+    */
+   struct LDKCResult_CoinSelectionNoneZ (*select_confirmed_utxos)(const void *this_arg, struct LDKThirtyTwoBytes claim_id, struct LDKCVec_InputZ must_spend, struct LDKCVec_TxOutZ must_pay_to, uint32_t target_feerate_sat_per_1000_weight);
+   /**
+    * Signs and provides the full witness for all inputs within the transaction known to the
+    * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
+    *
+    * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
+    * unsigned transaction and then sign it with your wallet.
+    */
+   struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
+   /**
+    * Frees any resources associated with this object given its this_arg pointer.
+    * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+    */
+   void (*free)(void *this_arg);
+} LDKCoinSelectionSource;
 
 /**
- * Creates a new WitnessProgram which has the same data as `orig`
+ * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
+ * provide a default implementation to [`CoinSelectionSource`].
  */
-struct LDKWitnessProgram WitnessProgram_clone(const struct LDKWitnessProgram *NONNULL_PTR orig);
+typedef struct LDKWalletSource {
+   /**
+    * An opaque pointer which is passed to your function implementations as an argument.
+    * This has no meaning in the LDK, and can be NULL or any other value.
+    */
+   void *this_arg;
+   /**
+    * Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
+    */
+   struct LDKCResult_CVec_UtxoZNoneZ (*list_confirmed_utxos)(const void *this_arg);
+   /**
+    * Returns a script to use for change above dust resulting from a successful coin selection
+    * attempt.
+    */
+   struct LDKCResult_CVec_u8ZNoneZ (*get_change_script)(const void *this_arg);
+   /**
+    * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
+    * the transaction known to the wallet (i.e., any provided via
+    * [`WalletSource::list_confirmed_utxos`]).
+    *
+    * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
+    * unsigned transaction and then sign it with your wallet.
+    */
+   struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
+   /**
+    * Frees any resources associated with this object given its this_arg pointer.
+    * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+    */
+   void (*free)(void *this_arg);
+} LDKWalletSource;
 
-/**
- * Releases any memory held by the given `WitnessProgram` (which is currently none)
- */
-void WitnessProgram_free(struct LDKWitnessProgram o);
 
-/**
- * Convenience function for constructing a new BigEndianScalar
- */
-struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
 
 /**
- * Creates a new BigEndianScalar which has the same data as `orig`
+ * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
+ * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
+ * spends may happen.
  */
-struct LDKBigEndianScalar BigEndianScalar_clone(const struct LDKBigEndianScalar *NONNULL_PTR orig);
+typedef struct MUST_USE_STRUCT LDKWallet {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeWallet *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKWallet;
 
-/**
- * Creates a new Bech32Error which has the same data as `orig`
- */
-struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
 
-/**
- * Releases any memory held by the given `Bech32Error` (which is currently none)
- */
-void Bech32Error_free(struct LDKBech32Error o);
 
 /**
- * Frees the data buffer, if data_is_owned is set and datalen > 0.
+ * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
+ * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
+ * Replace-By-Fee (RBF).
+ *
+ * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
  */
-void Transaction_free(struct LDKTransaction _res);
+typedef struct MUST_USE_STRUCT LDKBumpTransactionEventHandler {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeBumpTransactionEventHandler *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKBumpTransactionEventHandler;
 
-/**
- * Creates a new Witness which has the same data as `orig` but with a new buffer.
- */
-struct LDKWitness Witness_clone(const struct LDKWitness *NONNULL_PTR orig);
 
-/**
- * Frees the data pointed to by data
- */
-void Witness_free(struct LDKWitness _res);
 
 /**
- * Convenience function for constructing a new TxIn
+ * A [`KVStore`] implementation that writes to and reads from the file system.
+ */
+typedef struct MUST_USE_STRUCT LDKFilesystemStore {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeFilesystemStore *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKFilesystemStore;
+
+
+
+/**
+ * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
+ * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
+ * responsibilities are:
+ * * Processing [`Event`]s with a user-provided [`EventHandler`].
+ * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
+ *   writing it to disk/backups by invoking the callback given to it at startup.
+ *   [`ChannelManager`] persistence should be done in the background.
+ * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
+ *   and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
+ * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
+ *   [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
+ *
+ * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
+ * upon as doing so may result in high latency.
+ *
+ * # Note
+ *
+ * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
+ * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
+ * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
+ * unilateral chain closure fees are at risk.
+ *
+ * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
+ * [`ChannelManager::timer_tick_occurred`]: lightning::ln::channelmanager::ChannelManager::timer_tick_occurred
+ * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
+ * [`Event`]: lightning::events::Event
+ * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred
+ * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
+ *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
+ */
+typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeBackgroundProcessor *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKBackgroundProcessor;
+
+
+
+/**
+ * The main Rapid Gossip Sync object.
+ *
+ * See [crate-level documentation] for usage.
+ *
+ * [crate-level documentation]: crate
+ */
+typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeRapidGossipSync *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKRapidGossipSync;
+
+/**
+ * Either [`P2PGossipSync`] or [`RapidGossipSync`].
+ */
+typedef enum LDKGossipSync_Tag {
+   /**
+    * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
+    */
+   LDKGossipSync_P2P,
+   /**
+    * Rapid gossip sync from a trusted server.
+    */
+   LDKGossipSync_Rapid,
+   /**
+    * No gossip sync.
+    */
+   LDKGossipSync_None,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKGossipSync_Sentinel,
+} LDKGossipSync_Tag;
+
+typedef struct MUST_USE_STRUCT LDKGossipSync {
+   LDKGossipSync_Tag tag;
+   union {
+      struct {
+         /**
+          * Note that this field is expected to be a reference.
+          */
+         struct LDKP2PGossipSync p2p;
+      };
+      struct {
+         /**
+          * Note that this field is expected to be a reference.
+          */
+         struct LDKRapidGossipSync rapid;
+      };
+   };
+} LDKGossipSync;
+
+
+
+/**
+ * Data of the [`RawBolt11Invoice`] that is encoded in the data part
+ */
+typedef struct MUST_USE_STRUCT LDKRawDataPart {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeRawDataPart *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKRawDataPart;
+
+
+
+/**
+ * Positive duration that defines when (relatively to the timestamp) in the future the invoice
+ * expires
+ */
+typedef struct MUST_USE_STRUCT LDKExpiryTime {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeExpiryTime *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKExpiryTime;
+
+
+
+/**
+ * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
+ */
+typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeMinFinalCltvExpiryDelta *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKMinFinalCltvExpiryDelta;
+
+/**
+ * A 20-byte byte array.
+ */
+typedef struct LDKTwentyBytes {
+   /**
+    * The twenty bytes
+    */
+   uint8_t data[20];
+} LDKTwentyBytes;
+
+/**
+ * Fallback address in case no LN payment is possible
+ */
+typedef enum LDKFallback_Tag {
+   LDKFallback_SegWitProgram,
+   LDKFallback_PubKeyHash,
+   LDKFallback_ScriptHash,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKFallback_Sentinel,
+} LDKFallback_Tag;
+
+typedef struct LDKFallback_LDKSegWitProgram_Body {
+   struct LDKWitnessVersion version;
+   struct LDKCVec_u8Z program;
+} LDKFallback_LDKSegWitProgram_Body;
+
+typedef struct MUST_USE_STRUCT LDKFallback {
+   LDKFallback_Tag tag;
+   union {
+      LDKFallback_LDKSegWitProgram_Body seg_wit_program;
+      struct {
+         struct LDKTwentyBytes pub_key_hash;
+      };
+      struct {
+         struct LDKTwentyBytes script_hash;
+      };
+   };
+} LDKFallback;
+
+extern const uintptr_t MAX_BUF_SIZE;
+
+extern const uintptr_t KVSTORE_NAMESPACE_KEY_MAX_LEN;
+
+extern const uint64_t MAX_SCID_BLOCK;
+
+extern const uint64_t MAX_SCID_TX_INDEX;
+
+extern const uint64_t MAX_SCID_VOUT_INDEX;
+
+extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
+
+extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
+
+extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
+
+extern const uint32_t ANTI_REORG_DELAY;
+
+extern const uint16_t BREAKDOWN_TIMEOUT;
+
+extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
+
+extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
+
+extern const uint16_t MAX_HTLCS;
+
+extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
+
+extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
+
+extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
+
+extern const uint64_t ANCHOR_INPUT_WITNESS_WEIGHT;
+
+extern const uint64_t HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT;
+
+extern const uint64_t HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT;
+
+extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
+
+extern const uintptr_t PAYER_NOTE_LIMIT;
+
+extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
+
+extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
+
+extern const uint8_t DEFAULT_MAX_PATH_COUNT;
+
+extern const uint8_t MAX_PATH_LENGTH_ESTIMATE;
+
+extern const uint64_t MAX_TIMESTAMP;
+
+extern const uint64_t DEFAULT_EXPIRY_TIME;
+
+extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
+
+extern const uint8_t TAG_PAYMENT_HASH;
+
+extern const uint8_t TAG_DESCRIPTION;
+
+extern const uint8_t TAG_PAYEE_PUB_KEY;
+
+extern const uint8_t TAG_DESCRIPTION_HASH;
+
+extern const uint8_t TAG_EXPIRY_TIME;
+
+extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
+
+extern const uint8_t TAG_FALLBACK;
+
+extern const uint8_t TAG_PRIVATE_ROUTE;
+
+extern const uint8_t TAG_PAYMENT_SECRET;
+
+extern const uint8_t TAG_PAYMENT_METADATA;
+
+extern const uint8_t TAG_FEATURES;
+
+struct LDKStr _ldk_get_compiled_version(void);
+
+struct LDKStr _ldk_c_bindings_get_compiled_version(void);
+
+/**
+ * Gets the 128-bit integer, as 16 little-endian bytes
+ */
+struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
+
+/**
+ * Constructs a new U128 from 16 little-endian bytes
+ */
+struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
+
+/**
+ * Constructs a new WitnessProgram given a version and program bytes.
+ *
+ * The program MUST be at least 2 bytes and no longer than 40 bytes long.
+ * Further, if the version is 0, the program MUST be either exactly 20 or exactly 32 bytes long.
+ */
+struct LDKWitnessProgram WitnessProgram_new(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
+
+/**
+ * Gets the `WitnessVersion` of the given `WitnessProgram`
+ */
+struct LDKWitnessVersion WitnessProgram_get_version(const struct LDKWitnessProgram *NONNULL_PTR prog);
+
+/**
+ * Gets the witness program bytes of the given `WitnessProgram`
+ */
+struct LDKu8slice WitnessProgram_get_program(const struct LDKWitnessProgram *NONNULL_PTR prog);
+
+/**
+ * Creates a new WitnessProgram which has the same data as `orig`
+ */
+struct LDKWitnessProgram WitnessProgram_clone(const struct LDKWitnessProgram *NONNULL_PTR orig);
+
+/**
+ * Releases any memory held by the given `WitnessProgram` (which is currently none)
+ */
+void WitnessProgram_free(struct LDKWitnessProgram o);
+
+/**
+ * Convenience function for constructing a new BigEndianScalar
+ */
+struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
+
+/**
+ * Creates a new BigEndianScalar which has the same data as `orig`
+ */
+struct LDKBigEndianScalar BigEndianScalar_clone(const struct LDKBigEndianScalar *NONNULL_PTR orig);
+
+/**
+ * Creates a new Bech32Error which has the same data as `orig`
+ */
+struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
+
+/**
+ * Releases any memory held by the given `Bech32Error` (which is currently none)
+ */
+void Bech32Error_free(struct LDKBech32Error o);
+
+/**
+ * Frees the data buffer, if data_is_owned is set and datalen > 0.
+ */
+void Transaction_free(struct LDKTransaction _res);
+
+/**
+ * Creates a new Witness which has the same data as `orig` but with a new buffer.
+ */
+struct LDKWitness Witness_clone(const struct LDKWitness *NONNULL_PTR orig);
+
+/**
+ * Frees the data pointed to by data
+ */
+void Witness_free(struct LDKWitness _res);
+
+/**
+ * Convenience function for constructing a new TxIn
  */
 struct LDKTxIn TxIn_new(struct LDKWitness witness, struct LDKCVec_u8Z script_sig, uint32_t sequence, struct LDKThirtyTwoBytes previous_txid, uint32_t previous_vout);
 
@@ -25153,7 +27149,33 @@ struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
-void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res);
+void CVec_BlindedMessagePathZ_free(struct LDKCVec_BlindedMessagePathZ _res);
+
+/**
+ * Creates a new CResult_RefundDecodeErrorZ in the success state.
+ */
+struct LDKCResult_RefundDecodeErrorZ CResult_RefundDecodeErrorZ_ok(struct LDKRefund o);
+
+/**
+ * Creates a new CResult_RefundDecodeErrorZ in the error state.
+ */
+struct LDKCResult_RefundDecodeErrorZ CResult_RefundDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RefundDecodeErrorZ_is_ok(const struct LDKCResult_RefundDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RefundDecodeErrorZ.
+ */
+void CResult_RefundDecodeErrorZ_free(struct LDKCResult_RefundDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RefundDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RefundDecodeErrorZ CResult_RefundDecodeErrorZ_clone(const struct LDKCResult_RefundDecodeErrorZ *NONNULL_PTR orig);
 
 /**
  * Creates a new CResult_RefundBolt12ParseErrorZ in the success state.
@@ -25436,6 +27458,11 @@ void CResult_SchnorrSignatureNoneZ_free(struct LDKCResult_SchnorrSignatureNoneZ
  */
 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig);
 
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_StrZ_free(struct LDKCVec_StrZ _res);
+
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
@@ -25531,30 +27558,30 @@ void CResult_ThirtyTwoBytesNoneZ_free(struct LDKCResult_ThirtyTwoBytesNoneZ _res
 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_clone(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
+ * Creates a new CResult_Bolt12InvoiceDecodeErrorZ in the success state.
  */
-struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
+struct LDKCResult_Bolt12InvoiceDecodeErrorZ CResult_Bolt12InvoiceDecodeErrorZ_ok(struct LDKBolt12Invoice o);
 
 /**
- * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
+ * Creates a new CResult_Bolt12InvoiceDecodeErrorZ in the error state.
  */
-struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_Bolt12InvoiceDecodeErrorZ CResult_Bolt12InvoiceDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
+bool CResult_Bolt12InvoiceDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
+ * Frees any resources used by the CResult_Bolt12InvoiceDecodeErrorZ.
  */
-void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
+void CResult_Bolt12InvoiceDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_Bolt12InvoiceDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_Bolt12InvoiceDecodeErrorZ CResult_Bolt12InvoiceDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR orig);
 
 /**
  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
@@ -25760,56 +27787,82 @@ void CResult_HTLCDescriptorDecodeErrorZ_free(struct LDKCResult_HTLCDescriptorDec
 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_clone(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_NoneNoneZ in the success state.
+ * Creates a new CResult_PublicKeyNoneZ in the success state.
  */
-struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
+struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
 
 /**
- * Creates a new CResult_NoneNoneZ in the error state.
+ * Creates a new CResult_PublicKeyNoneZ in the error state.
  */
-struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
+struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
+bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_NoneNoneZ.
+ * Frees any resources used by the CResult_PublicKeyNoneZ.
  */
-void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
+void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
 
 /**
- * Creates a new CResult_NoneNoneZ which has the same data as `orig`
+ * Creates a new CResult_PublicKeyNoneZ 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);
+struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_PublicKeyNoneZ in the success state.
+ * Creates a new CResult__u832NoneZ in the success state.
  */
-struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
+struct LDKCResult__u832NoneZ CResult__u832NoneZ_ok(struct LDKThirtyTwoBytes o);
 
 /**
- * Creates a new CResult_PublicKeyNoneZ in the error state.
+ * Creates a new CResult__u832NoneZ in the error state.
  */
-struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
+struct LDKCResult__u832NoneZ CResult__u832NoneZ_err(void);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
+bool CResult__u832NoneZ_is_ok(const struct LDKCResult__u832NoneZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_PublicKeyNoneZ.
+ * Frees any resources used by the CResult__u832NoneZ.
  */
-void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
+void CResult__u832NoneZ_free(struct LDKCResult__u832NoneZ _res);
 
 /**
- * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
+ * Creates a new CResult__u832NoneZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
+struct LDKCResult__u832NoneZ CResult__u832NoneZ_clone(const struct LDKCResult__u832NoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_NoneNoneZ in the success state.
+ */
+struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
+
+/**
+ * Creates a new CResult_NoneNoneZ in the error state.
+ */
+struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NoneNoneZ.
+ */
+void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
+
+/**
+ * Creates a new CResult_NoneNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
 
 /**
  * Constructs a new COption_BigEndianScalarZ containing a crate::c_types::BigEndianScalar
@@ -25832,11 +27885,6 @@ void COption_BigEndianScalarZ_free(struct LDKCOption_BigEndianScalarZ _res);
  */
 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_clone(const struct LDKCOption_BigEndianScalarZ *NONNULL_PTR orig);
 
-/**
- * Frees the buffer pointed to by `data` if `datalen` is non-0.
- */
-void CVec_U5Z_free(struct LDKCVec_U5Z _res);
-
 /**
  * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
  */
@@ -25916,30 +27964,30 @@ void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
+ * Creates a new CResult_EcdsaChannelSignerDecodeErrorZ in the success state.
  */
-struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o);
+struct LDKCResult_EcdsaChannelSignerDecodeErrorZ CResult_EcdsaChannelSignerDecodeErrorZ_ok(struct LDKEcdsaChannelSigner o);
 
 /**
- * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state.
+ * Creates a new CResult_EcdsaChannelSignerDecodeErrorZ in the error state.
  */
-struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_EcdsaChannelSignerDecodeErrorZ CResult_EcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
+bool CResult_EcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_WriteableEcdsaChannelSignerDecodeErrorZ.
+ * Frees any resources used by the CResult_EcdsaChannelSignerDecodeErrorZ.
  */
-void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res);
+void CResult_EcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_EcdsaChannelSignerDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_EcdsaChannelSignerDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_EcdsaChannelSignerDecodeErrorZ CResult_EcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig);
 
 /**
  * Creates a new CResult_CVec_u8ZNoneZ in the success state.
@@ -26175,6 +28223,48 @@ void CResult_NoneIOErrorZ_free(struct LDKCResult_NoneIOErrorZ _res);
  */
 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_clone(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR orig);
 
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ from the contained elements.
+ */
+struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(struct LDKThirtyTwoBytes a, struct LDKRecipientOnionFields b, struct LDKRouteParameters c);
+
+/**
+ * Frees any resources used by the C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.
+ */
+void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res);
+
+/**
+ * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the success state.
+ */
+struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o);
+
+/**
+ * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the error state.
+ */
+struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.
+ */
+void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res);
+
+/**
+ * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR orig);
+
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
@@ -26206,52 +28296,36 @@ void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _r
  */
 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *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_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig);
-
-/**
- * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements.
- */
-struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b);
-
-/**
- * Frees any resources used by the C2Tuple_BlindedPayInfoBlindedPathZ.
- */
-void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res);
-
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
-void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res);
+void CVec_BlindedPaymentPathZ_free(struct LDKCVec_BlindedPaymentPathZ _res);
 
 /**
- * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the success state.
+ * Creates a new CResult_CVec_BlindedPaymentPathZNoneZ in the success state.
  */
-struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ o);
+struct LDKCResult_CVec_BlindedPaymentPathZNoneZ CResult_CVec_BlindedPaymentPathZNoneZ_ok(struct LDKCVec_BlindedPaymentPathZ o);
 
 /**
- * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the error state.
+ * Creates a new CResult_CVec_BlindedPaymentPathZNoneZ in the error state.
  */
-struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(void);
+struct LDKCResult_CVec_BlindedPaymentPathZNoneZ CResult_CVec_BlindedPaymentPathZNoneZ_err(void);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR o);
+bool CResult_CVec_BlindedPaymentPathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.
+ * Frees any resources used by the CResult_CVec_BlindedPaymentPathZNoneZ.
  */
-void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ _res);
+void CResult_CVec_BlindedPaymentPathZNoneZ_free(struct LDKCResult_CVec_BlindedPaymentPathZNoneZ _res);
 
 /**
- * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ which has the same data as `orig`
+ * Creates a new CResult_CVec_BlindedPaymentPathZNoneZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR orig);
+struct LDKCResult_CVec_BlindedPaymentPathZNoneZ CResult_CVec_BlindedPaymentPathZNoneZ_clone(const struct LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR orig);
 
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
@@ -26285,30 +28359,35 @@ void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ
 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_CVec_BlindedPathZNoneZ in the success state.
+ * Creates a new CResult_CVec_BlindedMessagePathZNoneZ in the success state.
  */
-struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_ok(struct LDKCVec_BlindedPathZ o);
+struct LDKCResult_CVec_BlindedMessagePathZNoneZ CResult_CVec_BlindedMessagePathZNoneZ_ok(struct LDKCVec_BlindedMessagePathZ o);
 
 /**
- * Creates a new CResult_CVec_BlindedPathZNoneZ in the error state.
+ * Creates a new CResult_CVec_BlindedMessagePathZNoneZ in the error state.
  */
-struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_err(void);
+struct LDKCResult_CVec_BlindedMessagePathZNoneZ CResult_CVec_BlindedMessagePathZNoneZ_err(void);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_CVec_BlindedPathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR o);
+bool CResult_CVec_BlindedMessagePathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_CVec_BlindedPathZNoneZ.
+ * Frees any resources used by the CResult_CVec_BlindedMessagePathZNoneZ.
  */
-void CResult_CVec_BlindedPathZNoneZ_free(struct LDKCResult_CVec_BlindedPathZNoneZ _res);
+void CResult_CVec_BlindedMessagePathZNoneZ_free(struct LDKCResult_CVec_BlindedMessagePathZNoneZ _res);
 
 /**
- * Creates a new CResult_CVec_BlindedPathZNoneZ which has the same data as `orig`
+ * Creates a new CResult_CVec_BlindedMessagePathZNoneZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_clone(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR orig);
+struct LDKCResult_CVec_BlindedMessagePathZNoneZ CResult_CVec_BlindedMessagePathZNoneZ_clone(const struct LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_MessageForwardNodeZ_free(struct LDKCVec_MessageForwardNodeZ _res);
 
 /**
  * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
@@ -26491,11 +28570,6 @@ struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeE
  */
 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
 
-/**
- * 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.
  */
@@ -27112,6 +29186,32 @@ bool CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(
  */
 void CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ _res);
 
+/**
+ * Creates a new CResult_OfferDecodeErrorZ in the success state.
+ */
+struct LDKCResult_OfferDecodeErrorZ CResult_OfferDecodeErrorZ_ok(struct LDKOffer o);
+
+/**
+ * Creates a new CResult_OfferDecodeErrorZ in the error state.
+ */
+struct LDKCResult_OfferDecodeErrorZ CResult_OfferDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OfferDecodeErrorZ_is_ok(const struct LDKCResult_OfferDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OfferDecodeErrorZ.
+ */
+void CResult_OfferDecodeErrorZ_free(struct LDKCResult_OfferDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_OfferDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OfferDecodeErrorZ CResult_OfferDecodeErrorZ_clone(const struct LDKCResult_OfferDecodeErrorZ *NONNULL_PTR orig);
+
 /**
  * Creates a new CResult_OfferBolt12ParseErrorZ in the success state.
  */
@@ -27481,6 +29581,27 @@ void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ
  */
 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
 
+/**
+ * Constructs a new COption_NodeAnnouncementInfoZ containing a crate::lightning::routing::gossip::NodeAnnouncementInfo
+ */
+struct LDKCOption_NodeAnnouncementInfoZ COption_NodeAnnouncementInfoZ_some(struct LDKNodeAnnouncementInfo o);
+
+/**
+ * Constructs a new COption_NodeAnnouncementInfoZ containing nothing
+ */
+struct LDKCOption_NodeAnnouncementInfoZ COption_NodeAnnouncementInfoZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::routing::gossip::NodeAnnouncementInfo, if we are in the Some state
+ */
+void COption_NodeAnnouncementInfoZ_free(struct LDKCOption_NodeAnnouncementInfoZ _res);
+
+/**
+ * Creates a new COption_NodeAnnouncementInfoZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_NodeAnnouncementInfoZ COption_NodeAnnouncementInfoZ_clone(const struct LDKCOption_NodeAnnouncementInfoZ *NONNULL_PTR orig);
+
 /**
  * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
  */
@@ -27745,27 +29866,6 @@ void COption_C2Tuple_u64u16ZZ_free(struct LDKCOption_C2Tuple_u64u16ZZ _res);
  */
 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_clone(const struct LDKCOption_C2Tuple_u64u16ZZ *NONNULL_PTR orig);
 
-/**
- * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channelmanager::ChannelShutdownState
- */
-struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o);
-
-/**
- * Constructs a new COption_ChannelShutdownStateZ containing nothing
- */
-struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void);
-
-/**
- * Frees any resources associated with the crate::lightning::ln::channelmanager::ChannelShutdownState, if we are in the Some state
- */
-void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res);
-
-/**
- * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
- */
-struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig);
-
 /**
  * Creates a new CResult_ChannelIdAPIErrorZ in the success state.
  */
@@ -28100,124 +30200,141 @@ void CResult_ThirtyTwoBytesAPIErrorZ_free(struct LDKCResult_ThirtyTwoBytesAPIErr
 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig);
 
 /**
- * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage
+ * Constructs a new COption_OffersContextZ containing a crate::lightning::blinded_path::message::OffersContext
  */
-struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o);
+struct LDKCOption_OffersContextZ COption_OffersContextZ_some(struct LDKOffersContext o);
 
 /**
- * Constructs a new COption_OffersMessageZ containing nothing
+ * Constructs a new COption_OffersContextZ containing nothing
  */
-struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void);
+struct LDKCOption_OffersContextZ COption_OffersContextZ_none(void);
 
 /**
- * Frees any resources associated with the crate::lightning::onion_message::offers::OffersMessage, if we are in the Some state
+ * Frees any resources associated with the crate::lightning::blinded_path::message::OffersContext, if we are in the Some state
  */
-void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res);
+void COption_OffersContextZ_free(struct LDKCOption_OffersContextZ _res);
 
 /**
- * Creates a new COption_OffersMessageZ which has the same data as `orig`
+ * Creates a new COption_OffersContextZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig);
+struct LDKCOption_OffersContextZ COption_OffersContextZ_clone(const struct LDKCOption_OffersContextZ *NONNULL_PTR orig);
 
 /**
  * Creates a new tuple which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR orig);
+struct LDKC2Tuple_OffersMessageResponseInstructionZ C2Tuple_OffersMessageResponseInstructionZ_clone(const struct LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR orig);
 
 /**
- * Creates a new C3Tuple_OffersMessageDestinationBlindedPathZ from the contained elements.
+ * Creates a new C2Tuple_OffersMessageResponseInstructionZ from the contained elements.
  */
-struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_new(struct LDKOffersMessage a, struct LDKDestination b, struct LDKBlindedPath c);
+struct LDKC2Tuple_OffersMessageResponseInstructionZ C2Tuple_OffersMessageResponseInstructionZ_new(struct LDKOffersMessage a, struct LDKResponseInstruction b);
 
 /**
- * Frees any resources used by the C3Tuple_OffersMessageDestinationBlindedPathZ.
+ * Frees any resources used by the C2Tuple_OffersMessageResponseInstructionZ.
  */
-void C3Tuple_OffersMessageDestinationBlindedPathZ_free(struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res);
+void C2Tuple_OffersMessageResponseInstructionZ_free(struct LDKC2Tuple_OffersMessageResponseInstructionZ _res);
 
 /**
- * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ * Constructs a new COption_C2Tuple_OffersMessageResponseInstructionZZ containing a crate::c_types::derived::C2Tuple_OffersMessageResponseInstructionZ
  */
-void CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res);
+struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ COption_C2Tuple_OffersMessageResponseInstructionZZ_some(struct LDKC2Tuple_OffersMessageResponseInstructionZ o);
 
 /**
- * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
+ * Constructs a new COption_C2Tuple_OffersMessageResponseInstructionZZ containing nothing
  */
-struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
+struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ COption_C2Tuple_OffersMessageResponseInstructionZZ_none(void);
 
 /**
- * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
+ * Frees any resources associated with the crate::c_types::derived::C2Tuple_OffersMessageResponseInstructionZ, if we are in the Some state
  */
-struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
+void COption_C2Tuple_OffersMessageResponseInstructionZZ_free(struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ _res);
 
 /**
- * Checks if the given object is currently in the success state
+ * Creates a new COption_C2Tuple_OffersMessageResponseInstructionZZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
+struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(const struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
+struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ C2Tuple_OffersMessageMessageSendInstructionsZ_clone(const struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
+ * Creates a new C2Tuple_OffersMessageMessageSendInstructionsZ from the contained elements.
  */
-struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
+struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ C2Tuple_OffersMessageMessageSendInstructionsZ_new(struct LDKOffersMessage a, struct LDKMessageSendInstructions b);
 
 /**
- * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
+ * Frees any resources used by the C2Tuple_OffersMessageMessageSendInstructionsZ.
  */
-struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
+void C2Tuple_OffersMessageMessageSendInstructionsZ_free(struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ _res);
 
 /**
- * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
-struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
+void CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_free(struct LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ _res);
 
 /**
- * Checks if the given object is currently in the success state
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
+struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(const struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
+ * Creates a new C2Tuple_ReleaseHeldHtlcResponseInstructionZ from the contained elements.
  */
-void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
+struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new(struct LDKReleaseHeldHtlc a, struct LDKResponseInstruction b);
 
 /**
- * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
+ * Frees any resources used by the C2Tuple_ReleaseHeldHtlcResponseInstructionZ.
  */
-struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
+void C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free(struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ _res);
 
 /**
- * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
+ * Constructs a new COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ containing a crate::c_types::derived::C2Tuple_ReleaseHeldHtlcResponseInstructionZ
  */
-struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
+struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some(struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ o);
 
 /**
- * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
+ * Constructs a new COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ containing nothing
  */
-struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none(void);
 
 /**
- * Checks if the given object is currently in the success state
+ * Frees any resources associated with the crate::c_types::derived::C2Tuple_ReleaseHeldHtlcResponseInstructionZ, if we are in the Some state
  */
-bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
+void COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free(struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ _res);
 
 /**
- * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
+ * Creates a new COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
+struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(const struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
+ * Creates a new tuple which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
+struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(const struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ from the contained elements.
+ */
+struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new(struct LDKAsyncPaymentsMessage a, struct LDKMessageSendInstructions b);
+
+/**
+ * Frees any resources used by the C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ.
+ */
+void C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free(struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_free(struct LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ _res);
 
 /**
  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
@@ -28349,32 +30466,6 @@ void CResult_BlindedFailureDecodeErrorZ_free(struct LDKCResult_BlindedFailureDec
  */
 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_clone(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR orig);
 
-/**
- * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
- */
-struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o);
-
-/**
- * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
- */
-struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e);
-
-/**
- * Checks if the given object is currently in the success state
- */
-bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o);
-
-/**
- * Frees any resources used by the CResult_ChannelShutdownStateDecodeErrorZ.
- */
-void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res);
-
-/**
- * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
- */
-struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig);
-
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
@@ -28687,6 +30778,32 @@ void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free(struct LDKC2Tuple_Th
  */
 void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ _res);
 
+/**
+ * Creates a new CResult_NoneReplayEventZ in the success state.
+ */
+struct LDKCResult_NoneReplayEventZ CResult_NoneReplayEventZ_ok(void);
+
+/**
+ * Creates a new CResult_NoneReplayEventZ in the error state.
+ */
+struct LDKCResult_NoneReplayEventZ CResult_NoneReplayEventZ_err(struct LDKReplayEvent e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NoneReplayEventZ_is_ok(const struct LDKCResult_NoneReplayEventZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NoneReplayEventZ.
+ */
+void CResult_NoneReplayEventZ_free(struct LDKCResult_NoneReplayEventZ _res);
+
+/**
+ * Creates a new CResult_NoneReplayEventZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NoneReplayEventZ CResult_NoneReplayEventZ_clone(const struct LDKCResult_NoneReplayEventZ *NONNULL_PTR orig);
+
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
@@ -28806,22 +30923,38 @@ void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _r
  * Creates a new tuple which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR orig);
+struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ C2Tuple_OnionMessageContentsResponseInstructionZ_clone(const struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR orig);
 
 /**
- * Creates a new C2Tuple_PublicKeyCVec_SocketAddressZZ from the contained elements.
+ * Creates a new C2Tuple_OnionMessageContentsResponseInstructionZ from the contained elements.
  */
-struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCVec_SocketAddressZ b);
+struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ C2Tuple_OnionMessageContentsResponseInstructionZ_new(struct LDKOnionMessageContents a, struct LDKResponseInstruction b);
 
 /**
- * Frees any resources used by the C2Tuple_PublicKeyCVec_SocketAddressZZ.
+ * Frees any resources used by the C2Tuple_OnionMessageContentsResponseInstructionZ.
  */
-void C2Tuple_PublicKeyCVec_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res);
+void C2Tuple_OnionMessageContentsResponseInstructionZ_free(struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ _res);
 
 /**
- * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ * Constructs a new COption_C2Tuple_OnionMessageContentsResponseInstructionZZ containing a crate::c_types::derived::C2Tuple_OnionMessageContentsResponseInstructionZ
+ */
+struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some(struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ o);
+
+/**
+ * Constructs a new COption_C2Tuple_OnionMessageContentsResponseInstructionZZ containing nothing
+ */
+struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::derived::C2Tuple_OnionMessageContentsResponseInstructionZ, if we are in the Some state
+ */
+void COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free(struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ _res);
+
+/**
+ * Creates a new COption_C2Tuple_OnionMessageContentsResponseInstructionZZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-void CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ _res);
+struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(const struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *NONNULL_PTR orig);
 
 /**
  * Constructs a new COption_OnionMessageContentsZ containing a crate::lightning::onion_message::packet::OnionMessageContents
@@ -28874,22 +31007,22 @@ struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_Onio
  * Creates a new tuple which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR orig);
+struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(const struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR orig);
 
 /**
- * Creates a new C3Tuple_OnionMessageContentsDestinationBlindedPathZ from the contained elements.
+ * Creates a new C2Tuple_OnionMessageContentsMessageSendInstructionsZ from the contained elements.
  */
-struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(struct LDKOnionMessageContents a, struct LDKDestination b, struct LDKBlindedPath c);
+struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new(struct LDKOnionMessageContents a, struct LDKMessageSendInstructions b);
 
 /**
- * Frees any resources used by the C3Tuple_OnionMessageContentsDestinationBlindedPathZ.
+ * Frees any resources used by the C2Tuple_OnionMessageContentsMessageSendInstructionsZ.
  */
-void C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res);
+void C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free(struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ _res);
 
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
-void CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res);
+void CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_free(struct LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ _res);
 
 /**
  * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
@@ -29088,11 +31221,6 @@ void CResult_CVec_u8ZIOErrorZ_free(struct LDKCResult_CVec_u8ZIOErrorZ _res);
  */
 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_clone(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR orig);
 
-/**
- * Frees the buffer pointed to by `data` if `datalen` is non-0.
- */
-void CVec_StrZ_free(struct LDKCVec_StrZ _res);
-
 /**
  * Creates a new CResult_CVec_StrZIOErrorZ in the success state.
  */
@@ -29228,27 +31356,6 @@ void CResult_InvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRe
  */
 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_clone(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR orig);
 
-/**
- * Constructs a new COption_SecretKeyZ containing a crate::c_types::SecretKey
- */
-struct LDKCOption_SecretKeyZ COption_SecretKeyZ_some(struct LDKSecretKey o);
-
-/**
- * Constructs a new COption_SecretKeyZ containing nothing
- */
-struct LDKCOption_SecretKeyZ COption_SecretKeyZ_none(void);
-
-/**
- * Frees any resources associated with the crate::c_types::SecretKey, if we are in the Some state
- */
-void COption_SecretKeyZ_free(struct LDKCOption_SecretKeyZ _res);
-
-/**
- * Creates a new COption_SecretKeyZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
- */
-struct LDKCOption_SecretKeyZ COption_SecretKeyZ_clone(const struct LDKCOption_SecretKeyZ *NONNULL_PTR orig);
-
 /**
  * Creates a new CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ in the success state.
  */
@@ -29554,30 +31661,30 @@ void CResult_StfuDecodeErrorZ_free(struct LDKCResult_StfuDecodeErrorZ _res);
 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_clone(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_SpliceDecodeErrorZ in the success state.
+ * Creates a new CResult_SpliceInitDecodeErrorZ in the success state.
  */
-struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_ok(struct LDKSplice o);
+struct LDKCResult_SpliceInitDecodeErrorZ CResult_SpliceInitDecodeErrorZ_ok(struct LDKSpliceInit o);
 
 /**
- * Creates a new CResult_SpliceDecodeErrorZ in the error state.
+ * Creates a new CResult_SpliceInitDecodeErrorZ in the error state.
  */
-struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_SpliceInitDecodeErrorZ CResult_SpliceInitDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_SpliceDecodeErrorZ_is_ok(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR o);
+bool CResult_SpliceInitDecodeErrorZ_is_ok(const struct LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_SpliceDecodeErrorZ.
+ * Frees any resources used by the CResult_SpliceInitDecodeErrorZ.
  */
-void CResult_SpliceDecodeErrorZ_free(struct LDKCResult_SpliceDecodeErrorZ _res);
+void CResult_SpliceInitDecodeErrorZ_free(struct LDKCResult_SpliceInitDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_SpliceDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_SpliceInitDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_clone(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_SpliceInitDecodeErrorZ CResult_SpliceInitDecodeErrorZ_clone(const struct LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR orig);
 
 /**
  * Creates a new CResult_SpliceAckDecodeErrorZ in the success state.
@@ -29969,6 +32076,32 @@ void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSig
  */
 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
 
+/**
+ * Creates a new CResult_CommitmentSignedBatchDecodeErrorZ in the success state.
+ */
+struct LDKCResult_CommitmentSignedBatchDecodeErrorZ CResult_CommitmentSignedBatchDecodeErrorZ_ok(struct LDKCommitmentSignedBatch o);
+
+/**
+ * Creates a new CResult_CommitmentSignedBatchDecodeErrorZ in the error state.
+ */
+struct LDKCResult_CommitmentSignedBatchDecodeErrorZ CResult_CommitmentSignedBatchDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CommitmentSignedBatchDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CommitmentSignedBatchDecodeErrorZ.
+ */
+void CResult_CommitmentSignedBatchDecodeErrorZ_free(struct LDKCResult_CommitmentSignedBatchDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_CommitmentSignedBatchDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CommitmentSignedBatchDecodeErrorZ CResult_CommitmentSignedBatchDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR orig);
+
 /**
  * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
  */
@@ -30802,431 +32935,759 @@ void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTime
 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ * Constructs a new COption_InboundHTLCStateDetailsZ containing a crate::lightning::ln::channel_state::InboundHTLCStateDetails
  */
-void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
+struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_some(enum LDKInboundHTLCStateDetails o);
 
 /**
- * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state.
+ * Constructs a new COption_InboundHTLCStateDetailsZ containing nothing
  */
-struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o);
+struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_none(void);
 
 /**
- * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state.
+ * Frees any resources associated with the crate::lightning::ln::channel_state::InboundHTLCStateDetails, if we are in the Some state
  */
-struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
+void COption_InboundHTLCStateDetailsZ_free(struct LDKCOption_InboundHTLCStateDetailsZ _res);
 
 /**
- * Checks if the given object is currently in the success state
+ * Creates a new COption_InboundHTLCStateDetailsZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
+struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_clone(const struct LDKCOption_InboundHTLCStateDetailsZ *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the CResult_Bolt11InvoiceSignOrCreationErrorZ.
+ * Creates a new CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ in the success state.
  */
-void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res);
+struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_ok(struct LDKCOption_InboundHTLCStateDetailsZ o);
 
 /**
- * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
+ * Creates a new CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ in the error state.
  */
-struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
+struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
- * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ * Checks if the given object is currently in the success state
  */
-void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
+bool CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Creates a new CResult_OffersMessageDecodeErrorZ in the success state.
+ * Frees any resources used by the CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ.
  */
-struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o);
+void CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free(struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_OffersMessageDecodeErrorZ in the error state.
+ * Creates a new CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(const struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_InboundHTLCDetailsDecodeErrorZ in the success state.
+ */
+struct LDKCResult_InboundHTLCDetailsDecodeErrorZ CResult_InboundHTLCDetailsDecodeErrorZ_ok(struct LDKInboundHTLCDetails o);
+
+/**
+ * Creates a new CResult_InboundHTLCDetailsDecodeErrorZ in the error state.
+ */
+struct LDKCResult_InboundHTLCDetailsDecodeErrorZ CResult_InboundHTLCDetailsDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o);
+bool CResult_InboundHTLCDetailsDecodeErrorZ_is_ok(const struct LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_OffersMessageDecodeErrorZ.
+ * Frees any resources used by the CResult_InboundHTLCDetailsDecodeErrorZ.
  */
-void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res);
+void CResult_InboundHTLCDetailsDecodeErrorZ_free(struct LDKCResult_InboundHTLCDetailsDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_InboundHTLCDetailsDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_InboundHTLCDetailsDecodeErrorZ CResult_InboundHTLCDetailsDecodeErrorZ_clone(const struct LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
+ * Constructs a new COption_OutboundHTLCStateDetailsZ containing a crate::lightning::ln::channel_state::OutboundHTLCStateDetails
  */
-struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
+struct LDKCOption_OutboundHTLCStateDetailsZ COption_OutboundHTLCStateDetailsZ_some(enum LDKOutboundHTLCStateDetails o);
 
 /**
- * Constructs a new COption_HTLCClaimZ containing nothing
+ * Constructs a new COption_OutboundHTLCStateDetailsZ containing nothing
  */
-struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
+struct LDKCOption_OutboundHTLCStateDetailsZ COption_OutboundHTLCStateDetailsZ_none(void);
 
 /**
- * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
+ * Frees any resources associated with the crate::lightning::ln::channel_state::OutboundHTLCStateDetails, if we are in the Some state
  */
-void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
+void COption_OutboundHTLCStateDetailsZ_free(struct LDKCOption_OutboundHTLCStateDetailsZ _res);
 
 /**
- * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
+ * Creates a new COption_OutboundHTLCStateDetailsZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
+struct LDKCOption_OutboundHTLCStateDetailsZ COption_OutboundHTLCStateDetailsZ_clone(const struct LDKCOption_OutboundHTLCStateDetailsZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
+ * Creates a new CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ in the success state.
  */
-struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_ok(struct LDKCOption_OutboundHTLCStateDetailsZ o);
+
+/**
+ * Creates a new CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
+bool CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
+ * Frees any resources used by the CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ.
  */
-void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
+void CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free(struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(const struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
+ * Creates a new CResult_OutboundHTLCDetailsDecodeErrorZ in the success state.
  */
-struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
+struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ CResult_OutboundHTLCDetailsDecodeErrorZ_ok(struct LDKOutboundHTLCDetails o);
 
 /**
- * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
+ * Creates a new CResult_OutboundHTLCDetailsDecodeErrorZ in the error state.
  */
-struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ CResult_OutboundHTLCDetailsDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
+bool CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok(const struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
+ * Frees any resources used by the CResult_OutboundHTLCDetailsDecodeErrorZ.
  */
-void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
+void CResult_OutboundHTLCDetailsDecodeErrorZ_free(struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_OutboundHTLCDetailsDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ CResult_OutboundHTLCDetailsDecodeErrorZ_clone(const struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
+ * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
  */
-struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
+struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
 
 /**
- * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
+ * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
  */
-struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
+bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
+ * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
  */
-void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
+void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
+ * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
  */
-struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
+struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
 
 /**
- * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
+ * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
  */
-struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
+bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
+ * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
  */
-void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
+void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
+ * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channel_state::ChannelShutdownState
  */
-struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
+struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o);
 
 /**
- * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
+ * Constructs a new COption_ChannelShutdownStateZ containing nothing
  */
-struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void);
 
 /**
- * Checks if the given object is currently in the success state
+ * Frees any resources associated with the crate::lightning::ln::channel_state::ChannelShutdownState, if we are in the Some state
  */
-bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
+void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res);
 
 /**
- * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
+ * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
+struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
-struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
+void CVec_InboundHTLCDetailsZ_free(struct LDKCVec_InboundHTLCDetailsZ _res);
 
 /**
- * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
-struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
+void CVec_OutboundHTLCDetailsZ_free(struct LDKCVec_OutboundHTLCDetailsZ _res);
 
 /**
- * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
+ * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
  */
-struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
+
+/**
+ * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
+bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
+ * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
  */
-void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
+void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
+ * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
  */
-struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
+struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o);
 
 /**
- * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
+ * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
  */
-struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
+bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
+ * Frees any resources used by the CResult_ChannelShutdownStateDecodeErrorZ.
  */
-void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
+void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
-struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
+void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
 
 /**
- * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
+ * Creates a new CResult_HeldHtlcAvailableDecodeErrorZ in the success state.
  */
-struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_HeldHtlcAvailableDecodeErrorZ CResult_HeldHtlcAvailableDecodeErrorZ_ok(struct LDKHeldHtlcAvailable o);
+
+/**
+ * Creates a new CResult_HeldHtlcAvailableDecodeErrorZ in the error state.
+ */
+struct LDKCResult_HeldHtlcAvailableDecodeErrorZ CResult_HeldHtlcAvailableDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
+bool CResult_HeldHtlcAvailableDecodeErrorZ_is_ok(const struct LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
+ * Frees any resources used by the CResult_HeldHtlcAvailableDecodeErrorZ.
  */
-void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
+void CResult_HeldHtlcAvailableDecodeErrorZ_free(struct LDKCResult_HeldHtlcAvailableDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_HeldHtlcAvailableDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_HeldHtlcAvailableDecodeErrorZ CResult_HeldHtlcAvailableDecodeErrorZ_clone(const struct LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
+ * Creates a new CResult_ReleaseHeldHtlcDecodeErrorZ in the success state.
  */
-struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
+struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ CResult_ReleaseHeldHtlcDecodeErrorZ_ok(struct LDKReleaseHeldHtlc o);
 
 /**
- * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
+ * Creates a new CResult_ReleaseHeldHtlcDecodeErrorZ in the error state.
  */
-struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
+struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ CResult_ReleaseHeldHtlcDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
+bool CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok(const struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
+ * Frees any resources used by the CResult_ReleaseHeldHtlcDecodeErrorZ.
  */
-void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
+void CResult_ReleaseHeldHtlcDecodeErrorZ_free(struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
+ * Creates a new CResult_ReleaseHeldHtlcDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
+struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ CResult_ReleaseHeldHtlcDecodeErrorZ_clone(const struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
+ * Creates a new CResult_AsyncPaymentsMessageDecodeErrorZ in the success state.
  */
-struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ CResult_AsyncPaymentsMessageDecodeErrorZ_ok(struct LDKAsyncPaymentsMessage o);
+
+/**
+ * Creates a new CResult_AsyncPaymentsMessageDecodeErrorZ in the error state.
+ */
+struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ CResult_AsyncPaymentsMessageDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
+bool CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok(const struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
+ * Frees any resources used by the CResult_AsyncPaymentsMessageDecodeErrorZ.
  */
-void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
+void CResult_AsyncPaymentsMessageDecodeErrorZ_free(struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_AsyncPaymentsMessageDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ CResult_AsyncPaymentsMessageDecodeErrorZ_clone(const struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
+ * Creates a new CResult_OffersMessageDecodeErrorZ in the success state.
  */
-struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
+struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o);
 
 /**
- * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
+ * Creates a new CResult_OffersMessageDecodeErrorZ in the error state.
  */
-struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
+struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
+bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
+ * Frees any resources used by the CResult_OffersMessageDecodeErrorZ.
  */
-void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
+void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the success state.
+ * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_ok(struct LDKCVec_ECDSASignatureZ o);
+struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the error state.
+ * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
  */
-struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_err(void);
+struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
 
 /**
- * Checks if the given object is currently in the success state
+ * Constructs a new COption_HTLCClaimZ containing nothing
  */
-bool CResult_CVec_ECDSASignatureZNoneZ_is_ok(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR o);
+struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
 
 /**
- * Frees any resources used by the CResult_CVec_ECDSASignatureZNoneZ.
+ * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
  */
-void CResult_CVec_ECDSASignatureZNoneZ_free(struct LDKCResult_CVec_ECDSASignatureZNoneZ _res);
+void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
 
 /**
- * Creates a new CResult_CVec_ECDSASignatureZNoneZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
+ * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
  */
-struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_clone(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR orig);
+struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
 
 /**
- * Constructs a new COption_usizeZ containing a usize
+ * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
  */
-struct LDKCOption_usizeZ COption_usizeZ_some(uintptr_t o);
+struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
- * Constructs a new COption_usizeZ containing nothing
+ * Checks if the given object is currently in the success state
  */
-struct LDKCOption_usizeZ COption_usizeZ_none(void);
+bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources associated with the usize, if we are in the Some state
+ * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
  */
-void COption_usizeZ_free(struct LDKCOption_usizeZ _res);
+void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
 
 /**
- * Creates a new COption_usizeZ which has the same data as `orig`
+ * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCOption_usizeZ COption_usizeZ_clone(const struct LDKCOption_usizeZ *NONNULL_PTR orig);
+struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
+ * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
  */
-struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
+struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
 
 /**
- * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
+ * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
  */
-struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
+bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
+ * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
  */
-void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
+void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_TxCreationKeysDecodeErrorZ 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);
+struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
+ * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
+
+/**
+ * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
+ */
+void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
+ */
+struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
+
+/**
+ * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
+ */
+struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
+ */
+void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
+ */
+struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
+
+/**
+ * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
+ */
+struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
+ */
+void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
+
+/**
+ * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
+ */
+void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
+ */
+struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
+
+/**
+ * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
+ */
+struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
+ */
+void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
+ */
+struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
+
+/**
+ * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
+ */
+struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
+ */
+void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
+ */
+struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
+
+/**
+ * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
+ */
+struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
+ */
+void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
+
+/**
+ * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
+ */
+struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
+
+/**
+ * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
+ */
+struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
+ */
+void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
+ */
+struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
+
+/**
+ * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
+ */
+struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
+ */
+void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
+
+/**
+ * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the success state.
+ */
+struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_ok(struct LDKCVec_ECDSASignatureZ o);
+
+/**
+ * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the error state.
+ */
+struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CVec_ECDSASignatureZNoneZ_is_ok(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CVec_ECDSASignatureZNoneZ.
+ */
+void CResult_CVec_ECDSASignatureZNoneZ_free(struct LDKCResult_CVec_ECDSASignatureZNoneZ _res);
+
+/**
+ * Creates a new CResult_CVec_ECDSASignatureZNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_clone(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_usizeZ containing a usize
+ */
+struct LDKCOption_usizeZ COption_usizeZ_some(uintptr_t o);
+
+/**
+ * Constructs a new COption_usizeZ containing nothing
+ */
+struct LDKCOption_usizeZ COption_usizeZ_none(void);
+
+/**
+ * Frees any resources associated with the usize, if we are in the Some state
+ */
+void COption_usizeZ_free(struct LDKCOption_usizeZ _res);
+
+/**
+ * Creates a new COption_usizeZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_usizeZ COption_usizeZ_clone(const struct LDKCOption_usizeZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
+
+/**
+ * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
+ */
+void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
  */
 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
 
@@ -31256,6 +33717,32 @@ struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInv
  */
 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
 
+/**
+ * Creates a new CResult_FundingInfoDecodeErrorZ in the success state.
+ */
+struct LDKCResult_FundingInfoDecodeErrorZ CResult_FundingInfoDecodeErrorZ_ok(struct LDKFundingInfo o);
+
+/**
+ * Creates a new CResult_FundingInfoDecodeErrorZ in the error state.
+ */
+struct LDKCResult_FundingInfoDecodeErrorZ CResult_FundingInfoDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_FundingInfoDecodeErrorZ_is_ok(const struct LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_FundingInfoDecodeErrorZ.
+ */
+void CResult_FundingInfoDecodeErrorZ_free(struct LDKCResult_FundingInfoDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_FundingInfoDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_FundingInfoDecodeErrorZ CResult_FundingInfoDecodeErrorZ_clone(const struct LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR orig);
+
 /**
  * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
  */
@@ -31450,77 +33937,77 @@ void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption
 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state.
+ * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
  */
-struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o);
+struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
 
 /**
- * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state.
+ * Constructs a new COption_PaymentFailureReasonZ containing nothing
  */
-struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
 
 /**
- * Checks if the given object is currently in the success state
+ * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
  */
-bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o);
+void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
 
 /**
- * Frees any resources used by the CResult_PaymentFailureReasonDecodeErrorZ.
+ * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res);
+struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
+ * Creates a new CResult_COption_PaymentFailureReasonZDecodeErrorZ in the success state.
  */
-struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok(struct LDKCOption_PaymentFailureReasonZ o);
 
 /**
- * Constructs a new COption_U128Z containing a crate::c_types::U128
+ * Creates a new CResult_COption_PaymentFailureReasonZDecodeErrorZ in the error state.
  */
-struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o);
+struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
- * Constructs a new COption_U128Z containing nothing
+ * Checks if the given object is currently in the success state
  */
-struct LDKCOption_U128Z COption_U128Z_none(void);
+bool CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
+ * Frees any resources used by the CResult_COption_PaymentFailureReasonZDecodeErrorZ.
  */
-void COption_U128Z_free(struct LDKCOption_U128Z _res);
+void CResult_COption_PaymentFailureReasonZDecodeErrorZ_free(struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ _res);
 
 /**
- * Creates a new COption_U128Z which has the same data as `orig`
+ * Creates a new CResult_COption_PaymentFailureReasonZDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCOption_U128Z COption_U128Z_clone(const struct LDKCOption_U128Z *NONNULL_PTR orig);
+struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ * Constructs a new COption_U128Z containing a crate::c_types::U128
  */
-void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res);
+struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o);
 
 /**
- * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
+ * Constructs a new COption_U128Z containing nothing
  */
-struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
+struct LDKCOption_U128Z COption_U128Z_none(void);
 
 /**
- * Constructs a new COption_PaymentFailureReasonZ containing nothing
+ * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
  */
-struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
+void COption_U128Z_free(struct LDKCOption_U128Z _res);
 
 /**
- * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
+ * Creates a new COption_U128Z which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
+struct LDKCOption_U128Z COption_U128Z_clone(const struct LDKCOption_U128Z *NONNULL_PTR orig);
 
 /**
- * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
-struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
+void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res);
 
 /**
  * Constructs a new COption_EventZ containing a crate::lightning::events::Event
@@ -31569,6 +34056,37 @@ void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDec
  */
 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
 
+/**
+ * Creates a new CResult_NonceDecodeErrorZ in the success state.
+ */
+struct LDKCResult_NonceDecodeErrorZ CResult_NonceDecodeErrorZ_ok(struct LDKNonce o);
+
+/**
+ * Creates a new CResult_NonceDecodeErrorZ in the error state.
+ */
+struct LDKCResult_NonceDecodeErrorZ CResult_NonceDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NonceDecodeErrorZ_is_ok(const struct LDKCResult_NonceDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NonceDecodeErrorZ.
+ */
+void CResult_NonceDecodeErrorZ_free(struct LDKCResult_NonceDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_NonceDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NonceDecodeErrorZ CResult_NonceDecodeErrorZ_clone(const struct LDKCResult_NonceDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
+
 /**
  * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the success state.
  */
@@ -31876,6 +34394,32 @@ void CResult_BigSizeDecodeErrorZ_free(struct LDKCResult_BigSizeDecodeErrorZ _res
  */
 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig);
 
+/**
+ * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
+ */
+struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
+
+/**
+ * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
+ */
+struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
+ */
+void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
+
 /**
  * Creates a new CResult_HostnameDecodeErrorZ in the success state.
  */
@@ -31955,72 +34499,103 @@ void CResult_TransactionU16LenLimitedDecodeErrorZ_free(struct LDKCResult_Transac
 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
+ * Creates a new CResult_ChannelIdDecodeErrorZ in the success state.
  */
-struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
+struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_ok(struct LDKChannelId o);
 
 /**
- * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
+ * Creates a new CResult_ChannelIdDecodeErrorZ in the error state.
  */
-struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
+bool CResult_ChannelIdDecodeErrorZ_is_ok(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
+ * Frees any resources used by the CResult_ChannelIdDecodeErrorZ.
  */
-void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
+void CResult_ChannelIdDecodeErrorZ_free(struct LDKCResult_ChannelIdDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_ChannelIdDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_clone(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_ChannelIdDecodeErrorZ in the success state.
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_ok(struct LDKChannelId o);
+struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_clone(const struct LDKC2Tuple__u832u16Z *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_ChannelIdDecodeErrorZ in the error state.
+ * Creates a new C2Tuple__u832u16Z from the contained elements.
  */
-struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_new(struct LDKThirtyTwoBytes a, uint16_t b);
+
+/**
+ * Frees any resources used by the C2Tuple__u832u16Z.
+ */
+void C2Tuple__u832u16Z_free(struct LDKC2Tuple__u832u16Z _res);
+
+/**
+ * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
+ */
+struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
+
+/**
+ * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
+ */
+struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_ChannelIdDecodeErrorZ_is_ok(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR o);
+bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_ChannelIdDecodeErrorZ.
+ * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
  */
-void CResult_ChannelIdDecodeErrorZ_free(struct LDKCResult_ChannelIdDecodeErrorZ _res);
+void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_ChannelIdDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_clone(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new tuple which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
+ * Creates a new CResult_BlindedPaymentPathNoneZ in the success state.
  */
-struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_clone(const struct LDKC2Tuple__u832u16Z *NONNULL_PTR orig);
+struct LDKCResult_BlindedPaymentPathNoneZ CResult_BlindedPaymentPathNoneZ_ok(struct LDKBlindedPaymentPath o);
 
 /**
- * Creates a new C2Tuple__u832u16Z from the contained elements.
+ * Creates a new CResult_BlindedPaymentPathNoneZ in the error state.
  */
-struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_new(struct LDKThirtyTwoBytes a, uint16_t b);
+struct LDKCResult_BlindedPaymentPathNoneZ CResult_BlindedPaymentPathNoneZ_err(void);
 
 /**
- * Frees any resources used by the C2Tuple__u832u16Z.
+ * Checks if the given object is currently in the success state
  */
-void C2Tuple__u832u16Z_free(struct LDKC2Tuple__u832u16Z _res);
+bool CResult_BlindedPaymentPathNoneZ_is_ok(const struct LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BlindedPaymentPathNoneZ.
+ */
+void CResult_BlindedPaymentPathNoneZ_free(struct LDKCResult_BlindedPaymentPathNoneZ _res);
+
+/**
+ * Creates a new CResult_BlindedPaymentPathNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_BlindedPaymentPathNoneZ CResult_BlindedPaymentPathNoneZ_clone(const struct LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_PaymentForwardNodeZ_free(struct LDKCVec_PaymentForwardNodeZ _res);
 
 /**
  * Creates a new CResult_PaymentRelayDecodeErrorZ in the success state.
@@ -32179,104 +34754,83 @@ void CResult_Bolt12RefundContextDecodeErrorZ_free(struct LDKCResult_Bolt12Refund
 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_StrSecp256k1ErrorZ in the success state.
+ * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
  */
-struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_ok(struct LDKStr o);
+struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
 
 /**
- * Creates a new CResult_StrSecp256k1ErrorZ in the error state.
+ * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
  */
-struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
+struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_StrSecp256k1ErrorZ_is_ok(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR o);
+bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_StrSecp256k1ErrorZ.
+ * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
  */
-void CResult_StrSecp256k1ErrorZ_free(struct LDKCResult_StrSecp256k1ErrorZ _res);
+void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
 
 /**
- * Creates a new CResult_StrSecp256k1ErrorZ which has the same data as `orig`
+ * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_clone(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR orig);
+struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new tuple which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
+ * Creates a new CResult_ResponderDecodeErrorZ in the success state.
  */
-struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR orig);
+struct LDKCResult_ResponderDecodeErrorZ CResult_ResponderDecodeErrorZ_ok(struct LDKResponder o);
 
 /**
- * Creates a new C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ from the contained elements.
+ * Creates a new CResult_ResponderDecodeErrorZ in the error state.
  */
-struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(struct LDKThirtyTwoBytes a, struct LDKRecipientOnionFields b, struct LDKRouteParameters c);
+struct LDKCResult_ResponderDecodeErrorZ CResult_ResponderDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
- * Frees any resources used by the C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.
+ * Checks if the given object is currently in the success state
  */
-void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res);
+bool CResult_ResponderDecodeErrorZ_is_ok(const struct LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the success state.
+ * Frees any resources used by the CResult_ResponderDecodeErrorZ.
  */
-struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o);
+void CResult_ResponderDecodeErrorZ_free(struct LDKCResult_ResponderDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the error state.
+ * Creates a new CResult_ResponderDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(void);
+struct LDKCResult_ResponderDecodeErrorZ CResult_ResponderDecodeErrorZ_clone(const struct LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Checks if the given object is currently in the success state
+ * Constructs a new COption_MessageContextZ containing a crate::lightning::blinded_path::message::MessageContext
  */
-bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR o);
+struct LDKCOption_MessageContextZ COption_MessageContextZ_some(struct LDKMessageContext o);
 
 /**
- * Frees any resources used by the CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.
+ * Constructs a new COption_MessageContextZ containing nothing
  */
-void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res);
+struct LDKCOption_MessageContextZ COption_MessageContextZ_none(void);
 
 /**
- * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
+ * Frees any resources associated with the crate::lightning::blinded_path::message::MessageContext, if we are in the Some state
  */
-struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR orig);
+void COption_MessageContextZ_free(struct LDKCOption_MessageContextZ _res);
 
 /**
- * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
+ * Creates a new COption_MessageContextZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
+struct LDKCOption_MessageContextZ COption_MessageContextZ_clone(const struct LDKCOption_MessageContextZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
-
-/**
- * Checks if the given object is currently in the success state
- */
-bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
-
-/**
- * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
- */
-void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
-
-/**
- * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
- */
-struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
-
-/**
- * Creates a new tuple which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
- */
-struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(const struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR orig);
+struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(const struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR orig);
 
 /**
  * Creates a new C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ from the contained elements.
@@ -32367,113 +34921,87 @@ void CResult_SendSuccessSendErrorZ_free(struct LDKCResult_SendSuccessSendErrorZ
 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_clone(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_BlindedPathNoneZ in the success state.
+ * Creates a new CResult_NoneSendErrorZ in the success state.
  */
-struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
+struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void);
 
 /**
- * Creates a new CResult_BlindedPathNoneZ in the error state.
+ * Creates a new CResult_NoneSendErrorZ in the error state.
  */
-struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
+struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
+bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_BlindedPathNoneZ.
+ * Frees any resources used by the CResult_NoneSendErrorZ.
  */
-void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
+void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res);
 
 /**
- * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
+ * Creates a new CResult_NoneSendErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
+struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_clone(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the success state.
+ * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
  */
-struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ o);
+struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
 
 /**
- * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the error state.
+ * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
  */
-struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(void);
+struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR o);
+bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.
+ * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
  */
-void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res);
+void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ which has the same data as `orig`
+ * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR orig);
+struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
 
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
-void CVec_ForwardNodeZ_free(struct LDKCVec_ForwardNodeZ _res);
-
-/**
- * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
- */
-struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
-
-/**
- * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
- */
-struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
-
-/**
- * Checks if the given object is currently in the success state
- */
-bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
-
-/**
- * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
- */
-void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
-
-/**
- * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
- */
-struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
+void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
 
 /**
- * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
+ * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state.
  */
-struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
+struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o);
 
 /**
- * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
+ * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state.
  */
-struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
+bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
+ * Frees any resources used by the CResult_Bolt11InvoiceSignOrCreationErrorZ.
  */
-void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
+void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res);
 
 /**
- * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
 
 /**
  * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state.
@@ -32820,31 +35348,130 @@ void C2Tuple_OutPointChannelIdZ_free(struct LDKC2Tuple_OutPointChannelIdZ _res);
  */
 void CVec_C2Tuple_OutPointChannelIdZZ_free(struct LDKCVec_C2Tuple_OutPointChannelIdZZ _res);
 
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_OutPointCVec_u64ZZ C2Tuple_OutPointCVec_u64ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_OutPointCVec_u64ZZ from the contained elements.
+ */
+struct LDKC2Tuple_OutPointCVec_u64ZZ C2Tuple_OutPointCVec_u64ZZ_new(struct LDKOutPoint a, struct LDKCVec_u64Z b);
+
+/**
+ * Frees any resources used by the C2Tuple_OutPointCVec_u64ZZ.
+ */
+void C2Tuple_OutPointCVec_u64ZZ_free(struct LDKC2Tuple_OutPointCVec_u64ZZ _res);
+
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
-void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
+void CVec_C2Tuple_OutPointCVec_u64ZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_u64ZZZ _res);
 
 /**
- * Creates a new tuple which has the same data as `orig`
+ * Creates a new CResult_BlindedMessagePathDecodeErrorZ in the success state.
+ */
+struct LDKCResult_BlindedMessagePathDecodeErrorZ CResult_BlindedMessagePathDecodeErrorZ_ok(struct LDKBlindedMessagePath o);
+
+/**
+ * Creates a new CResult_BlindedMessagePathDecodeErrorZ in the error state.
+ */
+struct LDKCResult_BlindedMessagePathDecodeErrorZ CResult_BlindedMessagePathDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_BlindedMessagePathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BlindedMessagePathDecodeErrorZ.
+ */
+void CResult_BlindedMessagePathDecodeErrorZ_free(struct LDKCResult_BlindedMessagePathDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_BlindedMessagePathDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
+struct LDKCResult_BlindedMessagePathDecodeErrorZ CResult_BlindedMessagePathDecodeErrorZ_clone(const struct LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
+ * Creates a new CResult_BlindedMessagePathNoneZ in the success state.
  */
-struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
+struct LDKCResult_BlindedMessagePathNoneZ CResult_BlindedMessagePathNoneZ_ok(struct LDKBlindedMessagePath o);
 
 /**
- * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
+ * Creates a new CResult_BlindedMessagePathNoneZ in the error state.
  */
-void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
+struct LDKCResult_BlindedMessagePathNoneZ CResult_BlindedMessagePathNoneZ_err(void);
 
 /**
- * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_BlindedMessagePathNoneZ_is_ok(const struct LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BlindedMessagePathNoneZ.
+ */
+void CResult_BlindedMessagePathNoneZ_free(struct LDKCResult_BlindedMessagePathNoneZ _res);
+
+/**
+ * Creates a new CResult_BlindedMessagePathNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_BlindedMessagePathNoneZ CResult_BlindedMessagePathNoneZ_clone(const struct LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_MessageContextDecodeErrorZ in the success state.
+ */
+struct LDKCResult_MessageContextDecodeErrorZ CResult_MessageContextDecodeErrorZ_ok(struct LDKMessageContext o);
+
+/**
+ * Creates a new CResult_MessageContextDecodeErrorZ in the error state.
+ */
+struct LDKCResult_MessageContextDecodeErrorZ CResult_MessageContextDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_MessageContextDecodeErrorZ_is_ok(const struct LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_MessageContextDecodeErrorZ.
  */
-void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
+void CResult_MessageContextDecodeErrorZ_free(struct LDKCResult_MessageContextDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_MessageContextDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_MessageContextDecodeErrorZ CResult_MessageContextDecodeErrorZ_clone(const struct LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_OffersContextDecodeErrorZ in the success state.
+ */
+struct LDKCResult_OffersContextDecodeErrorZ CResult_OffersContextDecodeErrorZ_ok(struct LDKOffersContext o);
+
+/**
+ * Creates a new CResult_OffersContextDecodeErrorZ in the error state.
+ */
+struct LDKCResult_OffersContextDecodeErrorZ CResult_OffersContextDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OffersContextDecodeErrorZ_is_ok(const struct LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OffersContextDecodeErrorZ.
+ */
+void CResult_OffersContextDecodeErrorZ_free(struct LDKCResult_OffersContextDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_OffersContextDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OffersContextDecodeErrorZ CResult_OffersContextDecodeErrorZ_clone(const struct LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR orig);
 
 /**
  * Frees any resources used by the APIError
@@ -32943,6 +35570,16 @@ struct LDKCVec_u8Z BigSize_write(const struct LDKBigSize *NONNULL_PTR obj);
  */
 struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser);
 
+/**
+ * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
+ */
+struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
+
+/**
+ * Read a UntrustedString from a byte array, created by UntrustedString_write
+ */
+struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
+
 /**
  * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
  */
@@ -32970,6 +35607,11 @@ bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostna
  */
 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
 
+/**
+ * Get the string representation of a Hostname object
+ */
+struct LDKStr Hostname_to_str(const struct LDKHostname *NONNULL_PTR o);
+
 /**
  * Serialize the Hostname object into a byte array which can be read by Hostname_read
  */
@@ -33033,7 +35675,7 @@ struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_
  * 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_StrSecp256k1ErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
+struct LDKStr sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
 
 /**
  * Recovers the PublicKey of the signer of the message given the message and the signature.
@@ -33046,11 +35688,6 @@ struct LDKCResult_PublicKeySecp256k1ErrorZ recover_pk(struct LDKu8slice msg, str
  */
 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
 
-/**
- * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
- */
-struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
-
 /**
  * Calls the free function if one is set
  */
@@ -33089,7 +35726,7 @@ void MonitorUpdatingPersister_free(struct LDKMonitorUpdatingPersister this_obj);
  *   - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run
  * [`MonitorUpdatingPersister::cleanup_stale_updates`].
  */
-MUST_USE_RES struct LDKMonitorUpdatingPersister MonitorUpdatingPersister_new(struct LDKKVStore kv_store, struct LDKLogger logger, uint64_t maximum_pending_updates, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
+MUST_USE_RES struct LDKMonitorUpdatingPersister MonitorUpdatingPersister_new(struct LDKKVStore kv_store, struct LDKLogger logger, uint64_t maximum_pending_updates, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator);
 
 /**
  * Reads all stored channel monitors, along with any stored updates for them.
@@ -33098,7 +35735,7 @@ MUST_USE_RES struct LDKMonitorUpdatingPersister MonitorUpdatingPersister_new(str
  * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
  * documentation for [`MonitorUpdatingPersister`].
  */
-MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ MonitorUpdatingPersister_read_all_channel_monitors_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator);
+MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ MonitorUpdatingPersister_read_all_channel_monitors_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg);
 
 /**
  * Read a single channel monitor, along with any stored updates for it.
@@ -33119,7 +35756,7 @@ MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErro
  * Loading a large number of monitors will be faster if done in parallel. You can use this
  * function to accomplish this. Take care to limit the number of parallel readers.
  */
-MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ MonitorUpdatingPersister_read_channel_monitor_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, struct LDKStr monitor_key);
+MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ MonitorUpdatingPersister_read_channel_monitor_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, struct LDKStr monitor_key);
 
 /**
  * Cleans up stale updates for all monitors.
@@ -33184,61 +35821,6 @@ uint16_t vout_from_scid(uint64_t short_channel_id);
  */
 struct LDKCResult_u64ShortChannelIdErrorZ scid_from_parts(uint64_t block, uint64_t tx_index, uint64_t vout_index);
 
-/**
- * Frees any resources used by the UntrustedString, if is_owned is set and inner is non-NULL.
- */
-void UntrustedString_free(struct LDKUntrustedString this_obj);
-
-struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr);
-
-void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val);
-
-/**
- * Constructs a new UntrustedString given each field
- */
-MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg);
-
-/**
- * Creates a copy of the UntrustedString
- */
-struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig);
-
-/**
- * Checks if two UntrustedStrings 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 UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b);
-
-/**
- * Generates a non-cryptographic 64-bit hash of the UntrustedString.
- */
-uint64_t UntrustedString_hash(const struct LDKUntrustedString *NONNULL_PTR o);
-
-/**
- * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
- */
-struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
-
-/**
- * Read a UntrustedString from a byte array, created by UntrustedString_write
- */
-struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
-
-/**
- * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
- */
-void PrintableString_free(struct LDKPrintableString this_obj);
-
-struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
-
-void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
-
-/**
- * Constructs a new PrintableString given each field
- */
-MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
-
 /**
  * Frees any resources used by the TrackedSpendableOutput, if is_owned is set and inner is non-NULL.
  */
@@ -33487,6 +36069,12 @@ MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(const struct LDKFuture
  */
 MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(const struct LDKFuture *NONNULL_PTR fut_a, const struct LDKFuture *NONNULL_PTR fut_b);
 
+/**
+ * Constructs a new sleeper from three futures, allowing blocking on all three at once.
+ *
+ */
+MUST_USE_RES struct LDKSleeper Sleeper_from_three_futures(const struct LDKFuture *NONNULL_PTR fut_a, const struct LDKFuture *NONNULL_PTR fut_b, const struct LDKFuture *NONNULL_PTR fut_c);
+
 /**
  * Constructs a new sleeper on many futures, allowing blocking on all at once.
  */
@@ -33550,6 +36138,11 @@ bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_P
  */
 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
 
+/**
+ * Get the string representation of a Level object
+ */
+struct LDKStr Level_to_str(const enum LDKLevel *NONNULL_PTR o);
+
 /**
  * Returns the most verbose logging level.
  */
@@ -33648,13 +36241,29 @@ uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
  */
 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
 
+/**
+ * The payment hash.
+ *
+ * Note that this is only filled in for logs pertaining to a specific payment, and will be
+ * `None` for logs which are not directly related to a payment.
+ */
+struct LDKCOption_ThirtyTwoBytesZ Record_get_payment_hash(const struct LDKRecord *NONNULL_PTR this_ptr);
+
+/**
+ * The payment hash.
+ *
+ * Note that this is only filled in for logs pertaining to a specific payment, and will be
+ * `None` for logs which are not directly related to a payment.
+ */
+void Record_set_payment_hash(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
+
 /**
  * Constructs a new Record given each field
  *
  * Note that peer_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKRecord Record_new(enum LDKLevel level_arg, struct LDKPublicKey peer_id_arg, struct LDKChannelId channel_id_arg, struct LDKStr args_arg, struct LDKStr module_path_arg, struct LDKStr file_arg, uint32_t line_arg);
+MUST_USE_RES struct LDKRecord Record_new(enum LDKLevel level_arg, struct LDKPublicKey peer_id_arg, struct LDKChannelId channel_id_arg, struct LDKStr args_arg, struct LDKStr module_path_arg, struct LDKStr file_arg, uint32_t line_arg, struct LDKCOption_ThirtyTwoBytesZ payment_hash_arg);
 
 /**
  * Creates a copy of the Record
@@ -33673,15 +36282,15 @@ void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
 
 /**
  * Confirmations we will wait for before considering the channel locked in.
- * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
+ * Applied only for inbound channels (see [`ChannelHandshakeLimits::max_minimum_depth`] for the
  * equivalent limit applied to outbound channels).
  *
- * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
+ * A lower-bound of `1` is applied, requiring all channels to have a confirmed commitment
  * transaction before operation. If you wish to accept channels with zero confirmations, see
  * [`UserConfig::manually_accept_inbound_channels`] and
  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
  *
- * Default value: 6.
+ * Default value: `6`
  *
  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
@@ -33690,15 +36299,15 @@ uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandsha
 
 /**
  * Confirmations we will wait for before considering the channel locked in.
- * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
+ * Applied only for inbound channels (see [`ChannelHandshakeLimits::max_minimum_depth`] for the
  * equivalent limit applied to outbound channels).
  *
- * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
+ * A lower-bound of `1` is applied, requiring all channels to have a confirmed commitment
  * transaction before operation. If you wish to accept channels with zero confirmations, see
  * [`UserConfig::manually_accept_inbound_channels`] and
  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
  *
- * Default value: 6.
+ * Default value: `6`
  *
  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
@@ -33719,8 +36328,8 @@ void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *
  * case of an honest unilateral channel close, which implicitly decrease the economic value of
  * our channel.
  *
- * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
- * can tweak config to ask for more security, not less.
+ * Default value: [`BREAKDOWN_TIMEOUT`] (We enforce it as a minimum at channel opening so you
+ * can tweak config to ask for more security, not less.)
  */
 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
 
@@ -33738,8 +36347,8 @@ uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHan
  * case of an honest unilateral channel close, which implicitly decrease the economic value of
  * our channel.
  *
- * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
- * can tweak config to ask for more security, not less.
+ * Default value: [`BREAKDOWN_TIMEOUT`] (We enforce it as a minimum at channel opening so you
+ * can tweak config to ask for more security, not less.)
  */
 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
 
@@ -33749,8 +36358,8 @@ void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConf
  * This value is sent to our counterparty on channel-open and we close the channel any time
  * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
  *
- * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
- * by the protocol.
+ * Default value: `1` (If the value is less than `1`, it is ignored and set to `1`, as is
+ * required by the protocol.
  */
 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
 
@@ -33760,8 +36369,8 @@ uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChanne
  * This value is sent to our counterparty on channel-open and we close the channel any time
  * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
  *
- * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
- * by the protocol.
+ * Default value: `1` (If the value is less than `1`, it is ignored and set to `1`, as is
+ * required by the protocol.
  */
 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
 
@@ -33773,22 +36382,24 @@ void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshake
  * channel value in whole percentages.
  *
  * Note that:
- * * If configured to another value than the default value 10, any new channels created with
- * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
- * `ChannelManager`.
+ * * If configured to another value than the default value `10`, any new channels created with
+ *   the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
+ *   `ChannelManager`.
  *
  * * This caps the total value for inbound HTLCs in-flight only, and there's currently
- * no way to configure the cap for the total value of outbound HTLCs in-flight.
+ *   no way to configure the cap for the total value of outbound HTLCs in-flight.
  *
  * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
- * are different from the non-HTLC-encumbered funds. This makes this an important knob to
- * restrict exposure to loss due to being offline for too long.
- * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
- * for more information.
+ *   are different from the non-HTLC-encumbered funds. This makes this an important knob to
+ *   restrict exposure to loss due to being offline for too long.
+ *   See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
+ *   for more information.
+ *
+ * Default value: `10`
  *
- * Default value: 10.
- * Minimum value: 1, any values less than 1 will be treated as 1 instead.
- * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
+ * Minimum value: `1` (Any values less will be treated as `1` instead.)
+ *
+ * Maximum value: `100` (Any values larger will be treated as `100` instead.)
  */
 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
 
@@ -33800,22 +36411,24 @@ uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_c
  * channel value in whole percentages.
  *
  * Note that:
- * * If configured to another value than the default value 10, any new channels created with
- * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
- * `ChannelManager`.
+ * * If configured to another value than the default value `10`, any new channels created with
+ *   the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
+ *   `ChannelManager`.
  *
  * * This caps the total value for inbound HTLCs in-flight only, and there's currently
- * no way to configure the cap for the total value of outbound HTLCs in-flight.
+ *   no way to configure the cap for the total value of outbound HTLCs in-flight.
  *
  * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
- * are different from the non-HTLC-encumbered funds. This makes this an important knob to
- * restrict exposure to loss due to being offline for too long.
- * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
- * for more information.
+ *   are different from the non-HTLC-encumbered funds. This makes this an important knob to
+ *   restrict exposure to loss due to being offline for too long.
+ *   See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
+ *   for more information.
+ *
+ * Default value: `10`
  *
- * Default value: 10.
- * Minimum value: 1, any values less than 1 will be treated as 1 instead.
- * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
+ * Minimum value: `1` (Any values less will be treated as `1` instead.)
+ *
+ * Maximum value: `100` (Any values larger will be treated as `100` instead.)
  */
 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
 
@@ -33834,10 +36447,10 @@ void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_chan
  * private channel without that option.
  *
  * Ignored if the channel is negotiated to be announced, see
- * [`ChannelHandshakeConfig::announced_channel`] and
+ * [`ChannelHandshakeConfig::announce_for_forwarding`] and
  * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
  *
- * Default value: false. This value is likely to change to true in the future.
+ * Default value: `false` (This value is likely to change to `true` in the future.)
  *
  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
@@ -33859,10 +36472,10 @@ bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHa
  * private channel without that option.
  *
  * Ignored if the channel is negotiated to be announced, see
- * [`ChannelHandshakeConfig::announced_channel`] and
+ * [`ChannelHandshakeConfig::announce_for_forwarding`] and
  * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
  *
- * Default value: false. This value is likely to change to true in the future.
+ * Default value: `false` (This value is likely to change to `true` in the future.)
  *
  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
@@ -33878,9 +36491,9 @@ void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshak
  * As the node which funds a channel picks this value this will only apply for new outbound
  * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
  *
- * Default value: false.
+ * Default value: `false`
  */
-bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
+bool ChannelHandshakeConfig_get_announce_for_forwarding(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
 
 /**
  * Set to announce the channel publicly and notify all nodes that they can route via this
@@ -33891,9 +36504,9 @@ bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandsha
  * As the node which funds a channel picks this value this will only apply for new outbound
  * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
  *
- * Default value: false.
+ * Default value: `false`
  */
-void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
+void ChannelHandshakeConfig_set_announce_for_forwarding(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
 
 /**
  * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
@@ -33906,7 +36519,7 @@ void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConf
  *
  * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
  *
- * Default value: true.
+ * Default value: `true`
  *
  * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
  */
@@ -33923,7 +36536,7 @@ bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKC
  *
  * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
  *
- * Default value: true.
+ * Default value: `true`
  *
  * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
  */
@@ -33947,11 +36560,15 @@ void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannel
  * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
  * other than the default value.
  *
- * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
- * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
- *                as 1000 sats instead, which is a safe implementation-specific lower bound.
- * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
- *                instead, although channel negotiations will fail in that case.
+ * Default value: `10_000` millionths (i.e., 1% of channel value)
+ *
+ * Minimum value: If the calculated proportional value is less than `1000` sats, it will be
+ *                treated as `1000` sats instead, which is a safe implementation-specific lower
+ *                bound.
+ *
+ * Maximum value: `1_000_000` (i.e., 100% of channel value. Any values larger than one million
+ *                will be treated as one million instead, although channel negotiations will
+ *                fail in that case.)
  */
 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
 
@@ -33973,45 +36590,17 @@ uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionth
  * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
  * other than the default value.
  *
- * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
- * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
- *                as 1000 sats instead, which is a safe implementation-specific lower bound.
- * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
- *                instead, although channel negotiations will fail in that case.
- */
-void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
-
-/**
- * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
- * channels. This feature requires having a reserve of onchain funds readily available to bump
- * transactions in the event of a channel force close to avoid the possibility of losing funds.
- *
- * Note that if you wish accept inbound channels with anchor outputs, you must enable
- * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
- * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
- * whether your reserve of onchain funds is enough to cover the fees for all existing and new
- * channels featuring anchor outputs in the event of a force close.
- *
- * If this option is set, channels may be created that will not be readable by LDK versions
- * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
- * [`DecodeError::InvalidValue`].
- *
- * Note that setting this to true does *not* prevent us from opening channels with
- * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
- * fall back to a `static_remote_key` channel.
- *
- * LDK will not support the legacy `option_anchors` commitment version due to a discovered
- * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
- * Considered Harmful`] mailing list post.
+ * Default value: `10_000` millionths (i.e., 1% of channel value)
  *
- * Default value: false. This value is likely to change to true in the future.
+ * Minimum value: If the calculated proportional value is less than `1000` sats, it will be
+ *                treated as `1000` sats instead, which is a safe implementation-specific lower
+ *                bound.
  *
- * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
- * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
- * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
- * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
+ * Maximum value: `1_000_000` (i.e., 100% of channel value. Any values larger than one million
+ *                will be treated as one million instead, although channel negotiations will
+ *                fail in that case.)
  */
-bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
+void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
  * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
@@ -34036,7 +36625,39 @@ bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct
  * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
  * Considered Harmful`] mailing list post.
  *
- * Default value: false. This value is likely to change to true in the future.
+ * Default value: `false` (This value is likely to change to `true` in the future.)
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
+ * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
+ */
+bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
+
+/**
+ * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
+ * channels. This feature requires having a reserve of onchain funds readily available to bump
+ * transactions in the event of a channel force close to avoid the possibility of losing funds.
+ *
+ * Note that if you wish accept inbound channels with anchor outputs, you must enable
+ * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
+ * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
+ * whether your reserve of onchain funds is enough to cover the fees for all existing and new
+ * channels featuring anchor outputs in the event of a force close.
+ *
+ * If this option is set, channels may be created that will not be readable by LDK versions
+ * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
+ * [`DecodeError::InvalidValue`].
+ *
+ * Note that setting this to true does *not* prevent us from opening channels with
+ * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
+ * fall back to a `static_remote_key` channel.
+ *
+ * LDK will not support the legacy `option_anchors` commitment version due to a discovered
+ * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
+ * Considered Harmful`] mailing list post.
+ *
+ * Default value: `false` (This value is likely to change to `true` in the future.)
  *
  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
@@ -34054,9 +36675,10 @@ void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(struct LDKCha
  * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
  * other than the default value.
  *
- * Default value: 50
- * Maximum value: 483, any values larger will be treated as 483.
- *                     This is the BOLT #2 spec limit on `max_accepted_htlcs`.
+ * Default value: `50`
+ *
+ * Maximum value: `483` (Any values larger will be treated as `483`. This is the BOLT #2 spec
+ * limit on `max_accepted_htlcs`.)
  */
 uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
 
@@ -34069,16 +36691,17 @@ uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChann
  * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
  * other than the default value.
  *
- * Default value: 50
- * Maximum value: 483, any values larger will be treated as 483.
- *                     This is the BOLT #2 spec limit on `max_accepted_htlcs`.
+ * Default value: `50`
+ *
+ * Maximum value: `483` (Any values larger will be treated as `483`. This is the BOLT #2 spec
+ * limit on `max_accepted_htlcs`.)
  */
 void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
  * Constructs a new ChannelHandshakeConfig given each field
  */
-MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg, uint8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, uint32_t their_channel_reserve_proportional_millionths_arg, bool negotiate_anchors_zero_fee_htlc_tx_arg, uint16_t our_max_accepted_htlcs_arg);
+MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg, uint8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg, bool announce_for_forwarding_arg, bool commit_upfront_shutdown_pubkey_arg, uint32_t their_channel_reserve_proportional_millionths_arg, bool negotiate_anchors_zero_fee_htlc_tx_arg, uint16_t our_max_accepted_htlcs_arg);
 
 /**
  * Creates a copy of the ChannelHandshakeConfig
@@ -34099,7 +36722,8 @@ void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
  * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
  * only applies to inbound channels.
  *
- * Default value: 0.
+ * Default value: `1000`
+ * (Minimum of [`ChannelHandshakeConfig::their_channel_reserve_proportional_millionths`])
  */
 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
 
@@ -34107,7 +36731,8 @@ uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannel
  * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
  * only applies to inbound channels.
  *
- * Default value: 0.
+ * Default value: `1000`
+ * (Minimum of [`ChannelHandshakeConfig::their_channel_reserve_proportional_millionths`])
  */
 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
 
@@ -34115,7 +36740,7 @@ void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeL
  * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
  * only applies to inbound channels.
  *
- * Default value: 2^24 - 1.
+ * Default value: `2^24 - 1`
  */
 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
 
@@ -34123,7 +36748,7 @@ uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannel
  * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
  * only applies to inbound channels.
  *
- * Default value: 2^24 - 1.
+ * Default value: `2^24 - 1`
  */
 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
 
@@ -34131,7 +36756,7 @@ void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeL
  * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
  * you to limit the maximum minimum-size they can require.
  *
- * Default value: u64::max_value.
+ * Default value: `u64::max_value`
  */
 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
 
@@ -34139,7 +36764,7 @@ uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChanne
  * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
  * you to limit the maximum minimum-size they can require.
  *
- * Default value: u64::max_value.
+ * Default value: `u64::max_value`
  */
 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
 
@@ -34147,7 +36772,7 @@ void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshake
  * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
  * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
  *
- * Default value: 0.
+ * Default value: `0`
  */
 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
 
@@ -34155,7 +36780,7 @@ uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const stru
  * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
  * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
  *
- * Default value: 0.
+ * Default value: `0`
  */
 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
 
@@ -34164,7 +36789,7 @@ void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChan
  * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
  * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
  *
- * Default value: u64::max_value.
+ * Default value: `u64::max_value`.
  */
 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
 
@@ -34173,7 +36798,7 @@ uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LD
  * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
  * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
  *
- * Default value: u64::max_value.
+ * Default value: `u64::max_value`.
  */
 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
 
@@ -34181,7 +36806,7 @@ void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHa
  * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
  * time. This allows you to set a minimum such value.
  *
- * Default value: 0.
+ * Default value: `0`
  */
 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
 
@@ -34189,7 +36814,7 @@ uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChann
  * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
  * time. This allows you to set a minimum such value.
  *
- * Default value: 0.
+ * Default value: `0`
  */
 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
 
@@ -34199,7 +36824,7 @@ void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshak
  * assume they aren't going to double-spend themselves).
  * This config allows you to set a limit on the maximum amount of time to wait.
  *
- * Default value: 144, or roughly one day and only applies to outbound channels.
+ * Default value: `144`, or roughly one day and only applies to outbound channels
  */
 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
 
@@ -34209,7 +36834,7 @@ uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHan
  * assume they aren't going to double-spend themselves).
  * This config allows you to set a limit on the maximum amount of time to wait.
  *
- * Default value: 144, or roughly one day and only applies to outbound channels.
+ * Default value: `144`, or roughly one day and only applies to outbound channels
  */
 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
 
@@ -34225,12 +36850,12 @@ void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimi
  * You may wish to un-set this if you allow the user to (or do in an automated fashion)
  * double-spend the funding transaction to RBF with an alternative channel open.
  *
- * This only applies if our counterparty set their confirmations-required value to 0, and we
- * always trust our own funding transaction at 1 confirmation irrespective of this value.
+ * This only applies if our counterparty set their confirmations-required value to `0`, and we
+ * always trust our own funding transaction at `1` confirmation irrespective of this value.
  * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
- * `true` (0) and `false` (1).
+ * `true` (`0`) and `false` (`1`).
  *
- * Default value: true
+ * Default value: `true`
  */
 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
 
@@ -34246,36 +36871,36 @@ bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelH
  * You may wish to un-set this if you allow the user to (or do in an automated fashion)
  * double-spend the funding transaction to RBF with an alternative channel open.
  *
- * This only applies if our counterparty set their confirmations-required value to 0, and we
- * always trust our own funding transaction at 1 confirmation irrespective of this value.
+ * This only applies if our counterparty set their confirmations-required value to `0`, and we
+ * always trust our own funding transaction at `1` confirmation irrespective of this value.
  * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
- * `true` (0) and `false` (1).
+ * `true` (`0`) and `false` (`1`).
  *
- * Default value: true
+ * Default value: `true`
  */
 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
 
 /**
  * Set to force an incoming channel to match our announced channel preference in
- * [`ChannelHandshakeConfig::announced_channel`].
+ * [`ChannelHandshakeConfig::announce_for_forwarding`].
  *
  * For a node which is not online reliably, this should be set to true and
- * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
+ * [`ChannelHandshakeConfig::announce_for_forwarding`] set to false, ensuring that no announced (aka public)
  * channels will ever be opened.
  *
- * Default value: true.
+ * Default value: `true`
  */
 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
 
 /**
  * Set to force an incoming channel to match our announced channel preference in
- * [`ChannelHandshakeConfig::announced_channel`].
+ * [`ChannelHandshakeConfig::announce_for_forwarding`].
  *
  * For a node which is not online reliably, this should be set to true and
- * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
+ * [`ChannelHandshakeConfig::announce_for_forwarding`] set to false, ensuring that no announced (aka public)
  * channels will ever be opened.
  *
- * Default value: true.
+ * Default value: `true`
  */
 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
 
@@ -34285,7 +36910,7 @@ void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKCha
  * Not checking this value would be a security issue, as our peer would be able to set it to
  * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
  *
- * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
+ * Default value: `2016`, which we also enforce as a maximum value so you can tweak config to
  * reduce the loss of having useless locked funds (if your peer accepts)
  */
 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
@@ -34296,7 +36921,7 @@ uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelH
  * Not checking this value would be a security issue, as our peer would be able to set it to
  * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
  *
- * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
+ * Default value: `2016`, which we also enforce as a maximum value so you can tweak config to
  * reduce the loss of having useless locked funds (if your peer accepts)
  */
 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
@@ -34363,7 +36988,7 @@ void ChannelConfig_free(struct LDKChannelConfig this_obj);
  * 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.
+ * Default value: `0`
  */
 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
 
@@ -34373,7 +36998,7 @@ uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct L
  * 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.
+ * Default value: `0`
  */
 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
 
@@ -34387,7 +37012,7 @@ void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelC
  * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
  * this node.
  *
- * Default value: 1000.
+ * Default value: `1000`
  *
  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
  */
@@ -34403,7 +37028,7 @@ uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfi
  * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
  * this node.
  *
- * Default value: 1000.
+ * Default value: `1000`
  *
  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
  */
@@ -34424,9 +37049,10 @@ void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL
  * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
  * the spending transaction).
  *
- * Default value: 72 (12 hours at an average of 6 blocks/hour).
- * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
- *                [`MIN_CLTV_EXPIRY_DELTA`] instead.
+ * Default value: `72` (12 hours at an average of 6 blocks/hour)
+ *
+ * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`] (Any values less than this will be treated as
+ *                [`MIN_CLTV_EXPIRY_DELTA`] instead.)
  *
  * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
  */
@@ -34447,9 +37073,10 @@ uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONN
  * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
  * the spending transaction).
  *
- * Default value: 72 (12 hours at an average of 6 blocks/hour).
- * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
- *                [`MIN_CLTV_EXPIRY_DELTA`] instead.
+ * Default value: `72` (12 hours at an average of 6 blocks/hour)
+ *
+ * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`] (Any values less than this will be treated as
+ *                [`MIN_CLTV_EXPIRY_DELTA`] instead.)
  *
  * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
  */
@@ -34504,12 +37131,12 @@ void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR th
  * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement
  * will scale linearly with increases (or decreases) in the our feerate estimates. Further,
  * for anchor channels we expect our counterparty to use a relatively low feerate estimate
- * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and
- * feerate disagreement force-closures should only occur when theirs is higher than ours.
+ * while we use [`ConfirmationTarget::MaximumFeeEstimate`] (which should be relatively high)
+ * and feerate disagreement force-closures should only occur when theirs is higher than ours.
  *
- * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000.
+ * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of `10_000`
  *
- * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
+ * [`ConfirmationTarget::MaximumFeeEstimate`]: crate::chain::chaininterface::ConfirmationTarget::MaximumFeeEstimate
  */
 struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
 
@@ -34562,12 +37189,12 @@ struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const str
  * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement
  * will scale linearly with increases (or decreases) in the our feerate estimates. Further,
  * for anchor channels we expect our counterparty to use a relatively low feerate estimate
- * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and
- * feerate disagreement force-closures should only occur when theirs is higher than ours.
+ * while we use [`ConfirmationTarget::MaximumFeeEstimate`] (which should be relatively high)
+ * and feerate disagreement force-closures should only occur when theirs is higher than ours.
  *
- * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000.
+ * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of `10_000`
  *
- * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
+ * [`ConfirmationTarget::MaximumFeeEstimate`]: crate::chain::chaininterface::ConfirmationTarget::MaximumFeeEstimate
  */
 void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_PTR this_ptr, struct LDKMaxDustHTLCExposure val);
 
@@ -34590,7 +37217,7 @@ void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_P
  * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
  * Thus, this value is ignored when we are not the funder.
  *
- * Default value: 1000 satoshis.
+ * Default value: `1000`
  *
  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
  * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
@@ -34616,7 +37243,7 @@ uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct L
  * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
  * Thus, this value is ignored when we are not the funder.
  *
- * Default value: 1000 satoshis.
+ * Default value: `1000`
  *
  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
  * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
@@ -34647,7 +37274,7 @@ void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelC
  * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
  * Unsetting this flag between restarts may lead to payment receive failures.
  *
- * Default value: false.
+ * Default value: `false`
  *
  * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
  * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
@@ -34682,7 +37309,7 @@ bool ChannelConfig_get_accept_underpaying_htlcs(const struct LDKChannelConfig *N
  * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
  * Unsetting this flag between restarts may lead to payment receive failures.
  *
- * Default value: false.
+ * Default value: `false`
  *
  * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
  * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
@@ -34764,11 +37391,6 @@ void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(struct LDKCh
  */
 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_new(struct LDKCOption_u32Z forwarding_fee_proportional_millionths_arg, struct LDKCOption_u32Z forwarding_fee_base_msat_arg, struct LDKCOption_u16Z cltv_expiry_delta_arg, struct LDKCOption_MaxDustHTLCExposureZ max_dust_htlc_exposure_msat_arg, struct LDKCOption_u64Z force_close_avoidance_max_fee_satoshis_arg);
 
-/**
- * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used.
- */
-MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void);
-
 /**
  * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
  */
@@ -34805,13 +37427,13 @@ struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig
 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
 
 /**
- * If this is set to false, we will reject any HTLCs which were to be forwarded over private
+ * If this is set to `false`, we will reject any HTLCs which were to be forwarded over private
  * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
  * node which is not online reliably.
  *
  * For nodes which are not online reliably, you should set all channels to *not* be announced
- * (using [`ChannelHandshakeConfig::announced_channel`] and
- * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
+ * (using [`ChannelHandshakeConfig::announce_for_forwarding`] and
+ * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to `false` to
  * ensure you are not exposed to any forwarding risk.
  *
  * Note that because you cannot change a channel's announced state after creation, there is no
@@ -34820,18 +37442,18 @@ void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, s
  * 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.
+ * 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
+ * If this is set to `false`, we will reject any HTLCs which were to be forwarded over private
  * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
  * node which is not online reliably.
  *
  * For nodes which are not online reliably, you should set all channels to *not* be announced
- * (using [`ChannelHandshakeConfig::announced_channel`] and
- * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
+ * (using [`ChannelHandshakeConfig::announce_for_forwarding`] and
+ * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to `false` to
  * ensure you are not exposed to any forwarding risk.
  *
  * Note that because you cannot change a channel's announced state after creation, there is no
@@ -34840,32 +37462,34 @@ bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig
  * 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.
+ * Default value: `false`
  */
 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
 
 /**
- * If this is set to false, we do not accept inbound requests to open a new channel.
- * Default value: true.
+ * If this is set to `false`, we do not accept inbound requests to open a new channel.
+ *
+ * Default value: `true`
  */
 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
 
 /**
- * If this is set to false, we do not accept inbound requests to open a new channel.
- * Default value: true.
+ * If this is set to `false`, we do not accept inbound requests to open a new channel.
+ *
+ * Default value: `true`
  */
 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
 
 /**
- * If this is set to true, the user needs to manually accept inbound requests to open a new
+ * If this is set to `true`, the user needs to manually accept inbound requests to open a new
  * channel.
  *
- * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
+ * When set to `true`, [`Event::OpenChannelRequest`] will be triggered once a request to open a
  * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
  * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
  * user explicitly chooses to accept the request.
  *
- * Default value: false.
+ * Default value: `false`
  *
  * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
  * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
@@ -34874,15 +37498,15 @@ void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR th
 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
 
 /**
- * If this is set to true, the user needs to manually accept inbound requests to open a new
+ * If this is set to `true`, the user needs to manually accept inbound requests to open a new
  * channel.
  *
- * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
+ * When set to `true`, [`Event::OpenChannelRequest`] will be triggered once a request to open a
  * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
  * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
  * user explicitly chooses to accept the request.
  *
- * Default value: false.
+ * Default value: `false`
  *
  * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
  * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
@@ -34891,13 +37515,13 @@ bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig
 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
 
 /**
- *  If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
+ *  If this is set to `true`, LDK will intercept HTLCs that are attempting to be forwarded over
  *  fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
  *  intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
  *
- *  Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
+ *  Setting this to `true` may break backwards compatibility with LDK versions < 0.0.113.
  *
- *  Default value: false.
+ *  Default value: `false`
  *
  * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
  * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
@@ -34905,13 +37529,13 @@ void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNU
 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
 
 /**
- *  If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
+ *  If this is set to `true`, LDK will intercept HTLCs that are attempting to be forwarded over
  *  fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
  *  intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
  *
- *  Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
+ *  Setting this to `true` may break backwards compatibility with LDK versions < 0.0.113.
  *
- *  Default value: false.
+ *  Default value: `false`
  *
  * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
  * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
@@ -34919,37 +37543,71 @@ bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_P
 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
 
 /**
- * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
- * parts. If this is set to true, we'll accept the payment.
+ * If this is set to `false`, when receiving a keysend payment we'll fail it if it has multiple
+ * parts. If this is set to `true`, we'll accept the payment.
  *
- * Setting this to true will break backwards compatibility upon downgrading to an LDK
- * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
+ * Setting this to `true` will break backwards compatibility upon downgrading to an LDK
+ * version prior to 0.0.116 while receiving an MPP keysend. If we have already received an MPP
  * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
  *
- * Default value: false.
+ * Default value: `false`
  *
  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
  */
 bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr);
 
 /**
- * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
- * parts. If this is set to true, we'll accept the payment.
+ * If this is set to `false`, when receiving a keysend payment we'll fail it if it has multiple
+ * parts. If this is set to `true`, we'll accept the payment.
  *
- * Setting this to true will break backwards compatibility upon downgrading to an LDK
- * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
+ * Setting this to `true` will break backwards compatibility upon downgrading to an LDK
+ * version prior to 0.0.116 while receiving an MPP keysend. If we have already received an MPP
  * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
  *
- * Default value: false.
+ * Default value: `false`
  *
  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
  */
 void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
 
+/**
+ * If this is set to `true`, the user needs to manually pay [`Bolt12Invoice`]s when received.
+ *
+ * When set to `true`, [`Event::InvoiceReceived`] will be generated for each received
+ * [`Bolt12Invoice`] instead of being automatically paid after verification. Use
+ * [`ChannelManager::send_payment_for_bolt12_invoice`] to pay the invoice or
+ * [`ChannelManager::abandon_payment`] to abandon the associated payment.
+ *
+ * Default value: `false`
+ *
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * [`Event::InvoiceReceived`]: crate::events::Event::InvoiceReceived
+ * [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice
+ * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+ */
+bool UserConfig_get_manually_handle_bolt12_invoices(const struct LDKUserConfig *NONNULL_PTR this_ptr);
+
+/**
+ * If this is set to `true`, the user needs to manually pay [`Bolt12Invoice`]s when received.
+ *
+ * When set to `true`, [`Event::InvoiceReceived`] will be generated for each received
+ * [`Bolt12Invoice`] instead of being automatically paid after verification. Use
+ * [`ChannelManager::send_payment_for_bolt12_invoice`] to pay the invoice or
+ * [`ChannelManager::abandon_payment`] to abandon the associated payment.
+ *
+ * Default value: `false`
+ *
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * [`Event::InvoiceReceived`]: crate::events::Event::InvoiceReceived
+ * [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice
+ * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+ */
+void UserConfig_set_manually_handle_bolt12_invoices(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
+
 /**
  * Constructs a new UserConfig given each field
  */
-MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig channel_handshake_config_arg, struct LDKChannelHandshakeLimits channel_handshake_limits_arg, struct LDKChannelConfig channel_config_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg, bool accept_intercept_htlcs_arg, bool accept_mpp_keysend_arg);
+MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig channel_handshake_config_arg, struct LDKChannelHandshakeLimits channel_handshake_limits_arg, struct LDKChannelConfig channel_config_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg, bool accept_intercept_htlcs_arg, bool accept_mpp_keysend_arg, bool manually_handle_bolt12_invoices_arg);
 
 /**
  * Creates a copy of the UserConfig
@@ -35138,9 +37796,14 @@ void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
 
 /**
- * Utility method to constructs a new OnChainSweep-variant ConfirmationTarget
+ * Utility method to constructs a new MaximumFeeEstimate-variant ConfirmationTarget
+ */
+enum LDKConfirmationTarget ConfirmationTarget_maximum_fee_estimate(void);
+
+/**
+ * Utility method to constructs a new UrgentOnChainSweep-variant ConfirmationTarget
  */
-enum LDKConfirmationTarget ConfirmationTarget_on_chain_sweep(void);
+enum LDKConfirmationTarget ConfirmationTarget_urgent_on_chain_sweep(void);
 
 /**
  * Utility method to constructs a new MinAllowedAnchorChannelRemoteFee-variant ConfirmationTarget
@@ -35188,28 +37851,6 @@ bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, cons
  */
 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);
-
-/**
- * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId.
- */
-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
  */
@@ -35241,8 +37882,7 @@ MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ c
  * 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`]).
+ * `ignored_channels`.
  *
  * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
  * inclusion in the return value.
@@ -35268,8 +37908,11 @@ MUST_USE_RES struct LDKCVec_C2Tuple_OutPointChannelIdZZ ChainMonitor_list_monito
 
 /**
  * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
+ * Each `Vec<u64>` contains `update_id`s from [`ChannelMonitor::get_latest_update_id`] for updates
+ * that have not yet been fully persisted. Note that if a full monitor is persisted all the pending
+ * monitor updates must be individually marked completed by calling [`ChainMonitor::channel_monitor_updated`].
  */
-MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_u64ZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
 
 /**
  * Indicates the persistence of a [`ChannelMonitor`] has completed after
@@ -35279,14 +37922,21 @@ MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor
  *  1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
  *     update to disk and begins updating any remote (e.g. watchtower/backup) copies,
  *     returning [`ChannelMonitorUpdateStatus::InProgress`],
- *  2) once all remote copies are updated, you call this function with the
- *     `completed_update_id` that completed, and once all pending updates have completed the
- *     channel will be re-enabled.
+ *  2) once all remote copies are updated, you call this function with [`ChannelMonitor::get_latest_update_id`]
+ *     or [`ChannelMonitorUpdate::update_id`] as the `completed_update_id`, and once all pending
+ *     updates have completed the channel will be re-enabled.
+ *
+ * It is only necessary to call [`ChainMonitor::channel_monitor_updated`] when you return [`ChannelMonitorUpdateStatus::InProgress`]
+ * from [`Persist`] and either:
+ *   1. A new [`ChannelMonitor`] was added in [`Persist::persist_new_channel`], or
+ *   2. A [`ChannelMonitorUpdate`] was provided as part of [`Persist::update_persisted_channel`].
+ * Note that we don't care about calls to [`Persist::update_persisted_channel`] where no
+ * [`ChannelMonitorUpdate`] was provided.
  *
  * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
  * registered [`ChannelMonitor`]s.
  */
-MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKMonitorUpdateId completed_update_id);
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, uint64_t completed_update_id);
 
 /**
  * Gets a [`Future`] that completes when an event is available either via
@@ -35514,6 +38164,37 @@ struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj)
  */
 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
 
+/**
+ * Creates a copy of the BalanceSource
+ */
+enum LDKBalanceSource BalanceSource_clone(const enum LDKBalanceSource *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new HolderForceClosed-variant BalanceSource
+ */
+enum LDKBalanceSource BalanceSource_holder_force_closed(void);
+
+/**
+ * Utility method to constructs a new CounterpartyForceClosed-variant BalanceSource
+ */
+enum LDKBalanceSource BalanceSource_counterparty_force_closed(void);
+
+/**
+ * Utility method to constructs a new CoopClose-variant BalanceSource
+ */
+enum LDKBalanceSource BalanceSource_coop_close(void);
+
+/**
+ * Utility method to constructs a new Htlc-variant BalanceSource
+ */
+enum LDKBalanceSource BalanceSource_htlc(void);
+
+/**
+ * Checks if two BalanceSources contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool BalanceSource_eq(const enum LDKBalanceSource *NONNULL_PTR a, const enum LDKBalanceSource *NONNULL_PTR b);
+
 /**
  * Frees any resources used by the Balance
  */
@@ -35527,12 +38208,12 @@ struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
 /**
  * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
  */
-struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis);
+struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis, uint64_t transaction_fee_satoshis, uint64_t outbound_payment_htlc_rounded_msat, uint64_t outbound_forwarded_htlc_rounded_msat, uint64_t inbound_claiming_htlc_rounded_msat, uint64_t inbound_htlc_rounded_msat);
 
 /**
  * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
  */
-struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height);
+struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height, enum LDKBalanceSource source);
 
 /**
  * Utility method to constructs a new ContentiousClaimable-variant Balance
@@ -35542,7 +38223,7 @@ struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32
 /**
  * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
  */
-struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash);
+struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash, bool outbound_payment);
 
 /**
  * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
@@ -35561,9 +38242,15 @@ struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_
 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
 
 /**
- * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able
- * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more
- * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and
+ * The amount claimable, in satoshis.
+ *
+ * For outbound payments, this excludes the balance from the possible HTLC timeout.
+ *
+ * For forwarded payments, this includes the balance from the possible HTLC timeout as
+ * (to be conservative) that balance does not include routing fees we'd earn if we'd claim
+ * the balance from a preimage in a successful forward.
+ *
+ * For more information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and
  * [`Balance::MaybePreimageClaimableHTLC`].
  *
  * On-chain fees required to claim the balance are not included in this amount.
@@ -35640,10 +38327,12 @@ MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_m
  * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in
  * order to handle these events.
  *
+ * Will return a [`ReplayEvent`] error if event handling failed and should eventually be retried.
+ *
  * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
  * [`BumpTransaction`]: crate::events::Event::BumpTransaction
  */
-void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler);
+MUST_USE_RES struct LDKCResult_NoneReplayEventZ ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler);
 
 /**
  * Gets the counterparty's initial commitment transaction. The returned commitment
@@ -35804,6 +38493,11 @@ MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct
  */
 void ChannelMonitor_rebroadcast_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
 
+/**
+ * Returns true if the monitor has pending claim requests that are not fully confirmed yet.
+ */
+MUST_USE_RES bool ChannelMonitor_has_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
+
 /**
  * Triggers rebroadcasts of pending claims from a force-closed channel after a transaction
  * signature generation failure.
@@ -35911,6 +38605,11 @@ bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoi
  */
 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
 
+/**
+ * Get the string representation of a OutPoint object
+ */
+struct LDKStr OutPoint_to_str(const struct LDKOutPoint *NONNULL_PTR o);
+
 /**
  * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
  */
@@ -35991,7 +38690,7 @@ bool InboundHTLCErr_eq(const struct LDKInboundHTLCErr *NONNULL_PTR a, const stru
  *
  * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
  */
-struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ peel_payment_onion(const struct LDKUpdateAddHTLC *NONNULL_PTR msg, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKLogger *NONNULL_PTR logger, uint32_t cur_height, bool accept_mpp_keysend, bool allow_skimmed_fees);
+struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ peel_payment_onion(const struct LDKUpdateAddHTLC *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, uint32_t cur_height, bool accept_mpp_keysend, bool allow_skimmed_fees);
 
 /**
  * Frees any resources used by the PendingHTLCRouting
@@ -36049,10 +38748,30 @@ enum LDKBlindedFailure BlindedForward_get_failure(const struct LDKBlindedForward
  */
 void BlindedForward_set_failure(struct LDKBlindedForward *NONNULL_PTR this_ptr, enum LDKBlindedFailure val);
 
+/**
+ * Overrides the next hop's [`msgs::UpdateAddHTLC::blinding_point`]. Set if this HTLC is being
+ * forwarded within a [`BlindedPaymentPath`] that was concatenated to another blinded path that
+ * starts at the next hop.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKPublicKey BlindedForward_get_next_blinding_override(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
+
+/**
+ * Overrides the next hop's [`msgs::UpdateAddHTLC::blinding_point`]. Set if this HTLC is being
+ * forwarded within a [`BlindedPaymentPath`] that was concatenated to another blinded path that
+ * starts at the next hop.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void BlindedForward_set_next_blinding_override(struct LDKBlindedForward *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
 /**
  * Constructs a new BlindedForward given each field
+ *
+ * Note that next_blinding_override_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKBlindedForward BlindedForward_new(struct LDKPublicKey inbound_blinding_point_arg, enum LDKBlindedFailure failure_arg);
+MUST_USE_RES struct LDKBlindedForward BlindedForward_new(struct LDKPublicKey inbound_blinding_point_arg, enum LDKBlindedFailure failure_arg, struct LDKPublicKey next_blinding_override_arg);
 
 /**
  * Creates a copy of the BlindedForward
@@ -36305,19170 +39024,21097 @@ MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork netwo
 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the RecentPaymentDetails
  */
-void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
+void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
 
 /**
- * Base routing fee in millisatoshis.
+ * Creates a copy of the RecentPaymentDetails
  */
-uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
+struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
 
 /**
- * Base routing fee in millisatoshis.
+ * Utility method to constructs a new AwaitingInvoice-variant RecentPaymentDetails
  */
-void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKRecentPaymentDetails RecentPaymentDetails_awaiting_invoice(struct LDKThirtyTwoBytes payment_id);
 
 /**
- * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
+ * Utility method to constructs a new Pending-variant RecentPaymentDetails
  */
-uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
+struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
 
 /**
- * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
+ * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
  */
-void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash);
 
 /**
- * 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.
+ * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
  */
-uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
+struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
 
 /**
- * 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.
+ * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
  */
-void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
+void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
 
 /**
- * Constructs a new CounterpartyForwardingInfo given each field
+ * The list of channels to be included in the invoice route hints.
  */
-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);
+struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the CounterpartyForwardingInfo
+ * The list of channels to be included in the invoice route hints.
  */
-struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
+void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
 
 /**
- * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
+ * A fake scid used for representing the phantom node's fake channel in generating the invoice
+ * route hints.
  */
-void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
+uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
 
 /**
- * The node_id of our counterparty
+ * A fake scid used for representing the phantom node's fake channel in generating the invoice
+ * route hints.
  */
-struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The node_id of our counterparty
+ * The pubkey of the real backing node that would ultimately receive the payment.
  */
-void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *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.
+ * The pubkey of the real backing node that would ultimately receive the payment.
  */
-struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *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.
+ * Constructs a new PhantomRouteHints given each field
  */
-void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
+MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
 
 /**
- * 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
+ * Creates a copy of the PhantomRouteHints
  */
-uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
 
 /**
- * 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.
+ * Constructs a new `ChannelManager` to hold several channels and route between them.
  *
- * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
+ * The current time or latest block header time can be provided as the `current_timestamp`.
  *
- * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
- */
-void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
-
-/**
- * Information on the fees and requirements that the counterparty requires when forwarding
- * payments to us through this channel.
+ * This is the main \"logic hub\" for all channel-related actions, and implements
+ * [`ChannelMessageHandler`].
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
- */
-struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
-
-/**
- * Information on the fees and requirements that the counterparty requires when forwarding
- * payments to us through this channel.
+ * Non-proportional fees are fixed according to our risk using the provided fee estimator.
  *
- * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
- */
-void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
-
-/**
- * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
- * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
- * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
- */
-struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
-
-/**
- * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
- * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
- * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
- */
-void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
-
-/**
- * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
- */
-struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
-
-/**
- * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
- */
-void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
-
-/**
- * Constructs a new ChannelCounterparty given each field
+ * Users need to notify the new `ChannelManager` when a new block is connected or
+ * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
+ * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
+ * more details.
  *
- * Note that forwarding_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
- */
-MUST_USE_RES struct LDKChannelCounterparty ChannelCounterparty_new(struct LDKPublicKey node_id_arg, struct LDKInitFeatures features_arg, uint64_t unspendable_punishment_reserve_arg, struct LDKCounterpartyForwardingInfo forwarding_info_arg, struct LDKCOption_u64Z outbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z outbound_htlc_maximum_msat_arg);
-
-/**
- * Creates a copy of the ChannelCounterparty
+ * [`block_connected`]: chain::Listen::block_connected
+ * [`block_disconnected`]: chain::Listen::block_disconnected
+ * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
  */
-struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
+MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKUserConfig config, struct LDKChainParameters params, uint32_t current_timestamp);
 
 /**
- * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
+ * Gets the current configuration applied to all new channels.
  */
-void ChannelDetails_free(struct LDKChannelDetails this_obj);
+MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_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 new outbound channel to the given remote node and with the given value.
+ *
+ * `user_channel_id` will be provided back as in
+ * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
+ * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
+ * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
+ * is simply copied to events and otherwise ignored.
+ *
+ * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
+ * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
+ *
+ * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
+ * generate a shutdown scriptpubkey or destination script set by
+ * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
+ *
+ * Note that we do not check if you are currently connected to the given peer. If no
+ * connection is available, the outbound `open_channel` message may fail to send, resulting in
+ * the channel eventually being silently forgotten (dropped on reload).
+ *
+ * If `temporary_channel_id` is specified, it will be used as the temporary channel ID of the
+ * channel. Otherwise, a random one will be generated for you.
+ *
+ * Returns the new Channel's temporary `channel_id`. This ID will appear as
+ * [`Event::FundingGenerationReady::temporary_channel_id`] and in
+ * [`ChannelDetails::channel_id`] until after
+ * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
+ * one derived from the funding transaction's TXID. If the counterparty rejects the channel
+ * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
+ *
+ * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
+ * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
+ * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
+ *
+ * Note that temporary_channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKChannelId ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_ChannelIdAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, struct LDKU128 user_channel_id, struct LDKChannelId temporary_channel_id, struct LDKUserConfig override_config);
 
 /**
- * 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.
+ * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
+ * more information.
  */
-void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelId val);
+MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Parameters which apply to our counterparty. See individual fields for more information.
+ * Gets the list of usable channels, in random order. Useful as an argument to
+ * [`Router::find_route`] to ensure non-announced channels are used.
+ *
+ * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
+ * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
+ * are.
  */
-struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Parameters which apply to our counterparty. See individual fields for more information.
+ * Gets the list of channels we have with a given counterparty, in random order.
  */
-void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
+MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
 
 /**
- * The Channel's funding transaction output, if we've negotiated the funding transaction with
- * our counterparty already.
+ * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
+ * successful path, or have unresolved HTLCs.
  *
- * 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.
+ * This can be useful for payments that may have been prepared, but ultimately not sent, as a
+ * result of a crash. If such a payment exists, is not listed here, and an
+ * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
  *
- * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * [`Event::PaymentSent`]: events::Event::PaymentSent
  */
-void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * The features which this channel operates with. See individual features for more info.
+ * 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.
  *
- * `None` until negotiation completes and the channel type is finalized.
+ *  * If we are the channel initiator, we will pay between our [`ChannelCloseMinimum`] and
+ *    [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
+ *    fee estimate.
+ *  * If our counterparty is the channel initiator, we will require a channel closing
+ *    transaction feerate of at least our [`ChannelCloseMinimum`] feerate or the feerate which
+ *    would appear on a force-closure transaction, whichever is lower. We will allow our
+ *    counterparty to pay as much fee as they'd like, however.
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
- */
-struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
-
-/**
- * The features which this channel operates with. See individual features for more info.
+ * May generate a [`SendShutdown`] message event on success, which should be relayed.
  *
- * `None` until negotiation completes and the channel type is finalized.
+ * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
+ * generate a shutdown scriptpubkey or destination script set by
+ * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
+ * channel.
  *
- * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
+ * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
+ * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
+ * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
  */
-void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id);
 
 /**
- * The position of the funding transaction in the chain. None if the funding transaction has
- * not yet been confirmed and the channel fully opened.
+ * 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.
  *
- * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
- * payments instead of this. See [`get_inbound_payment_scid`].
+ * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
+ * the channel being closed or not:
+ *  * If we are the channel initiator, we will pay at least this feerate on the closing
+ *    transaction. The upper-bound is set by
+ *    [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
+ *    fee estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
+ *  * If our counterparty is the channel initiator, we will refuse to accept a channel closure
+ *    transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
+ *    will appear on a force-closure transaction, whichever is lower).
  *
- * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
- * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
+ * The `shutdown_script` provided  will be used as the `scriptPubKey` for the closing transaction.
+ * Will fail if a shutdown script has already been set for this channel by
+ * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
+ * also be compatible with our and the counterparty's features.
  *
- * [`inbound_scid_alias`]: Self::inbound_scid_alias
- * [`outbound_scid_alias`]: Self::outbound_scid_alias
- * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
- * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
- * [`confirmations_required`]: Self::confirmations_required
- */
-struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
-
-/**
- * The position of the funding transaction in the chain. None if the funding transaction has
- * not yet been confirmed and the channel fully opened.
+ * May generate a [`SendShutdown`] message event on success, which should be relayed.
  *
- * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
- * payments instead of this. See [`get_inbound_payment_scid`].
+ * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
+ * generate a shutdown scriptpubkey or destination script set by
+ * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
+ * channel.
  *
- * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
- * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
+ * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
+ * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
+ * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
  *
- * [`inbound_scid_alias`]: Self::inbound_scid_alias
- * [`outbound_scid_alias`]: Self::outbound_scid_alias
- * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
- * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
- * [`confirmations_required`]: Self::confirmations_required
+ * Note that shutdown_script (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);
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_feerate_and_script(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u32Z target_feerate_sats_per_1000_weight, struct LDKShutdownScript shutdown_script);
 
 /**
- * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
- * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
- * the channel has not yet been confirmed (as long as [`confirmations_required`] is
- * `Some(0)`).
+ * Force closes a channel, immediately broadcasting the latest local transaction(s),
+ * rejecting new HTLCs.
  *
- * This will be `None` as long as the channel is not available for routing outbound payments.
+ * The provided `error_message` is sent to connected peers for closing
+ * channels and should be a human-readable description of what went wrong.
  *
- * [`short_channel_id`]: Self::short_channel_id
- * [`confirmations_required`]: Self::confirmations_required
+ * Fails if `channel_id` is unknown to the manager, or if the `counterparty_node_id`
+ * isn't the counterparty of the corresponding channel.
  */
-struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id, struct LDKStr error_message);
 
 /**
- * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
- * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
- * the channel has not yet been confirmed (as long as [`confirmations_required`] is
- * `Some(0)`).
+ * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
+ * the latest local transaction(s).
  *
- * This will be `None` as long as the channel is not available for routing outbound payments.
+ * The provided `error_message` is sent to connected peers for closing channels and should
+ * be a human-readable description of what went wrong.
  *
- * [`short_channel_id`]: Self::short_channel_id
- * [`confirmations_required`]: Self::confirmations_required
+ * Fails if `channel_id` is unknown to the manager, or if the
+ * `counterparty_node_id` isn't the counterparty of the corresponding channel.
+ * You can always broadcast the latest local transaction(s) via
+ * [`ChannelMonitor::broadcast_latest_holder_commitment_txn`].
  */
-void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id, struct LDKStr error_message);
 
 /**
- * An optional [`short_channel_id`] alias for this channel, randomly generated by our
- * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
- * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
- * when they see a payment to be routed to us.
- *
- * Our counterparty may choose to rotate this value at any time, though will always recognize
- * previous values for inbound payment forwarding.
+ * Force close all channels, immediately broadcasting the latest local commitment transaction
+ * for each to the chain and rejecting new HTLCs on each.
  *
- * [`short_channel_id`]: Self::short_channel_id
+ * The provided `error_message` is sent to connected peers for closing channels and should
+ * be a human-readable description of what went wrong.
  */
-struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKStr error_message);
 
 /**
- * An optional [`short_channel_id`] alias for this channel, randomly generated by our
- * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
- * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
- * when they see a payment to be routed to us.
- *
- * Our counterparty may choose to rotate this value at any time, though will always recognize
- * previous values for inbound payment forwarding.
+ * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
+ * local transaction(s).
  *
- * [`short_channel_id`]: Self::short_channel_id
- */
-void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
-
-/**
- * The value, in satoshis, of this channel as appears in the funding output
- */
-uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
-
-/**
- * The value, in satoshis, of this channel as appears in the funding output
+ * The provided `error_message` is sent to connected peers for closing channels and
+ * should be a human-readable description of what went wrong.
  */
-void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKStr error_message);
 
 /**
- * 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.
+ * Sends a payment along a given route.
  *
- * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
+ * This method is *DEPRECATED*, use [`Self::send_payment`] instead. If you wish to fix the
+ * route for a payment, do so by matching the [`PaymentId`] passed to
+ * [`Router::find_route_with_id`].
  *
- * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
+ * fields for more info.
  *
- * [`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.
+ * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
+ * [`PeerManager::process_events`]).
  *
- * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
+ * # Avoiding Duplicate Payments
  *
- * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
+ * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
+ * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
+ * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
+ * second payment with the same [`PaymentId`].
  *
- * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
- */
-void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
-
-/**
- * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
- * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
- * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
- * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
- * serialized with LDK versions prior to 0.0.113.
+ * Thus, in order to ensure duplicate payments are not sent, you should implement your own
+ * tracking of payments, including state to indicate once a payment has completed. Because you
+ * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
+ * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
+ * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
  *
- * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
- * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
- * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
- */
-struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
-
-/**
- * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
- * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
- * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
- * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
- * serialized with LDK versions prior to 0.0.113.
+ * Additionally, in the scenario where we begin the process of sending a payment, but crash
+ * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
+ * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
+ * [`ChannelManager::list_recent_payments`] for more information.
  *
- * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
- * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
- * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
- */
-void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
-
-/**
- * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
- * which is applied to commitment and HTLC transactions.
+ * # Possible Error States on [`PaymentSendFailure`]
  *
- * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
+ * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
+ * each entry matching the corresponding-index entry in the route paths, see
+ * [`PaymentSendFailure`] for more info.
+ *
+ * In general, a path may raise:
+ *  * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
+ *    node public key) is specified.
+ *  * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
+ *    closed, doesn't exist, or the peer is currently disconnected.
+ *  * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
+ *    relevant updates.
+ *
+ * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
+ * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
+ * different route unless you intend to pay twice!
+ *
+ * [`RouteHop`]: crate::routing::router::RouteHop
+ * [`Event::PaymentSent`]: events::Event::PaymentSent
+ * [`Event::PaymentFailed`]: events::Event::PaymentFailed
+ * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
+ * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
+ * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
  */
-struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment_with_route(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKRoute route, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
 
 /**
- * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
- * which is applied to commitment and HTLC transactions.
- *
- * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
+ * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
+ * `route_params` and retry failed payment paths based on `retry_strategy`.
  */
-void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
+MUST_USE_RES struct LDKCResult_NoneRetryableSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
 
 /**
- * Our total balance.  This is the amount we would get if we close the channel.
- * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
- * amount is not likely to be recoverable on close.
+ * Signals that no further attempts for the given payment should occur. Useful if you have a
+ * pending outbound payment with retries remaining, but wish to stop retrying the payment before
+ * retries are exhausted.
  *
- * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
- * balance is not available for inclusion in new outbound HTLCs). This further does not include
- * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
- * This does not consider any on-chain fees.
+ * # Event Generation
  *
- * See also [`ChannelDetails::outbound_capacity_msat`]
- */
-uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
-
-/**
- * Our total balance.  This is the amount we would get if we close the channel.
- * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
- * amount is not likely to be recoverable on close.
+ * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
+ * as there are no remaining pending HTLCs for this payment.
  *
- * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
- * balance is not available for inclusion in new outbound HTLCs). This further does not include
- * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
- * This does not consider any on-chain fees.
+ * Note that calling this method does *not* prevent a payment from succeeding. You must still
+ * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
+ * determine the ultimate status of a payment.
  *
- * See also [`ChannelDetails::outbound_capacity_msat`]
- */
-void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
-
-/**
- * The available outbound capacity for sending HTLCs to the remote peer. This does not include
- * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
- * available for inclusion in new outbound HTLCs). This further does not include any pending
- * outgoing HTLCs which are awaiting some other resolution to be sent.
+ * # Requested Invoices
  *
- * See also [`ChannelDetails::balance_msat`]
+ * In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning
+ * the payment prior to receiving the invoice will result in an [`Event::PaymentFailed`] and
+ * prevent any attempts at paying it once received.
  *
- * This value is not exact. Due to various in-flight changes, feerate changes, and our
- * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
- * should be able to spend nearly this amount.
- */
-uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
-
-/**
- * The available outbound capacity for sending HTLCs to the remote peer. This does not include
- * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
- * available for inclusion in new outbound HTLCs). This further does not include any pending
- * outgoing HTLCs which are awaiting some other resolution to be sent.
+ * # Restart Behavior
  *
- * See also [`ChannelDetails::balance_msat`]
+ * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the
+ * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated.
  *
- * 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.
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
  */
-void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
 
 /**
- * The available outbound capacity for sending a single HTLC to the remote peer. This is
- * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
- * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
- * to use a limit as close as possible to the HTLC limit we can currently send.
+ * 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 also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
- * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
- */
-uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
-
-/**
- * The available outbound capacity for sending a single HTLC to the remote peer. This is
- * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
- * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
- * to use a limit as close as possible to the HTLC limit we can currently send.
+ * See [`send_payment`] documentation for more details on the return value of this function
+ * and idempotency guarantees provided by the [`PaymentId`] key.
  *
- * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
- * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
+ * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
+ * [`send_payment`] for more information about the risks of duplicate preimage usage.
+ *
+ * [`send_payment`]: Self::send_payment
  */
-void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+MUST_USE_RES struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
 
 /**
- * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
- * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
- * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
- * route which is valid.
+ * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
+ * based on `route_params` and retry failed payment paths based on `retry_strategy`.
+ *
+ * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
+ * payments.
+ *
+ * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
  */
-uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ ChannelManager_send_spontaneous_payment_with_retry(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
 
 /**
- * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
- * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
- * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
- * route which is valid.
+ * Send a payment that is probing the given route for liquidity. We calculate the
+ * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
+ * us to easily discern them from real payments.
  */
-void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
 
 /**
- * The available inbound capacity for the remote peer to send HTLCs to us. This does not
- * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
- * available for inclusion in new inbound HTLCs).
- * Note that there are some corner cases not fully handled here, so the actual available
- * inbound capacity may be slightly higher than this.
+ * Sends payment probes over all paths of a route that would be used to pay the given
+ * amount to the given `node_id`.
  *
- * 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.
+ * See [`ChannelManager::send_preflight_probes`] for more information.
  */
-uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ChannelManager_send_spontaneous_preflight_probes(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, uint64_t amount_msat, uint32_t final_cltv_expiry_delta, struct LDKCOption_u64Z liquidity_limit_multiplier);
 
 /**
- * The available inbound capacity for the remote peer to send HTLCs to us. This does not
- * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
- * available for inclusion in new inbound HTLCs).
- * Note that there are some corner cases not fully handled here, so the actual available
- * inbound capacity may be slightly higher than this.
+ * Sends payment probes over all paths of a route that would be used to pay a route found
+ * according to the given [`RouteParameters`].
  *
- * 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.
+ * This may be used to send \"pre-flight\" probes, i.e., to train our scorer before conducting
+ * the actual payment. Note this is only useful if there likely is sufficient time for the
+ * probe to settle before sending out the actual payment, e.g., when waiting for user
+ * confirmation in a wallet UI.
+ *
+ * Otherwise, there is a chance the probe could take up some liquidity needed to complete the
+ * actual payment. Users should therefore be cautious and might avoid sending probes if
+ * liquidity is scarce and/or they don't expect the probe to return before they send the
+ * payment. To mitigate this issue, channels with available liquidity less than the required
+ * amount times the given `liquidity_limit_multiplier` won't be used to send pre-flight
+ * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`.
  */
-void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ChannelManager_send_preflight_probes(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKRouteParameters route_params, struct LDKCOption_u64Z liquidity_limit_multiplier);
 
 /**
- * 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`].
+ * Call this upon creation of a funding transaction for the given channel.
  *
- * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
+ * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
  *
- * [`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`].
+ * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
+ * across the p2p network.
  *
- * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
+ * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
  *
- * [`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
+ * May panic if the output found in the funding transaction is duplicative with some other
+ * channel (note that this should be trivially prevented by using unique funding transaction
+ * keys per-channel).
+ *
+ * Do NOT broadcast the funding transaction yourself. When we have safely received our
+ * counterparty's signature the funding transaction will automatically be broadcast via the
+ * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
+ *
+ * Note that this includes RBF or similar transaction replacement strategies - lightning does
+ * not currently support replacing a funding transaction on an existing channel. Instead,
+ * create a new channel with a conflicting funding transaction.
+ *
+ * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
+ * the wallet software generating the funding transaction to apply anti-fee sniping as
+ * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
+ * for more details.
+ *
+ * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
+ * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
  */
-void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKTransaction funding_transaction);
 
 /**
- * The current number of confirmations on the funding transaction.
+ * **Unsafe**: This method does not validate the spent output. It is the caller's
+ * responsibility to ensure the spent outputs are SegWit, as well as making sure the funding
+ * transaction has a final absolute locktime, i.e., its locktime is lower than the next block height.
  *
- * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
+ * For a safer method, please refer to [`ChannelManager::funding_transaction_generated`].
+ *
+ * Call this in response to a [`Event::FundingGenerationReady`] event.
+ *
+ * Note that if this method is called successfully, the funding transaction won't be
+ * broadcasted and you are expected to broadcast it manually when receiving the
+ * [`Event::FundingTxBroadcastSafe`] event.
+ *
+ * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
+ * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
+ *
+ * May panic if the funding output is duplicative with some other channel (note that this
+ * should be trivially prevented by using unique funding transaction keys per-channel).
+ *
+ * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
+ * the wallet software generating the funding transaction to apply anti-fee sniping as
+ * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/> for
+ * more details.
+ *
+ * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
+ * [`Event::FundingTxBroadcastSafe`]: crate::events::Event::FundingTxBroadcastSafe
+ * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
+ * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
  */
-struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_unsafe_manual_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding);
 
 /**
- * The current number of confirmations on the funding transaction.
+ * Call this upon creation of a batch funding transaction for the given channels.
  *
- * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
+ * Return values are identical to [`Self::funding_transaction_generated`], respective to
+ * each individual channel and transaction output.
+ *
+ * Do NOT broadcast the funding transaction yourself. This batch funding transaction
+ * will only be broadcast when we have safely received and persisted the counterparty's
+ * signature for each channel.
+ *
+ * If there is an error, all channels in the batch are to be considered closed.
  */
-void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_batch_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ temporary_channels, struct LDKTransaction funding_transaction);
 
 /**
- * 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.
+ * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
  *
- * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ * Once the updates are applied, each eligible channel (advertised with a known short channel
+ * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
+ * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
+ * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
+ *
+ * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
+ * `counterparty_node_id` is provided.
+ *
+ * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
+ * below [`MIN_CLTV_EXPIRY_DELTA`].
+ *
+ * If an error is returned, none of the updates should be considered applied.
+ *
+ * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
+ * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
+ * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
+ * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
+ * [`ChannelUpdate`]: msgs::ChannelUpdate
+ * [`ChannelUnavailable`]: APIError::ChannelUnavailable
+ * [`APIMisuseError`]: APIError::APIMisuseError
  */
-struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_partial_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ChannelIdZ channel_ids, const struct LDKChannelConfigUpdate *NONNULL_PTR config_update);
 
 /**
- * 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.
+ * Atomically updates the [`ChannelConfig`] for the given channels.
  *
- * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ * Once the updates are applied, each eligible channel (advertised with a known short channel
+ * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
+ * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
+ * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
+ *
+ * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
+ * `counterparty_node_id` is provided.
+ *
+ * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
+ * below [`MIN_CLTV_EXPIRY_DELTA`].
+ *
+ * If an error is returned, none of the updates should be considered applied.
+ *
+ * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
+ * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
+ * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
+ * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
+ * [`ChannelUpdate`]: msgs::ChannelUpdate
+ * [`ChannelUnavailable`]: APIError::ChannelUnavailable
+ * [`APIMisuseError`]: APIError::APIMisuseError
  */
-void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ChannelIdZ channel_ids, const struct LDKChannelConfig *NONNULL_PTR config);
 
 /**
- * True if the channel was initiated (and thus funded) by us.
+ * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
+ * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
+ *
+ * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
+ * channel to a receiving node if the node lacks sufficient inbound liquidity.
+ *
+ * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
+ * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
+ * receiver's invoice route hints. These route hints will signal to LDK to generate an
+ * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
+ * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
+ *
+ * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
+ * you from forwarding more than you received. See
+ * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
+ * than expected.
+ *
+ * Errors if the event was not handled in time, in which case the HTLC was automatically failed
+ * backwards.
+ *
+ * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
+ * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
+ * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
  */
-bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_forward_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id, const struct LDKChannelId *NONNULL_PTR next_hop_channel_id, struct LDKPublicKey next_node_id, uint64_t amt_to_forward_msat);
 
 /**
- * True if the channel was initiated (and thus funded) by us.
+ * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
+ * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
+ *
+ * Errors if the event was not handled in time, in which case the HTLC was automatically failed
+ * backwards.
+ *
+ * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
  */
-void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
 
 /**
- * True if the channel is confirmed, channel_ready messages have been exchanged, and the
- * channel is not currently being shut down. `channel_ready` message exchange implies the
- * required confirmation count has been reached (and we were connected to the peer at some
- * point after the funding transaction received enough confirmations). The required
- * confirmation count is provided in [`confirmations_required`].
+ * Processes HTLCs which are pending waiting on random forward delay.
  *
- * [`confirmations_required`]: ChannelDetails::confirmations_required
+ * Should only really ever be called in response to a PendingHTLCsForwardable event.
+ * Will likely generate further events.
  */
-bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * True if the channel is confirmed, channel_ready messages have been exchanged, and the
- * channel is not currently being shut down. `channel_ready` message exchange implies the
- * required confirmation count has been reached (and we were connected to the peer at some
- * point after the funding transaction received enough confirmations). The required
- * confirmation count is provided in [`confirmations_required`].
+ * Performs actions which should happen on startup and roughly once per minute thereafter.
  *
- * [`confirmations_required`]: ChannelDetails::confirmations_required
+ * This currently includes:
+ *  * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
+ *  * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
+ *    than a minute, informing the network that they should no longer attempt to route over
+ *    the channel.
+ *  * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
+ *    with the current [`ChannelConfig`].
+ *  * Removing peers which have disconnected but and no longer have any channels.
+ *  * Force-closing and removing channels which have not completed establishment in a timely manner.
+ *  * Forgetting about stale outbound payments, either those that have already been fulfilled
+ *    or those awaiting an invoice that hasn't been delivered in the necessary amount of time.
+ *    The latter is determined using the system clock in `std` and the highest seen block time
+ *    minus two hours in `no-std`.
+ *
+ * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
+ * estimate fetches.
+ *
+ * [`ChannelUpdate`]: msgs::ChannelUpdate
+ * [`ChannelConfig`]: crate::util::config::ChannelConfig
  */
-void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
+void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * The stage of the channel's shutdown.
- * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
+ * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
+ * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
+ * along the path (including in our own channel on which we received it).
  *
- * Returns a copy of the field.
+ * Note that in some cases around unclean shutdown, it is possible the payment may have
+ * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
+ * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
+ * may have already been failed automatically by LDK if it was nearing its expiration time.
+ *
+ * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
+ * [`ChannelManager::claim_funds`]), you should still monitor for
+ * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
+ * startup during which time claims that were in-progress at shutdown may be replayed.
  */
-struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
 
 /**
- * The stage of the channel's shutdown.
- * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
+ * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
+ * reason for the failure.
+ *
+ * See [`FailureCode`] for valid failure codes.
  */
-void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val);
+void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKFailureCode failure_code);
 
 /**
- * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
- * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
+ * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
+ * [`MessageSendEvent`]s needed to claim the payment.
  *
- * This is a strict superset of `is_channel_ready`.
+ * This method is guaranteed to ensure the payment has been claimed but only if the current
+ * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
+ * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
+ * successful. It will generally be available in the next [`process_pending_events`] call.
+ *
+ * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
+ * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
+ * event matches your expectation. If you fail to do so and call this method, you may provide
+ * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
+ *
+ * This function will fail the payment if it has custom TLVs with even type numbers, as we
+ * will assume they are unknown. If you intend to accept even custom TLVs, you should use
+ * [`claim_funds_with_known_custom_tlvs`].
+ *
+ * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
+ * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
+ * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
+ * [`process_pending_events`]: EventsProvider::process_pending_events
+ * [`create_inbound_payment`]: Self::create_inbound_payment
+ * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
+ * [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
  */
-bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
 
 /**
- * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
- * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
+ * This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
+ * even type numbers.
  *
- * This is a strict superset of `is_channel_ready`.
+ * # Note
+ *
+ * You MUST check you've understood all even TLVs before using this to
+ * claim, otherwise you may unintentionally agree to some protocol you do not understand.
+ *
+ * [`claim_funds`]: Self::claim_funds
  */
-void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
+void ChannelManager_claim_funds_with_known_custom_tlvs(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
 
 /**
- * True if this channel is (or will be) publicly-announced.
+ * Gets the node_id held by this ChannelManager
  */
-bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * True if this channel is (or will be) publicly-announced.
+ * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
+ *
+ * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
+ * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
+ * the channel.
+ *
+ * The `user_channel_id` parameter will be provided back in
+ * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
+ * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
+ *
+ * Note that this method will return an error and reject the channel, if it requires support
+ * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
+ * used to accept such channels.
+ *
+ * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
+ * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
  */
-void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
 
 /**
- * The smallest value HTLC (in msat) we will accept, for this channel. This field
- * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
- */
-struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+ * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
+ * it as confirmed immediately.
+ *
+ * The `user_channel_id` parameter will be provided back in
+ * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
+ * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
+ *
+ * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
+ * and (if the counterparty agrees), enables forwarding of payments immediately.
+ *
+ * This fully trusts that the counterparty has honestly and correctly constructed the funding
+ * transaction and blindly assumes that it will eventually confirm.
+ *
+ * If it does not confirm before we decide to close the channel, or if the funding transaction
+ * does not pay to the correct script the correct amount, *you will lose funds*.
+ *
+ * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
+ * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
 
 /**
- * The smallest value HTLC (in msat) we will accept, for this channel. This field
- * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
+ * Creates an [`OfferBuilder`] such that the [`Offer`] it builds is recognized by the
+ * [`ChannelManager`] when handling [`InvoiceRequest`] messages for the offer. The offer's
+ * expiration will be `absolute_expiry` if `Some`, otherwise it will not expire.
+ *
+ * # Privacy
+ *
+ * Uses [`MessageRouter`] to construct a [`BlindedMessagePath`] for the offer based on the given
+ * `absolute_expiry` according to [`MAX_SHORT_LIVED_RELATIVE_EXPIRY`]. See those docs for
+ * privacy implications as well as those of the parameterized [`Router`], which implements
+ * [`MessageRouter`].
+ *
+ * Also, uses a derived signing pubkey in the offer for recipient privacy.
+ *
+ * # Limitations
+ *
+ * Requires a direct connection to the introduction node in the responding [`InvoiceRequest`]'s
+ * reply path.
+ *
+ * # Errors
+ *
+ * Errors if the parameterized [`Router`] is unable to create a blinded path for the offer.
+ *
+ * [`Offer`]: crate::offers::offer::Offer
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
  */
-void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+MUST_USE_RES struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_offer_builder(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z absolute_expiry);
 
 /**
- * The largest value HTLC (in msat) we currently will accept, for this channel.
+ * Creates a [`RefundBuilder`] such that the [`Refund`] it builds is recognized by the
+ * [`ChannelManager`] when handling [`Bolt12Invoice`] messages for the refund.
+ *
+ * # Payment
+ *
+ * The provided `payment_id` is used to ensure that only one invoice is paid for the refund.
+ * See [Avoiding Duplicate Payments] for other requirements once the payment has been sent.
+ *
+ * The builder will have the provided expiration set. Any changes to the expiration on the
+ * returned builder will not be honored by [`ChannelManager`]. For `no-std`, the highest seen
+ * block time minus two hours is used for the current time when determining if the refund has
+ * expired.
+ *
+ * To revoke the refund, use [`ChannelManager::abandon_payment`] prior to receiving the
+ * invoice. If abandoned, or an invoice isn't received before expiration, the payment will fail
+ * with an [`Event::PaymentFailed`].
+ *
+ * If `max_total_routing_fee_msat` is not specified, The default from
+ * [`RouteParameters::from_payment_params_and_value`] is applied.
+ *
+ * # Privacy
+ *
+ * Uses [`MessageRouter`] to construct a [`BlindedMessagePath`] for the refund based on the given
+ * `absolute_expiry` according to [`MAX_SHORT_LIVED_RELATIVE_EXPIRY`]. See those docs for
+ * privacy implications as well as those of the parameterized [`Router`], which implements
+ * [`MessageRouter`].
+ *
+ * Also, uses a derived payer id in the refund for payer privacy.
+ *
+ * # Limitations
+ *
+ * Requires a direct connection to an introduction node in the responding
+ * [`Bolt12Invoice::payment_paths`].
+ *
+ * # Errors
+ *
+ * Errors if:
+ * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
+ * - `amount_msats` is invalid, or
+ * - the parameterized [`Router`] is unable to create a blinded path for the refund.
+ *
+ * [`Refund`]: crate::offers::refund::Refund
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
+ * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
  */
-struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_refund_builder(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t amount_msats, uint64_t absolute_expiry, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat);
 
 /**
- * The largest value HTLC (in msat) we currently will accept, for this channel.
+ * Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
+ * enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
+ * [`Bolt12Invoice`] once it is received.
+ *
+ * Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
+ * the [`ChannelManager`] when handling a [`Bolt12Invoice`] message in response to the request.
+ * The optional parameters are used in the builder, if `Some`:
+ * - `quantity` for [`InvoiceRequest::quantity`] which must be set if
+ *   [`Offer::expects_quantity`] is `true`.
+ * - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
+ * - `payer_note` for [`InvoiceRequest::payer_note`].
+ *
+ * If `max_total_routing_fee_msat` is not specified, The default from
+ * [`RouteParameters::from_payment_params_and_value`] is applied.
+ *
+ * # Payment
+ *
+ * The provided `payment_id` is used to ensure that only one invoice is paid for the request
+ * when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
+ * been sent.
+ *
+ * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
+ * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
+ * payment will fail with an [`Event::PaymentFailed`].
+ *
+ * # Privacy
+ *
+ * For payer privacy, uses a derived payer id and uses [`MessageRouter::create_blinded_paths`]
+ * to construct a [`BlindedMessagePath`] for the reply path. For further privacy implications, see the
+ * docs of the parameterized [`Router`], which implements [`MessageRouter`].
+ *
+ * # Limitations
+ *
+ * Requires a direct connection to an introduction node in [`Offer::paths`] or to
+ * [`Offer::signing_pubkey`], if empty. A similar restriction applies to the responding
+ * [`Bolt12Invoice::payment_paths`].
+ *
+ * # Errors
+ *
+ * Errors if:
+ * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
+ * - the provided parameters are invalid for the offer,
+ * - the offer is for an unsupported chain, or
+ * - the parameterized [`Router`] is unable to create a blinded reply path for the invoice
+ *   request.
+ *
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
+ * [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
+ * [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
+ * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
  */
-void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ ChannelManager_pay_for_offer(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOffer *NONNULL_PTR offer, struct LDKCOption_u64Z quantity, struct LDKCOption_u64Z amount_msats, struct LDKCOption_StrZ payer_note, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat);
 
 /**
- * Set of configurable parameters that affect channel operation.
+ * Creates a [`Bolt12Invoice`] for a [`Refund`] and enqueues it to be sent via an onion
+ * message.
  *
- * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
+ * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a
+ * [`BlindedPaymentPath`] containing the [`PaymentSecret`] needed to reconstruct the
+ * corresponding [`PaymentPreimage`]. It is returned purely for informational purposes.
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * # Limitations
+ *
+ * Requires a direct connection to an introduction node in [`Refund::paths`] or to
+ * [`Refund::payer_id`], if empty. This request is best effort; an invoice will be sent to each
+ * node meeting the aforementioned criteria, but there's no guarantee that they will be
+ * received and no retries will be made.
+ *
+ * # Errors
+ *
+ * Errors if:
+ * - the refund is for an unsupported chain, or
+ * - the parameterized [`Router`] is unable to create a blinded payment path or reply path for
+ *   the invoice.
+ *
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
  */
-struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ ChannelManager_request_refund_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRefund *NONNULL_PTR refund);
 
 /**
- * Set of configurable parameters that affect channel operation.
+ * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
+ * to pay us.
  *
- * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
+ * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
+ * [`PaymentHash`] and [`PaymentPreimage`] for you.
  *
- * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`] event, which
+ * will have the [`PaymentClaimable::purpose`] return `Some` for [`PaymentPurpose::preimage`]. That
+ * should then be passed directly to [`claim_funds`].
+ *
+ * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
+ *
+ * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
+ * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
+ *
+ * # Note
+ *
+ * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
+ * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
+ *
+ * Errors if `min_value_msat` is greater than total bitcoin supply.
+ *
+ * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
+ * on versions of LDK prior to 0.0.114.
+ *
+ * [`claim_funds`]: Self::claim_funds
+ * [`PaymentClaimable`]: events::Event::PaymentClaimable
+ * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
+ * [`PaymentPurpose::preimage`]: events::PaymentPurpose::preimage
+ * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
  */
-void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
+MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
 
 /**
- * Creates a copy of the ChannelDetails
+ * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
+ * stored external to LDK.
+ *
+ * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
+ * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
+ * the `min_value_msat` provided here, if one is provided.
+ *
+ * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
+ * note that LDK will not stop you from registering duplicate payment hashes for inbound
+ * payments.
+ *
+ * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
+ * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
+ * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
+ * sender \"proof-of-payment\" unless they have paid the required amount.
+ *
+ * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
+ * in excess of the current time. This should roughly match the expiry time set in the invoice.
+ * After this many seconds, we will remove the inbound payment, resulting in any attempts to
+ * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
+ * invoices when no timeout is set.
+ *
+ * Note that we use block header time to time-out pending inbound payments (with some margin
+ * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
+ * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
+ * If you need exact expiry semantics, you should enforce them upon receipt of
+ * [`PaymentClaimable`].
+ *
+ * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
+ * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
+ *
+ * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
+ * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
+ *
+ * # Note
+ *
+ * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
+ * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
+ *
+ * Errors if `min_value_msat` is greater than total bitcoin supply.
+ *
+ * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
+ * on versions of LDK prior to 0.0.114.
+ *
+ * [`create_inbound_payment`]: Self::create_inbound_payment
+ * [`PaymentClaimable`]: events::Event::PaymentClaimable
  */
-struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
+MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry);
 
 /**
- * Gets the current SCID which should be used to identify this channel for inbound payments.
- * This should be used for providing invoice hints or in any other context where our
- * counterparty will forward a payment to us.
+ * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
+ * previously returned from [`create_inbound_payment`].
  *
- * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
- * [`ChannelDetails::short_channel_id`]. See those for more information.
+ * [`create_inbound_payment`]: Self::create_inbound_payment
  */
-MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_ThirtyTwoBytesAPIErrorZ ChannelManager_get_payment_preimage(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
 
 /**
- * Gets the current SCID which should be used to identify this channel for outbound payments.
- * This should be used in [`Route`]s to describe the first hop or in other contexts where
- * we're sending or forwarding a payment outbound over this channel.
+ * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
+ * are used when constructing the phantom invoice's route hints.
  *
- * This is either the [`ChannelDetails::short_channel_id`], if set, or the
- * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
+ * [phantom node payments]: crate::sign::PhantomKeysManager
  */
-MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
+MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the ChannelShutdownState
+ * Gets route hints for use in receiving [phantom node payments].
+ *
+ * [phantom node payments]: crate::sign::PhantomKeysManager
  */
-enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig);
+MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new NotShuttingDown-variant ChannelShutdownState
+ * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
+ * used when constructing the route hints for HTLCs intended to be intercepted. See
+ * [`ChannelManager::forward_intercepted_htlc`].
+ *
+ * Note that this method is not guaranteed to return unique values, you may need to call it a few
+ * times to get a unique scid.
  */
-enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void);
+MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new ShutdownInitiated-variant ChannelShutdownState
+ * Gets inflight HTLC information by processing pending outbound payments that are in
+ * our channels. May be used during pathfinding to account for in-use channel liquidity.
  */
-enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void);
+MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new ResolvingHTLCs-variant ChannelShutdownState
+ * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
  */
-enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void);
+struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new NegotiatingClosingFee-variant ChannelShutdownState
+ * Constructs a new EventsProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
  */
-enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void);
+struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new ShutdownComplete-variant ChannelShutdownState
+ * Constructs a new Listen which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
  */
-enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void);
+struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Checks if two ChannelShutdownStates contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Constructs a new Confirm which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
  */
-bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b);
+struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the RecentPaymentDetails
+ * Gets a [`Future`] that completes when this [`ChannelManager`] may need to be persisted or
+ * may have events that need processing.
+ *
+ * In order to check if this [`ChannelManager`] needs persisting, call
+ * [`Self::get_and_clear_needs_persistence`].
+ *
+ * Note that callbacks registered on the [`Future`] MUST NOT call back into this
+ * [`ChannelManager`] and should instead register actions to be taken later.
  */
-void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
+MUST_USE_RES struct LDKFuture ChannelManager_get_event_or_persistence_needed_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the RecentPaymentDetails
+ * Returns true if this [`ChannelManager`] needs to be persisted.
+ *
+ * See [`Self::get_event_or_persistence_needed_future`] for retrieving a [`Future`] that
+ * indicates this should be checked.
  */
-struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
+MUST_USE_RES bool ChannelManager_get_and_clear_needs_persistence(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new AwaitingInvoice-variant RecentPaymentDetails
+ * Gets the latest best block which was connected either via the [`chain::Listen`] or
+ * [`chain::Confirm`] interfaces.
  */
-struct LDKRecentPaymentDetails RecentPaymentDetails_awaiting_invoice(struct LDKThirtyTwoBytes payment_id);
+MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new Pending-variant RecentPaymentDetails
+ * Fetches the set of [`NodeFeatures`] flags that are provided by or required by
+ * [`ChannelManager`].
  */
-struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
+MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
+ * Fetches the set of [`ChannelFeatures`] flags that are provided by or required by
+ * [`ChannelManager`].
  */
-struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash);
+MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
+ * Fetches the set of [`ChannelTypeFeatures`] flags that are provided by or required by
+ * [`ChannelManager`].
  */
-struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
+MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
+ * Fetches the set of [`InitFeatures`] flags that are provided by or required by
+ * [`ChannelManager`].
  */
-void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
+MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * The list of channels to be included in the invoice route hints.
+ * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
  */
-struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
+struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * The list of channels to be included in the invoice route hints.
+ * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
  */
-void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
+struct LDKOffersMessageHandler ChannelManager_as_OffersMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * A fake scid used for representing the phantom node's fake channel in generating the invoice
- * route hints.
+ * Constructs a new AsyncPaymentsMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned AsyncPaymentsMessageHandler must be freed before this_arg is
  */
-uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
+struct LDKAsyncPaymentsMessageHandler ChannelManager_as_AsyncPaymentsMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * A fake scid used for representing the phantom node's fake channel in generating the invoice
- * route hints.
+ * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is
  */
-void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKNodeIdLookUp ChannelManager_as_NodeIdLookUp(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * The pubkey of the real backing node that would ultimately receive the payment.
+ * Fetches the set of [`InitFeatures`] flags that are provided by or required by
+ * [`ChannelManager`].
  */
-struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
+struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config);
 
 /**
- * The pubkey of the real backing node that would ultimately receive the payment.
+ * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
  */
-void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
 
 /**
- * Constructs a new PhantomRouteHints given each field
+ * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
  */
-MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
+struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
 
 /**
- * Creates a copy of the PhantomRouteHints
+ * Serialize the BlindedForward object into a byte array which can be read by BlindedForward_read
  */
-struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
+struct LDKCVec_u8Z BlindedForward_write(const struct LDKBlindedForward *NONNULL_PTR obj);
 
 /**
- * Constructs a new `ChannelManager` to hold several channels and route between them.
- *
- * The current time or latest block header time can be provided as the `current_timestamp`.
- *
- * This is the main \"logic hub\" for all channel-related actions, and implements
- * [`ChannelMessageHandler`].
- *
- * Non-proportional fees are fixed according to our risk using the provided fee estimator.
- *
- * Users need to notify the new `ChannelManager` when a new block is connected or
- * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
- * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
- * more details.
- *
- * [`block_connected`]: chain::Listen::block_connected
- * [`block_disconnected`]: chain::Listen::block_disconnected
- * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
+ * Read a BlindedForward from a byte array, created by BlindedForward_write
  */
-MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKUserConfig config, struct LDKChainParameters params, uint32_t current_timestamp);
+struct LDKCResult_BlindedForwardDecodeErrorZ BlindedForward_read(struct LDKu8slice ser);
 
 /**
- * Gets the current configuration applied to all new channels.
+ * Serialize the PendingHTLCRouting object into a byte array which can be read by PendingHTLCRouting_read
  */
-MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z PendingHTLCRouting_write(const struct LDKPendingHTLCRouting *NONNULL_PTR obj);
 
 /**
- * Creates a new outbound channel to the given remote node and with the given value.
- *
- * `user_channel_id` will be provided back as in
- * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
- * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
- * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
- * is simply copied to events and otherwise ignored.
- *
- * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
- * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
- *
- * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
- * generate a shutdown scriptpubkey or destination script set by
- * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
- *
- * Note that we do not check if you are currently connected to the given peer. If no
- * connection is available, the outbound `open_channel` message may fail to send, resulting in
- * the channel eventually being silently forgotten (dropped on reload).
- *
- * If `temporary_channel_id` is specified, it will be used as the temporary channel ID of the
- * channel. Otherwise, a random one will be generated for you.
- *
- * Returns the new Channel's temporary `channel_id`. This ID will appear as
- * [`Event::FundingGenerationReady::temporary_channel_id`] and in
- * [`ChannelDetails::channel_id`] until after
- * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
- * one derived from the funding transaction's TXID. If the counterparty rejects the channel
- * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
- *
- * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
- * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
- * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
- *
- * Note that temporary_channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None
- * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Read a PendingHTLCRouting from a byte array, created by PendingHTLCRouting_write
  */
-MUST_USE_RES struct LDKCResult_ChannelIdAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, struct LDKU128 user_channel_id, struct LDKChannelId temporary_channel_id, struct LDKUserConfig override_config);
+struct LDKCResult_PendingHTLCRoutingDecodeErrorZ PendingHTLCRouting_read(struct LDKu8slice ser);
 
 /**
- * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
- * more information.
+ * Serialize the PendingHTLCInfo object into a byte array which can be read by PendingHTLCInfo_read
  */
-MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z PendingHTLCInfo_write(const struct LDKPendingHTLCInfo *NONNULL_PTR obj);
 
 /**
- * Gets the list of usable channels, in random order. Useful as an argument to
- * [`Router::find_route`] to ensure non-announced channels are used.
- *
- * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
- * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
- * are.
+ * Read a PendingHTLCInfo from a byte array, created by PendingHTLCInfo_write
  */
-MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
+struct LDKCResult_PendingHTLCInfoDecodeErrorZ PendingHTLCInfo_read(struct LDKu8slice ser);
 
 /**
- * Gets the list of channels we have with a given counterparty, in random order.
+ * Serialize the BlindedFailure object into a byte array which can be read by BlindedFailure_read
  */
-MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
+struct LDKCVec_u8Z BlindedFailure_write(const enum LDKBlindedFailure *NONNULL_PTR obj);
 
 /**
- * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
- * successful path, or have unresolved HTLCs.
- *
- * This can be useful for payments that may have been prepared, but ultimately not sent, as a
- * result of a crash. If such a payment exists, is not listed here, and an
- * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
- *
- * [`Event::PaymentSent`]: events::Event::PaymentSent
+ * Read a BlindedFailure from a byte array, created by BlindedFailure_write
  */
-MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
+struct LDKCResult_BlindedFailureDecodeErrorZ BlindedFailure_read(struct LDKu8slice ser);
 
 /**
- * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
- * will be accepted on the given channel, and after additional timeout/the closing of all
- * pending HTLCs, the channel will be closed on chain.
- *
- *  * If we are the channel initiator, we will pay between our [`ChannelCloseMinimum`] and
- *    [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
- *    fee estimate.
- *  * If our counterparty is the channel initiator, we will require a channel closing
- *    transaction feerate of at least our [`ChannelCloseMinimum`] feerate or the feerate which
- *    would appear on a force-closure transaction, whichever is lower. We will allow our
- *    counterparty to pay as much fee as they'd like, however.
- *
- * May generate a [`SendShutdown`] message event on success, which should be relayed.
- *
- * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
- * generate a shutdown scriptpubkey or destination script set by
- * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
- * channel.
- *
- * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
- * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
- * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
- * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
+ * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
  */
-MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id);
+struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
 
 /**
- * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
- * will be accepted on the given channel, and after additional timeout/the closing of all
- * pending HTLCs, the channel will be closed on chain.
- *
- * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
- * the channel being closed or not:
- *  * If we are the channel initiator, we will pay at least this feerate on the closing
- *    transaction. The upper-bound is set by
- *    [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
- *    fee estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
- *  * If our counterparty is the channel initiator, we will refuse to accept a channel closure
- *    transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
- *    will appear on a force-closure transaction, whichever is lower).
- *
- * The `shutdown_script` provided  will be used as the `scriptPubKey` for the closing transaction.
- * Will fail if a shutdown script has already been set for this channel by
- * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
- * also be compatible with our and the counterparty's features.
- *
- * May generate a [`SendShutdown`] message event on success, which should be relayed.
- *
- * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
- * generate a shutdown scriptpubkey or destination script set by
- * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
- * channel.
- *
- * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
- * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
- * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
- *
- * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_feerate_and_script(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u32Z target_feerate_sats_per_1000_weight, struct LDKShutdownScript shutdown_script);
+void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
 
 /**
- * Force closes a channel, immediately broadcasting the latest local transaction(s) and
- * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
- * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
- * channel.
+ * A cryptographically secure source of entropy.
  */
-MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id);
+const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
 
 /**
- * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
- * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
- * `counterparty_node_id` isn't the counterparty of the corresponding channel.
- *
- * You can always broadcast the latest local transaction(s) via
- * [`ChannelMonitor::broadcast_latest_holder_commitment_txn`].
+ * A cryptographically secure source of entropy.
  */
-MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id);
+void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
 
 /**
- * Force close all channels, immediately broadcasting the latest local commitment transaction
- * for each to the chain and rejecting new HTLCs on each.
+ * A signer that is able to perform node-scoped cryptographic operations.
  */
-void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
+const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
 
 /**
- * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
- * local transaction(s).
+ * A signer that is able to perform node-scoped cryptographic operations.
  */
-void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
+void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
 
 /**
- * Sends a payment along a given route.
- *
- * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
- * fields for more info.
- *
- * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
- * [`PeerManager::process_events`]).
- *
- * # Avoiding Duplicate Payments
- *
- * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
- * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
- * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
- * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
- * second payment with the same [`PaymentId`].
- *
- * Thus, in order to ensure duplicate payments are not sent, you should implement your own
- * tracking of payments, including state to indicate once a payment has completed. Because you
- * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
- * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
- * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
- *
- * Additionally, in the scenario where we begin the process of sending a payment, but crash
- * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
- * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
- * [`ChannelManager::list_recent_payments`] for more information.
- *
- * # Possible Error States on [`PaymentSendFailure`]
- *
- * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
- * each entry matching the corresponding-index entry in the route paths, see
- * [`PaymentSendFailure`] for more info.
- *
- * In general, a path may raise:
- *  * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
- *    node public key) is specified.
- *  * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
- *    closed, doesn't exist, or the peer is currently disconnected.
- *  * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
- *    relevant updates.
- *
- * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
- * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
- * different route unless you intend to pay twice!
- *
- * [`RouteHop`]: crate::routing::router::RouteHop
- * [`Event::PaymentSent`]: events::Event::PaymentSent
- * [`Event::PaymentFailed`]: events::Event::PaymentFailed
- * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
- * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
- * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
+ * The keys provider which will give us relevant keys. Some keys will be loaded during
+ * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
+ * signing data.
  */
-MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment_with_route(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
+const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
 
 /**
- * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
- * `route_params` and retry failed payment paths based on `retry_strategy`.
+ * The keys provider which will give us relevant keys. Some keys will be loaded during
+ * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
+ * signing data.
  */
-MUST_USE_RES struct LDKCResult_NoneRetryableSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
+void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
 
 /**
- * Signals that no further attempts for the given payment should occur. Useful if you have a
- * pending outbound payment with retries remaining, but wish to stop retrying the payment before
- * retries are exhausted.
- *
- * # Event Generation
- *
- * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
- * as there are no remaining pending HTLCs for this payment.
- *
- * Note that calling this method does *not* prevent a payment from succeeding. You must still
- * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
- * determine the ultimate status of a payment.
- *
- * # Requested Invoices
- *
- * In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning
- * the payment prior to receiving the invoice will result in an [`Event::InvoiceRequestFailed`]
- * and prevent any attempts at paying it once received. The other events may only be generated
- * once the invoice has been received.
- *
- * # Restart Behavior
- *
- * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the
- * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated; likewise for
- * [`Event::InvoiceRequestFailed`].
+ * The fee_estimator for use in the ChannelManager in the future.
  *
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * No calls to the FeeEstimator will be made during deserialization.
  */
-void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
+const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
 
 /**
- * Send a spontaneous payment, which is a payment that does not require the recipient to have
- * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
- * the preimage, it must be a cryptographically secure random value that no intermediate node
- * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
- * never reach the recipient.
- *
- * See [`send_payment`] documentation for more details on the return value of this function
- * and idempotency guarantees provided by the [`PaymentId`] key.
- *
- * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
- * [`send_payment`] for more information about the risks of duplicate preimage usage.
+ * The fee_estimator for use in the ChannelManager in the future.
  *
- * [`send_payment`]: Self::send_payment
+ * No calls to the FeeEstimator will be made during deserialization.
  */
-MUST_USE_RES struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
+void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
 
 /**
- * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
- * based on `route_params` and retry failed payment paths based on `retry_strategy`.
+ * The chain::Watch for use in the ChannelManager in the future.
  *
- * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
- * payments.
+ * No calls to the chain::Watch will be made during deserialization. It is assumed that
+ * you have deserialized ChannelMonitors separately and will add them to your
+ * chain::Watch after deserializing this ChannelManager.
+ */
+const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+
+/**
+ * The chain::Watch for use in the ChannelManager in the future.
  *
- * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
+ * No calls to the chain::Watch will be made during deserialization. It is assumed that
+ * you have deserialized ChannelMonitors separately and will add them to your
+ * chain::Watch after deserializing this ChannelManager.
  */
-MUST_USE_RES struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ ChannelManager_send_spontaneous_payment_with_retry(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
+void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
 
 /**
- * Send a payment that is probing the given route for liquidity. We calculate the
- * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
- * us to easily discern them from real payments.
+ * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
+ * used to broadcast the latest local commitment transactions of channels which must be
+ * force-closed during deserialization.
  */
-MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
+const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
 
 /**
- * Sends payment probes over all paths of a route that would be used to pay the given
- * amount to the given `node_id`.
- *
- * See [`ChannelManager::send_preflight_probes`] for more information.
+ * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
+ * used to broadcast the latest local commitment transactions of channels which must be
+ * force-closed during deserialization.
  */
-MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ChannelManager_send_spontaneous_preflight_probes(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, uint64_t amount_msat, uint32_t final_cltv_expiry_delta, struct LDKCOption_u64Z liquidity_limit_multiplier);
+void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
 
 /**
- * Sends payment probes over all paths of a route that would be used to pay a route found
- * according to the given [`RouteParameters`].
- *
- * This may be used to send \"pre-flight\" probes, i.e., to train our scorer before conducting
- * the actual payment. Note this is only useful if there likely is sufficient time for the
- * probe to settle before sending out the actual payment, e.g., when waiting for user
- * confirmation in a wallet UI.
+ * The router which will be used in the ChannelManager in the future for finding routes
+ * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
  *
- * Otherwise, there is a chance the probe could take up some liquidity needed to complete the
- * actual payment. Users should therefore be cautious and might avoid sending probes if
- * liquidity is scarce and/or they don't expect the probe to return before they send the
- * payment. To mitigate this issue, channels with available liquidity less than the required
- * amount times the given `liquidity_limit_multiplier` won't be used to send pre-flight
- * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`.
+ * No calls to the router will be made during deserialization.
  */
-MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ChannelManager_send_preflight_probes(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKRouteParameters route_params, struct LDKCOption_u64Z liquidity_limit_multiplier);
+const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
 
 /**
- * Call this upon creation of a funding transaction for the given channel.
- *
- * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
- * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
- *
- * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
- * across the p2p network.
- *
- * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
- * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
- *
- * May panic if the output found in the funding transaction is duplicative with some other
- * channel (note that this should be trivially prevented by using unique funding transaction
- * keys per-channel).
- *
- * Do NOT broadcast the funding transaction yourself. When we have safely received our
- * counterparty's signature the funding transaction will automatically be broadcast via the
- * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
- *
- * Note that this includes RBF or similar transaction replacement strategies - lightning does
- * not currently support replacing a funding transaction on an existing channel. Instead,
- * create a new channel with a conflicting funding transaction.
- *
- * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
- * the wallet software generating the funding transaction to apply anti-fee sniping as
- * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
- * for more details.
+ * The router which will be used in the ChannelManager in the future for finding routes
+ * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
  *
- * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
- * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
+ * No calls to the router will be made during deserialization.
  */
-MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKTransaction funding_transaction);
+void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
 
 /**
- * Call this upon creation of a batch funding transaction for the given channels.
- *
- * Return values are identical to [`Self::funding_transaction_generated`], respective to
- * each individual channel and transaction output.
- *
- * Do NOT broadcast the funding transaction yourself. This batch funding transaction
- * will only be broadcast when we have safely received and persisted the counterparty's
- * signature for each channel.
- *
- * If there is an error, all channels in the batch are to be considered closed.
+ * The Logger for use in the ChannelManager and which may be used to log information during
+ * deserialization.
  */
-MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_batch_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ temporary_channels, struct LDKTransaction funding_transaction);
+const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
 
 /**
- * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
- *
- * Once the updates are applied, each eligible channel (advertised with a known short channel
- * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
- * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
- * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
- *
- * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
- * `counterparty_node_id` is provided.
- *
- * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
- * below [`MIN_CLTV_EXPIRY_DELTA`].
- *
- * If an error is returned, none of the updates should be considered applied.
- *
- * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
- * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
- * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
- * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
- * [`ChannelUpdate`]: msgs::ChannelUpdate
- * [`ChannelUnavailable`]: APIError::ChannelUnavailable
- * [`APIMisuseError`]: APIError::APIMisuseError
+ * The Logger for use in the ChannelManager and which may be used to log information during
+ * deserialization.
  */
-MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_partial_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ChannelIdZ channel_ids, const struct LDKChannelConfigUpdate *NONNULL_PTR config_update);
+void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
 
 /**
- * Atomically updates the [`ChannelConfig`] for the given channels.
- *
- * Once the updates are applied, each eligible channel (advertised with a known short channel
- * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
- * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
- * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
- *
- * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
- * `counterparty_node_id` is provided.
- *
- * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
- * below [`MIN_CLTV_EXPIRY_DELTA`].
- *
- * If an error is returned, none of the updates should be considered applied.
- *
- * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
- * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
- * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
- * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
- * [`ChannelUpdate`]: msgs::ChannelUpdate
- * [`ChannelUnavailable`]: APIError::ChannelUnavailable
- * [`APIMisuseError`]: APIError::APIMisuseError
+ * Default settings used for new channels. Any existing channels will continue to use the
+ * runtime settings which were stored when the ChannelManager was serialized.
  */
-MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ChannelIdZ channel_ids, const struct LDKChannelConfig *NONNULL_PTR config);
+struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
 
 /**
- * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
- * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
- *
- * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
- * channel to a receiving node if the node lacks sufficient inbound liquidity.
- *
- * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
- * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
- * receiver's invoice route hints. These route hints will signal to LDK to generate an
- * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
- * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
- *
- * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
- * you from forwarding more than you received. See
- * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
- * than expected.
- *
- * Errors if the event was not handled in time, in which case the HTLC was automatically failed
- * backwards.
- *
- * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
- * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
- * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
+ * Default settings used for new channels. Any existing channels will continue to use the
+ * runtime settings which were stored when the ChannelManager was serialized.
  */
-MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_forward_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id, const struct LDKChannelId *NONNULL_PTR next_hop_channel_id, struct LDKPublicKey next_node_id, uint64_t amt_to_forward_msat);
+void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
 
 /**
- * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
- * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
- *
- * Errors if the event was not handled in time, in which case the HTLC was automatically failed
- * backwards.
- *
- * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
+ * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
+ * HashMap for you. This is primarily useful for C bindings where it is not practical to
+ * populate a HashMap directly from C.
  */
-MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
+MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors);
 
 /**
- * Processes HTLCs which are pending waiting on random forward delay.
- *
- * Should only really ever be called in response to a PendingHTLCsForwardable event.
- * Will likely generate further events.
+ * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write
  */
-void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
+struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
 
 /**
- * Performs actions which should happen on startup and roughly once per minute thereafter.
- *
- * This currently includes:
- *  * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
- *  * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
- *    than a minute, informing the network that they should no longer attempt to route over
- *    the channel.
- *  * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
- *    with the current [`ChannelConfig`].
- *  * Removing peers which have disconnected but and no longer have any channels.
- *  * Force-closing and removing channels which have not completed establishment in a timely manner.
- *  * Forgetting about stale outbound payments, either those that have already been fulfilled
- *    or those awaiting an invoice that hasn't been delivered in the necessary amount of time.
- *    The latter is determined using the system clock in `std` and the highest seen block time
- *    minus two hours in `no-std`.
- *
- * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
- * estimate fetches.
- *
- * [`ChannelUpdate`]: msgs::ChannelUpdate
- * [`ChannelConfig`]: crate::util::config::ChannelConfig
+ * Frees any resources used by the DelayedPaymentBasepoint, if is_owned is set and inner is non-NULL.
  */
-void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
+void DelayedPaymentBasepoint_free(struct LDKDelayedPaymentBasepoint this_obj);
+
+struct LDKPublicKey DelayedPaymentBasepoint_get_a(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr);
+
+void DelayedPaymentBasepoint_set_a(struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
- * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
- * along the path (including in our own channel on which we received it).
- *
- * Note that in some cases around unclean shutdown, it is possible the payment may have
- * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
- * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
- * may have already been failed automatically by LDK if it was nearing its expiration time.
- *
- * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
- * [`ChannelManager::claim_funds`]), you should still monitor for
- * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
- * startup during which time claims that were in-progress at shutdown may be replayed.
+ * Constructs a new DelayedPaymentBasepoint given each field
  */
-void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
+MUST_USE_RES struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_new(struct LDKPublicKey a_arg);
 
 /**
- * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
- * reason for the failure.
- *
- * See [`FailureCode`] for valid failure codes.
+ * Checks if two DelayedPaymentBasepoints contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKFailureCode failure_code);
+bool DelayedPaymentBasepoint_eq(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR a, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR b);
 
 /**
- * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
- * [`MessageSendEvent`]s needed to claim the payment.
- *
- * This method is guaranteed to ensure the payment has been claimed but only if the current
- * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
- * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
- * successful. It will generally be available in the next [`process_pending_events`] call.
- *
- * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
- * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
- * event matches your expectation. If you fail to do so and call this method, you may provide
- * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
- *
- * This function will fail the payment if it has custom TLVs with even type numbers, as we
- * will assume they are unknown. If you intend to accept even custom TLVs, you should use
- * [`claim_funds_with_known_custom_tlvs`].
- *
- * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
- * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
- * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
- * [`process_pending_events`]: EventsProvider::process_pending_events
- * [`create_inbound_payment`]: Self::create_inbound_payment
- * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
- * [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
+ * Creates a copy of the DelayedPaymentBasepoint
  */
-void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
+struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_clone(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR orig);
 
 /**
- * This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
- * even type numbers.
- *
- * # Note
- *
- * You MUST check you've understood all even TLVs before using this to
- * claim, otherwise you may unintentionally agree to some protocol you do not understand.
- *
- * [`claim_funds`]: Self::claim_funds
+ * Generates a non-cryptographic 64-bit hash of the DelayedPaymentBasepoint.
  */
-void ChannelManager_claim_funds_with_known_custom_tlvs(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
+uint64_t DelayedPaymentBasepoint_hash(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR o);
 
 /**
- * Gets the node_id held by this ChannelManager
+ * Get inner Public Key
  */
-MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPublicKey DelayedPaymentBasepoint_to_public_key(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg);
 
 /**
- * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
- *
- * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
- * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
- * the channel.
- *
- * The `user_channel_id` parameter will be provided back in
- * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
- * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
- *
- * Note that this method will return an error and reject the channel, if it requires support
- * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
- * used to accept such channels.
- *
- * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
- * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
+ *Derives the \"tweak\" used in calculate [`DelayedPaymentKey::from_basepoint`].\n\n[`DelayedPaymentKey::from_basepoint`] calculates a private key as:\n`privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)`\n\nThis calculates the hash part in the tweak derivation process, which is used to\nensure that each key is unique and cannot be guessed by an external party.
  */
-MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
+MUST_USE_RES struct LDKThirtyTwoBytes DelayedPaymentBasepoint_derive_add_tweak(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
 
 /**
- * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
- * it as confirmed immediately.
- *
- * The `user_channel_id` parameter will be provided back in
- * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
- * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
- *
- * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
- * and (if the counterparty agrees), enables forwarding of payments immediately.
- *
- * This fully trusts that the counterparty has honestly and correctly constructed the funding
- * transaction and blindly assumes that it will eventually confirm.
- *
- * If it does not confirm before we decide to close the channel, or if the funding transaction
- * does not pay to the correct script the correct amount, *you will lose funds*.
- *
- * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
- * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
+ * Serialize the DelayedPaymentBasepoint object into a byte array which can be read by DelayedPaymentBasepoint_read
  */
-MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
+struct LDKCVec_u8Z DelayedPaymentBasepoint_write(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR obj);
 
 /**
- * Creates an [`OfferBuilder`] such that the [`Offer`] it builds is recognized by the
- * [`ChannelManager`] when handling [`InvoiceRequest`] messages for the offer. The offer will
- * not have an expiration unless otherwise set on the builder.
- *
- * # Privacy
- *
- * Uses [`MessageRouter::create_blinded_paths`] to construct a [`BlindedPath`] for the offer.
- * However, if one is not found, uses a one-hop [`BlindedPath`] with
- * [`ChannelManager::get_our_node_id`] as the introduction node instead. In the latter case,
- * the node must be announced, otherwise, there is no way to find a path to the introduction in
- * order to send the [`InvoiceRequest`].
- *
- * Also, uses a derived signing pubkey in the offer for recipient privacy.
- *
- * # Limitations
- *
- * Requires a direct connection to the introduction node in the responding [`InvoiceRequest`]'s
- * reply path.
- *
- * # Errors
- *
- * Errors if the parameterized [`Router`] is unable to create a blinded path for the offer.
- *
- * [`Offer`]: crate::offers::offer::Offer
- * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * Read a DelayedPaymentBasepoint from a byte array, created by DelayedPaymentBasepoint_write
  */
-MUST_USE_RES struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_offer_builder(const struct LDKChannelManager *NONNULL_PTR this_arg);
+struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ DelayedPaymentBasepoint_read(struct LDKu8slice ser);
 
 /**
- * Creates a [`RefundBuilder`] such that the [`Refund`] it builds is recognized by the
- * [`ChannelManager`] when handling [`Bolt12Invoice`] messages for the refund.
- *
- * # Payment
- *
- * The provided `payment_id` is used to ensure that only one invoice is paid for the refund.
- * See [Avoiding Duplicate Payments] for other requirements once the payment has been sent.
- *
- * The builder will have the provided expiration set. Any changes to the expiration on the
- * returned builder will not be honored by [`ChannelManager`]. For `no-std`, the highest seen
- * block time minus two hours is used for the current time when determining if the refund has
- * expired.
- *
- * To revoke the refund, use [`ChannelManager::abandon_payment`] prior to receiving the
- * invoice. If abandoned, or an invoice isn't received before expiration, the payment will fail
- * with an [`Event::InvoiceRequestFailed`].
- *
- * If `max_total_routing_fee_msat` is not specified, The default from
- * [`RouteParameters::from_payment_params_and_value`] is applied.
- *
- * # Privacy
- *
- * Uses [`MessageRouter::create_blinded_paths`] to construct a [`BlindedPath`] for the refund.
- * However, if one is not found, uses a one-hop [`BlindedPath`] with
- * [`ChannelManager::get_our_node_id`] as the introduction node instead. In the latter case,
- * the node must be announced, otherwise, there is no way to find a path to the introduction in
- * order to send the [`Bolt12Invoice`].
- *
- * Also, uses a derived payer id in the refund for payer privacy.
- *
- * # Limitations
- *
- * Requires a direct connection to an introduction node in the responding
- * [`Bolt12Invoice::payment_paths`].
- *
- * # Errors
- *
- * Errors if:
- * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
- * - `amount_msats` is invalid, or
- * - the parameterized [`Router`] is unable to create a blinded path for the refund.
- *
- * [`Refund`]: crate::offers::refund::Refund
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
- * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
- * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
+ * Frees any resources used by the DelayedPaymentKey, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_refund_builder(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t amount_msats, uint64_t absolute_expiry, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat);
+void DelayedPaymentKey_free(struct LDKDelayedPaymentKey this_obj);
+
+struct LDKPublicKey DelayedPaymentKey_get_a(const struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr);
+
+void DelayedPaymentKey_set_a(struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
- * enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
- * [`Bolt12Invoice`] once it is received.
- *
- * Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
- * the [`ChannelManager`] when handling a [`Bolt12Invoice`] message in response to the request.
- * The optional parameters are used in the builder, if `Some`:
- * - `quantity` for [`InvoiceRequest::quantity`] which must be set if
- *   [`Offer::expects_quantity`] is `true`.
- * - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
- * - `payer_note` for [`InvoiceRequest::payer_note`].
- *
- * If `max_total_routing_fee_msat` is not specified, The default from
- * [`RouteParameters::from_payment_params_and_value`] is applied.
- *
- * # Payment
+ * Constructs a new DelayedPaymentKey given each field
+ */
+MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_new(struct LDKPublicKey a_arg);
+
+/**
+ * Checks if two DelayedPaymentKeys contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool DelayedPaymentKey_eq(const struct LDKDelayedPaymentKey *NONNULL_PTR a, const struct LDKDelayedPaymentKey *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the DelayedPaymentKey
+ */
+struct LDKDelayedPaymentKey DelayedPaymentKey_clone(const struct LDKDelayedPaymentKey *NONNULL_PTR orig);
+
+/**
+ *Derive a public delayedpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
+ */
+MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_basepoint(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
+
+/**
+ *Build a delayedpubkey directly from an already-derived private key
+ */
+MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_secret_key(const uint8_t (*sk)[32]);
+
+/**
+ * Get inner Public Key
+ */
+MUST_USE_RES struct LDKPublicKey DelayedPaymentKey_to_public_key(const struct LDKDelayedPaymentKey *NONNULL_PTR this_arg);
+
+/**
+ * Serialize the DelayedPaymentKey object into a byte array which can be read by DelayedPaymentKey_read
+ */
+struct LDKCVec_u8Z DelayedPaymentKey_write(const struct LDKDelayedPaymentKey *NONNULL_PTR obj);
+
+/**
+ * Read a DelayedPaymentKey from a byte array, created by DelayedPaymentKey_write
+ */
+struct LDKCResult_DelayedPaymentKeyDecodeErrorZ DelayedPaymentKey_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the HtlcBasepoint, if is_owned is set and inner is non-NULL.
+ */
+void HtlcBasepoint_free(struct LDKHtlcBasepoint this_obj);
+
+struct LDKPublicKey HtlcBasepoint_get_a(const struct LDKHtlcBasepoint *NONNULL_PTR this_ptr);
+
+void HtlcBasepoint_set_a(struct LDKHtlcBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Constructs a new HtlcBasepoint given each field
+ */
+MUST_USE_RES struct LDKHtlcBasepoint HtlcBasepoint_new(struct LDKPublicKey a_arg);
+
+/**
+ * Checks if two HtlcBasepoints contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool HtlcBasepoint_eq(const struct LDKHtlcBasepoint *NONNULL_PTR a, const struct LDKHtlcBasepoint *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the HtlcBasepoint
+ */
+struct LDKHtlcBasepoint HtlcBasepoint_clone(const struct LDKHtlcBasepoint *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the HtlcBasepoint.
+ */
+uint64_t HtlcBasepoint_hash(const struct LDKHtlcBasepoint *NONNULL_PTR o);
+
+/**
+ * Get inner Public Key
+ */
+MUST_USE_RES struct LDKPublicKey HtlcBasepoint_to_public_key(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg);
+
+/**
+ *Derives the \"tweak\" used in calculate [`HtlcKey::from_basepoint`].\n\n[`HtlcKey::from_basepoint`] calculates a private key as:\n`privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)`\n\nThis calculates the hash part in the tweak derivation process, which is used to\nensure that each key is unique and cannot be guessed by an external party.
+ */
+MUST_USE_RES struct LDKThirtyTwoBytes HtlcBasepoint_derive_add_tweak(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
+
+/**
+ * Serialize the HtlcBasepoint object into a byte array which can be read by HtlcBasepoint_read
+ */
+struct LDKCVec_u8Z HtlcBasepoint_write(const struct LDKHtlcBasepoint *NONNULL_PTR obj);
+
+/**
+ * Read a HtlcBasepoint from a byte array, created by HtlcBasepoint_write
+ */
+struct LDKCResult_HtlcBasepointDecodeErrorZ HtlcBasepoint_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the HtlcKey, if is_owned is set and inner is non-NULL.
+ */
+void HtlcKey_free(struct LDKHtlcKey this_obj);
+
+struct LDKPublicKey HtlcKey_get_a(const struct LDKHtlcKey *NONNULL_PTR this_ptr);
+
+void HtlcKey_set_a(struct LDKHtlcKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Constructs a new HtlcKey given each field
+ */
+MUST_USE_RES struct LDKHtlcKey HtlcKey_new(struct LDKPublicKey a_arg);
+
+/**
+ * Checks if two HtlcKeys contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool HtlcKey_eq(const struct LDKHtlcKey *NONNULL_PTR a, const struct LDKHtlcKey *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the HtlcKey
+ */
+struct LDKHtlcKey HtlcKey_clone(const struct LDKHtlcKey *NONNULL_PTR orig);
+
+/**
+ *Derive a public htlcpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
+ */
+MUST_USE_RES struct LDKHtlcKey HtlcKey_from_basepoint(const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
+
+/**
+ *Build a htlcpubkey directly from an already-derived private key
+ */
+MUST_USE_RES struct LDKHtlcKey HtlcKey_from_secret_key(const uint8_t (*sk)[32]);
+
+/**
+ * Get inner Public Key
+ */
+MUST_USE_RES struct LDKPublicKey HtlcKey_to_public_key(const struct LDKHtlcKey *NONNULL_PTR this_arg);
+
+/**
+ * Serialize the HtlcKey object into a byte array which can be read by HtlcKey_read
+ */
+struct LDKCVec_u8Z HtlcKey_write(const struct LDKHtlcKey *NONNULL_PTR obj);
+
+/**
+ * Read a HtlcKey from a byte array, created by HtlcKey_write
+ */
+struct LDKCResult_HtlcKeyDecodeErrorZ HtlcKey_read(struct LDKu8slice ser);
+
+/**
+ * Adds a tweak to a public key to derive a new public key.
  *
- * The provided `payment_id` is used to ensure that only one invoice is paid for the request
- * when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
- * been sent.
+ * May panic if `tweak` is not the output of a SHA-256 hash.
+ */
+struct LDKPublicKey add_public_key_tweak(struct LDKPublicKey base_point, const uint8_t (*tweak)[32]);
+
+/**
+ * Frees any resources used by the RevocationBasepoint, if is_owned is set and inner is non-NULL.
+ */
+void RevocationBasepoint_free(struct LDKRevocationBasepoint this_obj);
+
+struct LDKPublicKey RevocationBasepoint_get_a(const struct LDKRevocationBasepoint *NONNULL_PTR this_ptr);
+
+void RevocationBasepoint_set_a(struct LDKRevocationBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Constructs a new RevocationBasepoint given each field
+ */
+MUST_USE_RES struct LDKRevocationBasepoint RevocationBasepoint_new(struct LDKPublicKey a_arg);
+
+/**
+ * Checks if two RevocationBasepoints contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool RevocationBasepoint_eq(const struct LDKRevocationBasepoint *NONNULL_PTR a, const struct LDKRevocationBasepoint *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the RevocationBasepoint
+ */
+struct LDKRevocationBasepoint RevocationBasepoint_clone(const struct LDKRevocationBasepoint *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the RevocationBasepoint.
+ */
+uint64_t RevocationBasepoint_hash(const struct LDKRevocationBasepoint *NONNULL_PTR o);
+
+/**
+ * Get inner Public Key
+ */
+MUST_USE_RES struct LDKPublicKey RevocationBasepoint_to_public_key(const struct LDKRevocationBasepoint *NONNULL_PTR this_arg);
+
+/**
+ * Serialize the RevocationBasepoint object into a byte array which can be read by RevocationBasepoint_read
+ */
+struct LDKCVec_u8Z RevocationBasepoint_write(const struct LDKRevocationBasepoint *NONNULL_PTR obj);
+
+/**
+ * Read a RevocationBasepoint from a byte array, created by RevocationBasepoint_write
+ */
+struct LDKCResult_RevocationBasepointDecodeErrorZ RevocationBasepoint_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the RevocationKey, if is_owned is set and inner is non-NULL.
+ */
+void RevocationKey_free(struct LDKRevocationKey this_obj);
+
+struct LDKPublicKey RevocationKey_get_a(const struct LDKRevocationKey *NONNULL_PTR this_ptr);
+
+void RevocationKey_set_a(struct LDKRevocationKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Constructs a new RevocationKey given each field
+ */
+MUST_USE_RES struct LDKRevocationKey RevocationKey_new(struct LDKPublicKey a_arg);
+
+/**
+ * Checks if two RevocationKeys contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool RevocationKey_eq(const struct LDKRevocationKey *NONNULL_PTR a, const struct LDKRevocationKey *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the RevocationKey
+ */
+struct LDKRevocationKey RevocationKey_clone(const struct LDKRevocationKey *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the RevocationKey.
+ */
+uint64_t RevocationKey_hash(const struct LDKRevocationKey *NONNULL_PTR o);
+
+/**
+ * Derives a per-commitment-transaction revocation public key from one party's per-commitment
+ * point and the other party's [`RevocationBasepoint`]. This is the public equivalent of
+ * [`chan_utils::derive_private_revocation_key`] - using only public keys to derive a public
+ * key instead of private keys.
  *
- * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
- * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
- * payment will fail with an [`Event::InvoiceRequestFailed`].
+ * Note that this is infallible iff we trust that at least one of the two input keys are randomly
+ * generated (ie our own).
  *
- * # Privacy
+ * [`chan_utils::derive_private_revocation_key`]: crate::ln::chan_utils::derive_private_revocation_key
+ */
+MUST_USE_RES struct LDKRevocationKey RevocationKey_from_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
+
+/**
+ * Get inner Public Key
+ */
+MUST_USE_RES struct LDKPublicKey RevocationKey_to_public_key(const struct LDKRevocationKey *NONNULL_PTR this_arg);
+
+/**
+ * Serialize the RevocationKey object into a byte array which can be read by RevocationKey_read
+ */
+struct LDKCVec_u8Z RevocationKey_write(const struct LDKRevocationKey *NONNULL_PTR obj);
+
+/**
+ * Read a RevocationKey from a byte array, created by RevocationKey_write
+ */
+struct LDKCResult_RevocationKeyDecodeErrorZ RevocationKey_read(struct LDKu8slice ser);
+
+/**
+ * Creates a copy of the InboundHTLCStateDetails
+ */
+enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_clone(const enum LDKInboundHTLCStateDetails *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new AwaitingRemoteRevokeToAdd-variant InboundHTLCStateDetails
+ */
+enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_add(void);
+
+/**
+ * Utility method to constructs a new Committed-variant InboundHTLCStateDetails
+ */
+enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_committed(void);
+
+/**
+ * Utility method to constructs a new AwaitingRemoteRevokeToRemoveFulfill-variant InboundHTLCStateDetails
+ */
+enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fulfill(void);
+
+/**
+ * Utility method to constructs a new AwaitingRemoteRevokeToRemoveFail-variant InboundHTLCStateDetails
+ */
+enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fail(void);
+
+/**
+ * Serialize the InboundHTLCStateDetails object into a byte array which can be read by InboundHTLCStateDetails_read
+ */
+struct LDKCVec_u8Z InboundHTLCStateDetails_write(const enum LDKInboundHTLCStateDetails *NONNULL_PTR obj);
+
+/**
+ * Read a InboundHTLCStateDetails from a byte array, created by InboundHTLCStateDetails_write
+ */
+struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ InboundHTLCStateDetails_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the InboundHTLCDetails, if is_owned is set and inner is non-NULL.
+ */
+void InboundHTLCDetails_free(struct LDKInboundHTLCDetails this_obj);
+
+/**
+ * The HTLC ID.
+ * The IDs are incremented by 1 starting from 0 for each offered HTLC.
+ * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
+ * and not part of any commitment transaction.
+ */
+uint64_t InboundHTLCDetails_get_htlc_id(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The HTLC ID.
+ * The IDs are incremented by 1 starting from 0 for each offered HTLC.
+ * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
+ * and not part of any commitment transaction.
+ */
+void InboundHTLCDetails_set_htlc_id(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The amount in msat.
+ */
+uint64_t InboundHTLCDetails_get_amount_msat(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The amount in msat.
+ */
+void InboundHTLCDetails_set_amount_msat(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The block height at which this HTLC expires.
+ */
+uint32_t InboundHTLCDetails_get_cltv_expiry(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The block height at which this HTLC expires.
+ */
+void InboundHTLCDetails_set_cltv_expiry(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The payment hash.
+ */
+const uint8_t (*InboundHTLCDetails_get_payment_hash(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The payment hash.
+ */
+void InboundHTLCDetails_set_payment_hash(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The state of the HTLC in the state machine.
  *
- * Uses a one-hop [`BlindedPath`] for the reply path with [`ChannelManager::get_our_node_id`]
- * as the introduction node and a derived payer id for payer privacy. As such, currently, the
- * node must be announced. Otherwise, there is no way to find a path to the introduction node
- * in order to send the [`Bolt12Invoice`].
+ * Determines on which commitment transactions the HTLC is included and what message the HTLC is
+ * waiting for to advance to the next state.
  *
- * # Limitations
+ * See [`InboundHTLCStateDetails`] for information on the specific states.
  *
- * Requires a direct connection to an introduction node in [`Offer::paths`] or to
- * [`Offer::signing_pubkey`], if empty. A similar restriction applies to the responding
- * [`Bolt12Invoice::payment_paths`].
+ * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
+ * states may result in `None` here.
+ */
+struct LDKCOption_InboundHTLCStateDetailsZ InboundHTLCDetails_get_state(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The state of the HTLC in the state machine.
  *
- * # Errors
+ * Determines on which commitment transactions the HTLC is included and what message the HTLC is
+ * waiting for to advance to the next state.
  *
- * Errors if:
- * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
- * - the provided parameters are invalid for the offer,
- * - the offer is for an unsupported chain, or
- * - the parameterized [`Router`] is unable to create a blinded reply path for the invoice
- *   request.
+ * See [`InboundHTLCStateDetails`] for information on the specific states.
  *
- * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
- * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
- * [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
- * [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
- * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
- * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
+ * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
+ * states may result in `None` here.
  */
-MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ ChannelManager_pay_for_offer(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOffer *NONNULL_PTR offer, struct LDKCOption_u64Z quantity, struct LDKCOption_u64Z amount_msats, struct LDKCOption_StrZ payer_note, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat);
+void InboundHTLCDetails_set_state(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_InboundHTLCStateDetailsZ val);
 
 /**
- * Creates a [`Bolt12Invoice`] for a [`Refund`] and enqueues it to be sent via an onion
- * message.
- *
- * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a
- * [`BlindedPath`] containing the [`PaymentSecret`] needed to reconstruct the corresponding
- * [`PaymentPreimage`]. It is returned purely for informational purposes.
- *
- * # Limitations
+ * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
+ * from the local commitment transaction and added to the commitment transaction fee.
+ * For non-anchor channels, this takes into account the cost of the second-stage HTLC
+ * transactions as well.
  *
- * Requires a direct connection to an introduction node in [`Refund::paths`] or to
- * [`Refund::payer_id`], if empty. This request is best effort; an invoice will be sent to each
- * node meeting the aforementioned criteria, but there's no guarantee that they will be
- * received and no retries will be made.
+ * When the local commitment transaction is broadcasted as part of a unilateral closure,
+ * the value of this HTLC will therefore not be claimable but instead burned as a transaction
+ * fee.
  *
- * # Errors
+ * Note that dust limits are specific to each party. An HTLC can be dust for the local
+ * commitment transaction but not for the counterparty's commitment transaction and vice versa.
+ */
+bool InboundHTLCDetails_get_is_dust(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
+ * from the local commitment transaction and added to the commitment transaction fee.
+ * For non-anchor channels, this takes into account the cost of the second-stage HTLC
+ * transactions as well.
  *
- * Errors if:
- * - the refund is for an unsupported chain, or
- * - the parameterized [`Router`] is unable to create a blinded payment path or reply path for
- *   the invoice.
+ * When the local commitment transaction is broadcasted as part of a unilateral closure,
+ * the value of this HTLC will therefore not be claimable but instead burned as a transaction
+ * fee.
  *
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * Note that dust limits are specific to each party. An HTLC can be dust for the local
+ * commitment transaction but not for the counterparty's commitment transaction and vice versa.
  */
-MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ ChannelManager_request_refund_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRefund *NONNULL_PTR refund);
+void InboundHTLCDetails_set_is_dust(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, bool val);
 
 /**
- * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
- * to pay us.
- *
- * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
- * [`PaymentHash`] and [`PaymentPreimage`] for you.
+ * Constructs a new InboundHTLCDetails given each field
+ */
+MUST_USE_RES struct LDKInboundHTLCDetails InboundHTLCDetails_new(uint64_t htlc_id_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_InboundHTLCStateDetailsZ state_arg, bool is_dust_arg);
+
+/**
+ * Creates a copy of the InboundHTLCDetails
+ */
+struct LDKInboundHTLCDetails InboundHTLCDetails_clone(const struct LDKInboundHTLCDetails *NONNULL_PTR orig);
+
+/**
+ * Serialize the InboundHTLCDetails object into a byte array which can be read by InboundHTLCDetails_read
+ */
+struct LDKCVec_u8Z InboundHTLCDetails_write(const struct LDKInboundHTLCDetails *NONNULL_PTR obj);
+
+/**
+ * Read a InboundHTLCDetails from a byte array, created by InboundHTLCDetails_write
+ */
+struct LDKCResult_InboundHTLCDetailsDecodeErrorZ InboundHTLCDetails_read(struct LDKu8slice ser);
+
+/**
+ * Creates a copy of the OutboundHTLCStateDetails
+ */
+enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_clone(const enum LDKOutboundHTLCStateDetails *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new AwaitingRemoteRevokeToAdd-variant OutboundHTLCStateDetails
+ */
+enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_add(void);
+
+/**
+ * Utility method to constructs a new Committed-variant OutboundHTLCStateDetails
+ */
+enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_committed(void);
+
+/**
+ * Utility method to constructs a new AwaitingRemoteRevokeToRemoveSuccess-variant OutboundHTLCStateDetails
+ */
+enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_success(void);
+
+/**
+ * Utility method to constructs a new AwaitingRemoteRevokeToRemoveFailure-variant OutboundHTLCStateDetails
+ */
+enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_failure(void);
+
+/**
+ * Serialize the OutboundHTLCStateDetails object into a byte array which can be read by OutboundHTLCStateDetails_read
+ */
+struct LDKCVec_u8Z OutboundHTLCStateDetails_write(const enum LDKOutboundHTLCStateDetails *NONNULL_PTR obj);
+
+/**
+ * Read a OutboundHTLCStateDetails from a byte array, created by OutboundHTLCStateDetails_write
+ */
+struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ OutboundHTLCStateDetails_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the OutboundHTLCDetails, if is_owned is set and inner is non-NULL.
+ */
+void OutboundHTLCDetails_free(struct LDKOutboundHTLCDetails this_obj);
+
+/**
+ * The HTLC ID.
+ * The IDs are incremented by 1 starting from 0 for each offered HTLC.
+ * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
+ * and not part of any commitment transaction.
  *
- * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`] event, which
- * will have the [`PaymentClaimable::purpose`] return `Some` for [`PaymentPurpose::preimage`]. That
- * should then be passed directly to [`claim_funds`].
+ * Not present when we are awaiting a remote revocation and the HTLC is not added yet.
+ */
+struct LDKCOption_u64Z OutboundHTLCDetails_get_htlc_id(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The HTLC ID.
+ * The IDs are incremented by 1 starting from 0 for each offered HTLC.
+ * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
+ * and not part of any commitment transaction.
  *
- * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
+ * Not present when we are awaiting a remote revocation and the HTLC is not added yet.
+ */
+void OutboundHTLCDetails_set_htlc_id(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * The amount in msat.
+ */
+uint64_t OutboundHTLCDetails_get_amount_msat(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The amount in msat.
+ */
+void OutboundHTLCDetails_set_amount_msat(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The block height at which this HTLC expires.
+ */
+uint32_t OutboundHTLCDetails_get_cltv_expiry(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The block height at which this HTLC expires.
+ */
+void OutboundHTLCDetails_set_cltv_expiry(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The payment hash.
+ */
+const uint8_t (*OutboundHTLCDetails_get_payment_hash(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The payment hash.
+ */
+void OutboundHTLCDetails_set_payment_hash(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The state of the HTLC in the state machine.
  *
- * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
- * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
+ * Determines on which commitment transactions the HTLC is included and what message the HTLC is
+ * waiting for to advance to the next state.
  *
- * # Note
+ * See [`OutboundHTLCStateDetails`] for information on the specific states.
  *
- * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
- * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
+ * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
+ * states may result in `None` here.
+ */
+struct LDKCOption_OutboundHTLCStateDetailsZ OutboundHTLCDetails_get_state(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The state of the HTLC in the state machine.
  *
- * Errors if `min_value_msat` is greater than total bitcoin supply.
+ * Determines on which commitment transactions the HTLC is included and what message the HTLC is
+ * waiting for to advance to the next state.
  *
- * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
- * on versions of LDK prior to 0.0.114.
+ * See [`OutboundHTLCStateDetails`] for information on the specific states.
  *
- * [`claim_funds`]: Self::claim_funds
- * [`PaymentClaimable`]: events::Event::PaymentClaimable
- * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
- * [`PaymentPurpose::preimage`]: events::PaymentPurpose::preimage
- * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
+ * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
+ * states may result in `None` here.
  */
-MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
+void OutboundHTLCDetails_set_state(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_OutboundHTLCStateDetailsZ val);
 
 /**
- * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
- * stored external to LDK.
+ * The extra fee being skimmed off the top of this HTLC.
+ */
+struct LDKCOption_u64Z OutboundHTLCDetails_get_skimmed_fee_msat(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The extra fee being skimmed off the top of this HTLC.
+ */
+void OutboundHTLCDetails_set_skimmed_fee_msat(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
+ * from the local commitment transaction and added to the commitment transaction fee.
+ * For non-anchor channels, this takes into account the cost of the second-stage HTLC
+ * transactions as well.
  *
- * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
- * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
- * the `min_value_msat` provided here, if one is provided.
+ * When the local commitment transaction is broadcasted as part of a unilateral closure,
+ * the value of this HTLC will therefore not be claimable but instead burned as a transaction
+ * fee.
  *
- * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
- * note that LDK will not stop you from registering duplicate payment hashes for inbound
- * payments.
+ * Note that dust limits are specific to each party. An HTLC can be dust for the local
+ * commitment transaction but not for the counterparty's commitment transaction and vice versa.
+ */
+bool OutboundHTLCDetails_get_is_dust(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
+ * from the local commitment transaction and added to the commitment transaction fee.
+ * For non-anchor channels, this takes into account the cost of the second-stage HTLC
+ * transactions as well.
  *
- * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
- * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
- * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
- * sender \"proof-of-payment\" unless they have paid the required amount.
+ * When the local commitment transaction is broadcasted as part of a unilateral closure,
+ * the value of this HTLC will therefore not be claimable but instead burned as a transaction
+ * fee.
  *
- * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
- * in excess of the current time. This should roughly match the expiry time set in the invoice.
- * After this many seconds, we will remove the inbound payment, resulting in any attempts to
- * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
- * invoices when no timeout is set.
+ * Note that dust limits are specific to each party. An HTLC can be dust for the local
+ * commitment transaction but not for the counterparty's commitment transaction and vice versa.
+ */
+void OutboundHTLCDetails_set_is_dust(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * Constructs a new OutboundHTLCDetails given each field
+ */
+MUST_USE_RES struct LDKOutboundHTLCDetails OutboundHTLCDetails_new(struct LDKCOption_u64Z htlc_id_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_OutboundHTLCStateDetailsZ state_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg, bool is_dust_arg);
+
+/**
+ * Creates a copy of the OutboundHTLCDetails
+ */
+struct LDKOutboundHTLCDetails OutboundHTLCDetails_clone(const struct LDKOutboundHTLCDetails *NONNULL_PTR orig);
+
+/**
+ * Serialize the OutboundHTLCDetails object into a byte array which can be read by OutboundHTLCDetails_read
+ */
+struct LDKCVec_u8Z OutboundHTLCDetails_write(const struct LDKOutboundHTLCDetails *NONNULL_PTR obj);
+
+/**
+ * Read a OutboundHTLCDetails from a byte array, created by OutboundHTLCDetails_write
+ */
+struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ OutboundHTLCDetails_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
+ */
+void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
+
+/**
+ * Base routing fee in millisatoshis.
+ */
+uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
+
+/**
+ * Base routing fee in millisatoshis.
+ */
+void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
+ */
+uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
+
+/**
+ * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
+ */
+void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
+ * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
+ * `cltv_expiry_delta` for more details.
+ */
+uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
+ * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
+ * `cltv_expiry_delta` for more details.
+ */
+void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Constructs a new CounterpartyForwardingInfo given each field
+ */
+MUST_USE_RES struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg);
+
+/**
+ * Creates a copy of the CounterpartyForwardingInfo
+ */
+struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
+
+/**
+ * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
+ */
+struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
+
+/**
+ * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
+ */
+struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
+ */
+void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
+
+/**
+ * The node_id of our counterparty
+ */
+struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+
+/**
+ * The node_id of our counterparty
+ */
+void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * The Features the channel counterparty provided upon last connection.
+ * Useful for routing as it is the most up-to-date copy of the counterparty's features and
+ * many routing-relevant features are present in the init context.
+ */
+struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+
+/**
+ * The Features the channel counterparty provided upon last connection.
+ * Useful for routing as it is the most up-to-date copy of the counterparty's features and
+ * many routing-relevant features are present in the init context.
+ */
+void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
+
+/**
+ * The value, in satoshis, that must always be held in the channel for our counterparty. This
+ * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
+ * claiming at least this value on chain.
+ *
+ * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
+ *
+ * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
+ */
+uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+
+/**
+ * The value, in satoshis, that must always be held in the channel for our counterparty. This
+ * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
+ * claiming at least this value on chain.
+ *
+ * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
+ *
+ * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
+ */
+void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Information on the fees and requirements that the counterparty requires when forwarding
+ * payments to us through this channel.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+
+/**
+ * Information on the fees and requirements that the counterparty requires when forwarding
+ * payments to us through this channel.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
+
+/**
+ * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
+ * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
+ * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
+ */
+struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+
+/**
+ * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
+ * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
+ * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
+ */
+void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
+ */
+struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+
+/**
+ * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
+ */
+void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * Constructs a new ChannelCounterparty given each field
+ *
+ * Note that forwarding_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKChannelCounterparty ChannelCounterparty_new(struct LDKPublicKey node_id_arg, struct LDKInitFeatures features_arg, uint64_t unspendable_punishment_reserve_arg, struct LDKCounterpartyForwardingInfo forwarding_info_arg, struct LDKCOption_u64Z outbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z outbound_htlc_maximum_msat_arg);
+
+/**
+ * Creates a copy of the ChannelCounterparty
+ */
+struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
+
+/**
+ * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
+ */
+struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
+
+/**
+ * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
+ */
+struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
+ */
+void ChannelDetails_free(struct LDKChannelDetails this_obj);
+
+/**
+ * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
+ * thereafter this is the txid of the funding transaction xor the funding transaction output).
+ * Note that this means this value is *not* persistent - it can change once during the
+ * lifetime of the channel.
+ */
+struct LDKChannelId ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
+ * thereafter this is the txid of the funding transaction xor the funding transaction output).
+ * Note that this means this value is *not* persistent - it can change once during the
+ * lifetime of the channel.
+ */
+void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * Parameters which apply to our counterparty. See individual fields for more information.
+ */
+struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Parameters which apply to our counterparty. See individual fields for more information.
+ */
+void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
+
+/**
+ * The Channel's funding transaction output, if we've negotiated the funding transaction with
+ * our counterparty already.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The Channel's funding transaction output, if we've negotiated the funding transaction with
+ * our counterparty already.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+
+/**
+ * The features which this channel operates with. See individual features for more info.
+ *
+ * `None` until negotiation completes and the channel type is finalized.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The features which this channel operates with. See individual features for more info.
+ *
+ * `None` until negotiation completes and the channel type is finalized.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
+
+/**
+ * The position of the funding transaction in the chain. None if the funding transaction has
+ * not yet been confirmed and the channel fully opened.
+ *
+ * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
+ * payments instead of this. See [`get_inbound_payment_scid`].
+ *
+ * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
+ * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
+ *
+ * [`inbound_scid_alias`]: Self::inbound_scid_alias
+ * [`outbound_scid_alias`]: Self::outbound_scid_alias
+ * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
+ * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
+ * [`confirmations_required`]: Self::confirmations_required
+ */
+struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The position of the funding transaction in the chain. None if the funding transaction has
+ * not yet been confirmed and the channel fully opened.
+ *
+ * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
+ * payments instead of this. See [`get_inbound_payment_scid`].
+ *
+ * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
+ * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
+ *
+ * [`inbound_scid_alias`]: Self::inbound_scid_alias
+ * [`outbound_scid_alias`]: Self::outbound_scid_alias
+ * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
+ * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
+ * [`confirmations_required`]: Self::confirmations_required
+ */
+void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
+ * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
+ * the channel has not yet been confirmed (as long as [`confirmations_required`] is
+ * `Some(0)`).
+ *
+ * This will be `None` as long as the channel is not available for routing outbound payments.
+ *
+ * [`short_channel_id`]: Self::short_channel_id
+ * [`confirmations_required`]: Self::confirmations_required
+ */
+struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
+ * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
+ * the channel has not yet been confirmed (as long as [`confirmations_required`] is
+ * `Some(0)`).
+ *
+ * This will be `None` as long as the channel is not available for routing outbound payments.
+ *
+ * [`short_channel_id`]: Self::short_channel_id
+ * [`confirmations_required`]: Self::confirmations_required
+ */
+void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * An optional [`short_channel_id`] alias for this channel, randomly generated by our
+ * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
+ * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
+ * when they see a payment to be routed to us.
+ *
+ * Our counterparty may choose to rotate this value at any time, though will always recognize
+ * previous values for inbound payment forwarding.
+ *
+ * [`short_channel_id`]: Self::short_channel_id
+ */
+struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * An optional [`short_channel_id`] alias for this channel, randomly generated by our
+ * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
+ * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
+ * when they see a payment to be routed to us.
+ *
+ * Our counterparty may choose to rotate this value at any time, though will always recognize
+ * previous values for inbound payment forwarding.
+ *
+ * [`short_channel_id`]: Self::short_channel_id
+ */
+void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * The value, in satoshis, of this channel as appears in the funding output
+ */
+uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The value, in satoshis, of this channel as appears in the funding output
+ */
+void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The value, in satoshis, that must always be held in the channel for us. This value ensures
+ * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
+ * this value on chain.
+ *
+ * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ *
+ * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
+ */
+struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The value, in satoshis, that must always be held in the channel for us. This value ensures
+ * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
+ * this value on chain.
+ *
+ * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ *
+ * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
+ */
+void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
+ * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
+ * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
+ * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
+ * serialized with LDK versions prior to 0.0.113.
+ *
+ * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+ */
+struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
+ * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
+ * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
+ * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
+ * serialized with LDK versions prior to 0.0.113.
+ *
+ * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+ */
+void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
+
+/**
+ * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
+ * which is applied to commitment and HTLC transactions.
+ *
+ * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
+ */
+struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
+ * which is applied to commitment and HTLC transactions.
+ *
+ * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
+ */
+void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
+
+/**
+ * Our total balance.  This is the amount we would get if we close the channel.
+ * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
+ * amount is not likely to be recoverable on close.
+ *
+ * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
+ * balance is not available for inclusion in new outbound HTLCs). This further does not include
+ * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
+ * This does not consider any on-chain fees.
+ *
+ * See also [`ChannelDetails::outbound_capacity_msat`]
+ */
+uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Our total balance.  This is the amount we would get if we close the channel.
+ * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
+ * amount is not likely to be recoverable on close.
+ *
+ * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
+ * balance is not available for inclusion in new outbound HTLCs). This further does not include
+ * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
+ * This does not consider any on-chain fees.
+ *
+ * See also [`ChannelDetails::outbound_capacity_msat`]
+ */
+void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The available outbound capacity for sending HTLCs to the remote peer. This does not include
+ * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
+ * available for inclusion in new outbound HTLCs). This further does not include any pending
+ * outgoing HTLCs which are awaiting some other resolution to be sent.
+ *
+ * See also [`ChannelDetails::balance_msat`]
+ *
+ * This value is not exact. Due to various in-flight changes, feerate changes, and our
+ * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
+ * should be able to spend nearly this amount.
+ */
+uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The available outbound capacity for sending HTLCs to the remote peer. This does not include
+ * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
+ * available for inclusion in new outbound HTLCs). This further does not include any pending
+ * outgoing HTLCs which are awaiting some other resolution to be sent.
+ *
+ * See also [`ChannelDetails::balance_msat`]
+ *
+ * This value is not exact. Due to various in-flight changes, feerate changes, and our
+ * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
+ * should be able to spend nearly this amount.
+ */
+void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The available outbound capacity for sending a single HTLC to the remote peer. This is
+ * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
+ * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
+ * to use a limit as close as possible to the HTLC limit we can currently send.
+ *
+ * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
+ * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
+ */
+uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The available outbound capacity for sending a single HTLC to the remote peer. This is
+ * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
+ * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
+ * to use a limit as close as possible to the HTLC limit we can currently send.
+ *
+ * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
+ * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
+ */
+void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
+ * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
+ * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
+ * route which is valid.
+ */
+uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
+ * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
+ * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
+ * route which is valid.
+ */
+void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The available inbound capacity for the remote peer to send HTLCs to us. This does not
+ * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
+ * available for inclusion in new inbound HTLCs).
+ * Note that there are some corner cases not fully handled here, so the actual available
+ * inbound capacity may be slightly higher than this.
+ *
+ * This value is not exact. Due to various in-flight changes, feerate changes, and our
+ * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
+ * However, our counterparty should be able to spend nearly this amount.
+ */
+uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The available inbound capacity for the remote peer to send HTLCs to us. This does not
+ * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
+ * available for inclusion in new inbound HTLCs).
+ * Note that there are some corner cases not fully handled here, so the actual available
+ * inbound capacity may be slightly higher than this.
+ *
+ * This value is not exact. Due to various in-flight changes, feerate changes, and our
+ * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
+ * However, our counterparty should be able to spend nearly this amount.
+ */
+void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The number of required confirmations on the funding transaction before the funding will be
+ * considered \"locked\". This number is selected by the channel fundee (i.e. us if
+ * [`is_outbound`] is *not* set), and can be selected for inbound channels with
+ * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
+ * [`ChannelHandshakeLimits::max_minimum_depth`].
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ *
+ * [`is_outbound`]: ChannelDetails::is_outbound
+ * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
+ * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
+ */
+struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The number of required confirmations on the funding transaction before the funding will be
+ * considered \"locked\". This number is selected by the channel fundee (i.e. us if
+ * [`is_outbound`] is *not* set), and can be selected for inbound channels with
+ * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
+ * [`ChannelHandshakeLimits::max_minimum_depth`].
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ *
+ * [`is_outbound`]: ChannelDetails::is_outbound
+ * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
+ * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
+ */
+void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
+
+/**
+ * The current number of confirmations on the funding transaction.
+ *
+ * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
+ */
+struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The current number of confirmations on the funding transaction.
+ *
+ * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
+ */
+void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
+
+/**
+ * The number of blocks (after our commitment transaction confirms) that we will need to wait
+ * until we can claim our funds after we force-close the channel. During this time our
+ * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
+ * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
+ * time to claim our non-HTLC-encumbered funds.
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ */
+struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The number of blocks (after our commitment transaction confirms) that we will need to wait
+ * until we can claim our funds after we force-close the channel. During this time our
+ * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
+ * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
+ * time to claim our non-HTLC-encumbered funds.
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ */
+void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
+
+/**
+ * True if the channel was initiated (and thus funded) by us.
+ */
+bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * True if the channel was initiated (and thus funded) by us.
+ */
+void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * True if the channel is confirmed, channel_ready messages have been exchanged, and the
+ * channel is not currently being shut down. `channel_ready` message exchange implies the
+ * required confirmation count has been reached (and we were connected to the peer at some
+ * point after the funding transaction received enough confirmations). The required
+ * confirmation count is provided in [`confirmations_required`].
+ *
+ * [`confirmations_required`]: ChannelDetails::confirmations_required
+ */
+bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * True if the channel is confirmed, channel_ready messages have been exchanged, and the
+ * channel is not currently being shut down. `channel_ready` message exchange implies the
+ * required confirmation count has been reached (and we were connected to the peer at some
+ * point after the funding transaction received enough confirmations). The required
+ * confirmation count is provided in [`confirmations_required`].
+ *
+ * [`confirmations_required`]: ChannelDetails::confirmations_required
+ */
+void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * The stage of the channel's shutdown.
+ * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The stage of the channel's shutdown.
+ * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
+ */
+void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val);
+
+/**
+ * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
+ * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
+ *
+ * This is a strict superset of `is_channel_ready`.
+ */
+bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
+ * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
+ *
+ * This is a strict superset of `is_channel_ready`.
+ */
+void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * True if this channel is (or will be) publicly-announced.
+ */
+bool ChannelDetails_get_is_announced(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * True if this channel is (or will be) publicly-announced.
+ */
+void ChannelDetails_set_is_announced(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * The smallest value HTLC (in msat) we will accept, for this channel. This field
+ * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
+ */
+struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The smallest value HTLC (in msat) we will accept, for this channel. This field
+ * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
+ */
+void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * The largest value HTLC (in msat) we currently will accept, for this channel.
+ */
+struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The largest value HTLC (in msat) we currently will accept, for this channel.
+ */
+void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * Set of configurable parameters that affect channel operation.
+ *
+ * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Set of configurable parameters that affect channel operation.
+ *
+ * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
+
+/**
+ * Pending inbound HTLCs.
+ *
+ * This field is empty for objects serialized with LDK versions prior to 0.0.122.
+ */
+struct LDKCVec_InboundHTLCDetailsZ ChannelDetails_get_pending_inbound_htlcs(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Pending inbound HTLCs.
+ *
+ * This field is empty for objects serialized with LDK versions prior to 0.0.122.
+ */
+void ChannelDetails_set_pending_inbound_htlcs(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCVec_InboundHTLCDetailsZ val);
+
+/**
+ * Pending outbound HTLCs.
+ *
+ * This field is empty for objects serialized with LDK versions prior to 0.0.122.
+ */
+struct LDKCVec_OutboundHTLCDetailsZ ChannelDetails_get_pending_outbound_htlcs(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Pending outbound HTLCs.
+ *
+ * This field is empty for objects serialized with LDK versions prior to 0.0.122.
+ */
+void ChannelDetails_set_pending_outbound_htlcs(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCVec_OutboundHTLCDetailsZ val);
+
+/**
+ * Constructs a new ChannelDetails given each field
+ *
+ * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKChannelId channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKChannelTypeFeatures channel_type_arg, struct LDKCOption_u64Z short_channel_id_arg, struct LDKCOption_u64Z outbound_scid_alias_arg, struct LDKCOption_u64Z inbound_scid_alias_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, struct LDKU128 user_channel_id_arg, struct LDKCOption_u32Z feerate_sat_per_1000_weight_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t next_outbound_htlc_limit_msat_arg, uint64_t next_outbound_htlc_minimum_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u32Z confirmations_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, struct LDKCOption_ChannelShutdownStateZ channel_shutdown_state_arg, bool is_usable_arg, bool is_announced_arg, struct LDKCOption_u64Z inbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z inbound_htlc_maximum_msat_arg, struct LDKChannelConfig config_arg, struct LDKCVec_InboundHTLCDetailsZ pending_inbound_htlcs_arg, struct LDKCVec_OutboundHTLCDetailsZ pending_outbound_htlcs_arg);
+
+/**
+ * Creates a copy of the ChannelDetails
+ */
+struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
+
+/**
+ * Gets the current SCID which should be used to identify this channel for inbound payments.
+ * This should be used for providing invoice hints or in any other context where our
+ * counterparty will forward a payment to us.
+ *
+ * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
+ * [`ChannelDetails::short_channel_id`]. See those for more information.
+ */
+MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
+
+/**
+ * Gets the current SCID which should be used to identify this channel for outbound payments.
+ * This should be used in [`Route`]s to describe the first hop or in other contexts where
+ * we're sending or forwarding a payment outbound over this channel.
+ *
+ * This is either the [`ChannelDetails::short_channel_id`], if set, or the
+ * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
+ *
+ * [`Route`]: crate::routing::router::Route
+ */
+MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
+
+/**
+ * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
+ */
+struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
+
+/**
+ * Read a ChannelDetails from a byte array, created by ChannelDetails_write
+ */
+struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
+
+/**
+ * Creates a copy of the ChannelShutdownState
+ */
+enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new NotShuttingDown-variant ChannelShutdownState
+ */
+enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void);
+
+/**
+ * Utility method to constructs a new ShutdownInitiated-variant ChannelShutdownState
+ */
+enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void);
+
+/**
+ * Utility method to constructs a new ResolvingHTLCs-variant ChannelShutdownState
+ */
+enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void);
+
+/**
+ * Utility method to constructs a new NegotiatingClosingFee-variant ChannelShutdownState
+ */
+enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void);
+
+/**
+ * Utility method to constructs a new ShutdownComplete-variant ChannelShutdownState
+ */
+enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void);
+
+/**
+ * Checks if two ChannelShutdownStates contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b);
+
+/**
+ * Serialize the ChannelShutdownState object into a byte array which can be read by ChannelShutdownState_read
+ */
+struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj);
+
+/**
+ * Read a ChannelShutdownState from a byte array, created by ChannelShutdownState_write
+ */
+struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
+ */
+void ExpandedKey_free(struct LDKExpandedKey this_obj);
+
+/**
+ * Create a  new [`ExpandedKey`] for generating an inbound payment hash and secret.
+ *
+ * It is recommended to cache this value and not regenerate it for each new inbound payment.
+ */
+MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
+
+/**
+ * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
+ * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
+ * a `ChannelManager`.
+ *
+ * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
+ * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
+ * regenerate it for each new inbound payment.
+ *
+ * `current_time` is a Unix timestamp representing the current time.
+ *
+ * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
+ * on versions of LDK prior to 0.0.114.
+ *
+ * [phantom node payments]: crate::sign::PhantomKeysManager
+ * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ create(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, const struct LDKEntropySource *NONNULL_PTR entropy_source, uint64_t current_time, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
+
+/**
+ * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
+ * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
+ * without a `ChannelManager`.
+ *
+ * See [`create`] for information on the `keys` and `current_time` parameters.
+ *
+ * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
+ * on versions of LDK prior to 0.0.114.
+ *
+ * [phantom node payments]: crate::sign::PhantomKeysManager
+ */
+struct LDKCResult_ThirtyTwoBytesNoneZ create_from_hash(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, uint64_t current_time, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
+
+/**
+ * Frees any resources used by the DecodeError
+ */
+void DecodeError_free(struct LDKDecodeError this_ptr);
+
+/**
+ * Creates a copy of the DecodeError
+ */
+struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new UnknownVersion-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_unknown_version(void);
+
+/**
+ * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_unknown_required_feature(void);
+
+/**
+ * Utility method to constructs a new InvalidValue-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_invalid_value(void);
+
+/**
+ * Utility method to constructs a new ShortRead-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_short_read(void);
+
+/**
+ * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_bad_length_descriptor(void);
+
+/**
+ * Utility method to constructs a new Io-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_io(enum LDKIOError a);
+
+/**
+ * Utility method to constructs a new UnsupportedCompression-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_unsupported_compression(void);
+
+/**
+ * Utility method to constructs a new DangerousValue-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_dangerous_value(void);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the DecodeError.
+ */
+uint64_t DecodeError_hash(const struct LDKDecodeError *NONNULL_PTR o);
+
+/**
+ * Checks if two DecodeErrors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
+ */
+void Init_free(struct LDKInit this_obj);
+
+/**
+ * The relevant features which the sender supports.
+ */
+struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
+
+/**
+ * The relevant features which the sender supports.
+ */
+void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
+
+/**
+ * Indicates chains the sender is interested in.
+ *
+ * If there are no common chains, the connection will be closed.
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCOption_CVec_ThirtyTwoBytesZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr);
+
+/**
+ * Indicates chains the sender is interested in.
+ *
+ * If there are no common chains, the connection will be closed.
+ */
+void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ThirtyTwoBytesZZ val);
+
+/**
+ * The receipient's network address.
+ *
+ * This adds the option to report a remote IP address back to a connecting peer using the init
+ * message. A node can decide to use that information to discover a potential update to its
+ * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
+ * the new address.
+ */
+struct LDKCOption_SocketAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
+
+/**
+ * The receipient's network address.
+ *
+ * This adds the option to report a remote IP address back to a connecting peer using the init
+ * message. A node can decide to use that information to discover a potential update to its
+ * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
+ * the new address.
+ */
+void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
+
+/**
+ * Constructs a new Init given each field
+ */
+MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg, struct LDKCOption_SocketAddressZ remote_network_address_arg);
+
+/**
+ * Creates a copy of the Init
+ */
+struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the Init.
+ */
+uint64_t Init_hash(const struct LDKInit *NONNULL_PTR o);
+
+/**
+ * Checks if two Inits contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
+ */
+void ErrorMessage_free(struct LDKErrorMessage this_obj);
+
+/**
+ * The channel ID involved in the error.
+ *
+ * All-0s indicates a general error unrelated to a specific channel, after which all channels
+ * with the sending peer should be closed.
+ */
+struct LDKChannelId ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID involved in the error.
+ *
+ * All-0s indicates a general error unrelated to a specific channel, after which all channels
+ * with the sending peer should be closed.
+ */
+void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * A possibly human-readable error description.
+ *
+ * The string should be sanitized before it is used (e.g., emitted to logs or printed to
+ * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
+ * the terminal emulator or the logging subsystem.
+ */
+struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
+
+/**
+ * A possibly human-readable error description.
+ *
+ * The string should be sanitized before it is used (e.g., emitted to logs or printed to
+ * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
+ * the terminal emulator or the logging subsystem.
+ */
+void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
+
+/**
+ * Constructs a new ErrorMessage given each field
+ */
+MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
+
+/**
+ * Creates a copy of the ErrorMessage
+ */
+struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the ErrorMessage.
+ */
+uint64_t ErrorMessage_hash(const struct LDKErrorMessage *NONNULL_PTR o);
+
+/**
+ * Checks if two ErrorMessages contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
+ */
+void WarningMessage_free(struct LDKWarningMessage this_obj);
+
+/**
+ * The channel ID involved in the warning.
+ *
+ * All-0s indicates a warning unrelated to a specific channel.
+ */
+struct LDKChannelId WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID involved in the warning.
+ *
+ * All-0s indicates a warning unrelated to a specific channel.
+ */
+void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * A possibly human-readable warning description.
+ *
+ * The string should be sanitized before it is used (e.g. emitted to logs or printed to
+ * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
+ * the terminal emulator or the logging subsystem.
+ */
+struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
+
+/**
+ * A possibly human-readable warning description.
+ *
+ * The string should be sanitized before it is used (e.g. emitted to logs or printed to
+ * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
+ * the terminal emulator or the logging subsystem.
+ */
+void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
+
+/**
+ * Constructs a new WarningMessage given each field
+ */
+MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
+
+/**
+ * Creates a copy of the WarningMessage
+ */
+struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the WarningMessage.
+ */
+uint64_t WarningMessage_hash(const struct LDKWarningMessage *NONNULL_PTR o);
+
+/**
+ * Checks if two WarningMessages contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
+ */
+void Ping_free(struct LDKPing this_obj);
+
+/**
+ * The desired response length.
+ */
+uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
+
+/**
+ * The desired response length.
+ */
+void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * The ping packet size.
  *
- * Note that we use block header time to time-out pending inbound payments (with some margin
- * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
- * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
- * If you need exact expiry semantics, you should enforce them upon receipt of
- * [`PaymentClaimable`].
+ * This field is not sent on the wire. byteslen zeros are sent.
+ */
+uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
+
+/**
+ * The ping packet size.
  *
- * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
- * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
+ * This field is not sent on the wire. byteslen zeros are sent.
+ */
+void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Constructs a new Ping given each field
+ */
+MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
+
+/**
+ * Creates a copy of the Ping
+ */
+struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the Ping.
+ */
+uint64_t Ping_hash(const struct LDKPing *NONNULL_PTR o);
+
+/**
+ * Checks if two Pings contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
+ */
+void Pong_free(struct LDKPong this_obj);
+
+/**
+ * The pong packet size.
  *
- * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
- * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
+ * This field is not sent on the wire. byteslen zeros are sent.
+ */
+uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
+
+/**
+ * The pong packet size.
  *
- * # Note
+ * This field is not sent on the wire. byteslen zeros are sent.
+ */
+void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Constructs a new Pong given each field
+ */
+MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
+
+/**
+ * Creates a copy of the Pong
+ */
+struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the Pong.
+ */
+uint64_t Pong_hash(const struct LDKPong *NONNULL_PTR o);
+
+/**
+ * Checks if two Pongs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the CommonOpenChannelFields, if is_owned is set and inner is non-NULL.
+ */
+void CommonOpenChannelFields_free(struct LDKCommonOpenChannelFields this_obj);
+
+/**
+ * The genesis hash of the blockchain where the channel is to be opened
+ */
+const uint8_t (*CommonOpenChannelFields_get_chain_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The genesis hash of the blockchain where the channel is to be opened
+ */
+void CommonOpenChannelFields_set_chain_hash(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * A temporary channel ID
+ * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
+ * For V1 channels: a temporary channel ID, until the funding outpoint is announced
+ */
+struct LDKChannelId CommonOpenChannelFields_get_temporary_channel_id(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * A temporary channel ID
+ * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
+ * For V1 channels: a temporary channel ID, until the funding outpoint is announced
+ */
+void CommonOpenChannelFields_set_temporary_channel_id(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * For V1 channels: The channel value
+ * For V2 channels: Part of the channel value contributed by the channel initiator
+ */
+uint64_t CommonOpenChannelFields_get_funding_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * For V1 channels: The channel value
+ * For V2 channels: Part of the channel value contributed by the channel initiator
+ */
+void CommonOpenChannelFields_set_funding_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The threshold below which outputs on transactions broadcast by the channel initiator will be
+ * omitted
+ */
+uint64_t CommonOpenChannelFields_get_dust_limit_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The threshold below which outputs on transactions broadcast by the channel initiator will be
+ * omitted
+ */
+void CommonOpenChannelFields_set_dust_limit_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
+ */
+uint64_t CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
+ */
+void CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The minimum HTLC size incoming to channel initiator, in milli-satoshi
+ */
+uint64_t CommonOpenChannelFields_get_htlc_minimum_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum HTLC size incoming to channel initiator, in milli-satoshi
+ */
+void CommonOpenChannelFields_set_htlc_minimum_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The feerate for the commitment transaction set by the channel initiator until updated by
+ * [`UpdateFee`]
+ */
+uint32_t CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The feerate for the commitment transaction set by the channel initiator until updated by
+ * [`UpdateFee`]
+ */
+void CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
+ * broadcast a commitment transaction
+ */
+uint16_t CommonOpenChannelFields_get_to_self_delay(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
+ * broadcast a commitment transaction
+ */
+void CommonOpenChannelFields_set_to_self_delay(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * The maximum number of inbound HTLCs towards channel initiator
+ */
+uint16_t CommonOpenChannelFields_get_max_accepted_htlcs(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The maximum number of inbound HTLCs towards channel initiator
+ */
+void CommonOpenChannelFields_set_max_accepted_htlcs(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * The channel initiator's key controlling the funding transaction
+ */
+struct LDKPublicKey CommonOpenChannelFields_get_funding_pubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The channel initiator's key controlling the funding transaction
+ */
+void CommonOpenChannelFields_set_funding_pubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Used to derive a revocation key for transactions broadcast by counterparty
+ */
+struct LDKPublicKey CommonOpenChannelFields_get_revocation_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * Used to derive a revocation key for transactions broadcast by counterparty
+ */
+void CommonOpenChannelFields_set_revocation_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * A payment key to channel initiator for transactions broadcast by counterparty
+ */
+struct LDKPublicKey CommonOpenChannelFields_get_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * A payment key to channel initiator for transactions broadcast by counterparty
+ */
+void CommonOpenChannelFields_set_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Used to derive a payment key to channel initiator for transactions broadcast by channel
+ * initiator
+ */
+struct LDKPublicKey CommonOpenChannelFields_get_delayed_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * Used to derive a payment key to channel initiator for transactions broadcast by channel
+ * initiator
+ */
+void CommonOpenChannelFields_set_delayed_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Used to derive an HTLC payment key to channel initiator
+ */
+struct LDKPublicKey CommonOpenChannelFields_get_htlc_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * Used to derive an HTLC payment key to channel initiator
+ */
+void CommonOpenChannelFields_set_htlc_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
+ */
+struct LDKPublicKey CommonOpenChannelFields_get_first_per_commitment_point(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
+ */
+void CommonOpenChannelFields_set_first_per_commitment_point(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * The channel flags to be used
+ */
+uint8_t CommonOpenChannelFields_get_channel_flags(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The channel flags to be used
+ */
+void CommonOpenChannelFields_set_channel_flags(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint8_t val);
+
+/**
+ * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
+ * collaboratively close
+ */
+struct LDKCOption_CVec_u8ZZ CommonOpenChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
+ * collaboratively close
+ */
+void CommonOpenChannelFields_set_shutdown_scriptpubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
+
+/**
+ * The channel type that this channel will represent
  *
- * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
- * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
+ * If this is `None`, we derive the channel type from the intersection of our
+ * feature bits with our counterparty's feature bits from the [`Init`] message.
  *
- * Errors if `min_value_msat` is greater than total bitcoin supply.
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKChannelTypeFeatures CommonOpenChannelFields_get_channel_type(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The channel type that this channel will represent
  *
- * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
- * on versions of LDK prior to 0.0.114.
+ * If this is `None`, we derive the channel type from the intersection of our
+ * feature bits with our counterparty's feature bits from the [`Init`] message.
  *
- * [`create_inbound_payment`]: Self::create_inbound_payment
- * [`PaymentClaimable`]: events::Event::PaymentClaimable
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void CommonOpenChannelFields_set_channel_type(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
+
+/**
+ * Constructs a new CommonOpenChannelFields given each field
+ *
+ * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKCommonOpenChannelFields CommonOpenChannelFields_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKChannelId temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t commitment_feerate_sat_per_1000_weight_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
+
+/**
+ * Creates a copy of the CommonOpenChannelFields
+ */
+struct LDKCommonOpenChannelFields CommonOpenChannelFields_clone(const struct LDKCommonOpenChannelFields *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the CommonOpenChannelFields.
+ */
+uint64_t CommonOpenChannelFields_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR o);
+
+/**
+ * Checks if two CommonOpenChannelFieldss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool CommonOpenChannelFields_eq(const struct LDKCommonOpenChannelFields *NONNULL_PTR a, const struct LDKCommonOpenChannelFields *NONNULL_PTR b);
+
+/**
+ * The [`ChannelParameters`] for this channel.
+ */
+MUST_USE_RES struct LDKChannelParameters CommonOpenChannelFields_channel_parameters(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_arg);
+
+/**
+ * Frees any resources used by the ChannelParameters, if is_owned is set and inner is non-NULL.
+ */
+void ChannelParameters_free(struct LDKChannelParameters this_obj);
+
+/**
+ * The threshold below which outputs on transactions broadcast by the channel initiator will be
+ * omitted.
+ */
+uint64_t ChannelParameters_get_dust_limit_satoshis(const struct LDKChannelParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The threshold below which outputs on transactions broadcast by the channel initiator will be
+ * omitted.
+ */
+void ChannelParameters_set_dust_limit_satoshis(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
+ */
+uint64_t ChannelParameters_get_max_htlc_value_in_flight_msat(const struct LDKChannelParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
+ */
+void ChannelParameters_set_max_htlc_value_in_flight_msat(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The minimum HTLC size for HTLCs towards the channel initiator, in milli-satoshi
+ */
+uint64_t ChannelParameters_get_htlc_minimum_msat(const struct LDKChannelParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum HTLC size for HTLCs towards the channel initiator, in milli-satoshi
+ */
+void ChannelParameters_set_htlc_minimum_msat(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The feerate for the commitment transaction set by the channel initiator until updated by
+ * [`UpdateFee`]
+ */
+uint32_t ChannelParameters_get_commitment_feerate_sat_per_1000_weight(const struct LDKChannelParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The feerate for the commitment transaction set by the channel initiator until updated by
+ * [`UpdateFee`]
+ */
+void ChannelParameters_set_commitment_feerate_sat_per_1000_weight(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The number of blocks which the non-channel-initator will have to wait to claim on-chain
+ * funds if they broadcast a commitment transaction.
+ */
+uint16_t ChannelParameters_get_to_self_delay(const struct LDKChannelParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The number of blocks which the non-channel-initator will have to wait to claim on-chain
+ * funds if they broadcast a commitment transaction.
+ */
+void ChannelParameters_set_to_self_delay(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * The maximum number of pending HTLCs towards the channel initiator.
+ */
+uint16_t ChannelParameters_get_max_accepted_htlcs(const struct LDKChannelParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The maximum number of pending HTLCs towards the channel initiator.
+ */
+void ChannelParameters_set_max_accepted_htlcs(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Constructs a new ChannelParameters given each field
+ */
+MUST_USE_RES struct LDKChannelParameters ChannelParameters_new(uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t commitment_feerate_sat_per_1000_weight_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg);
+
+/**
+ * Creates a copy of the ChannelParameters
+ */
+struct LDKChannelParameters ChannelParameters_clone(const struct LDKChannelParameters *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the ChannelParameters.
+ */
+uint64_t ChannelParameters_hash(const struct LDKChannelParameters *NONNULL_PTR o);
+
+/**
+ * Checks if two ChannelParameterss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool ChannelParameters_eq(const struct LDKChannelParameters *NONNULL_PTR a, const struct LDKChannelParameters *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
+ */
+void OpenChannel_free(struct LDKOpenChannel this_obj);
+
+/**
+ * Common fields of `open_channel(2)`-like messages
+ */
+struct LDKCommonOpenChannelFields OpenChannel_get_common_fields(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
+
+/**
+ * Common fields of `open_channel(2)`-like messages
+ */
+void OpenChannel_set_common_fields(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
+
+/**
+ * The amount to push to the counterparty as part of the open, in milli-satoshi
+ */
+uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
+
+/**
+ * The amount to push to the counterparty as part of the open, in milli-satoshi
+ */
+void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
+ */
+uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
+ */
+void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Constructs a new OpenChannel given each field
+ */
+MUST_USE_RES struct LDKOpenChannel OpenChannel_new(struct LDKCommonOpenChannelFields common_fields_arg, uint64_t push_msat_arg, uint64_t channel_reserve_satoshis_arg);
+
+/**
+ * Creates a copy of the OpenChannel
+ */
+struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the OpenChannel.
+ */
+uint64_t OpenChannel_hash(const struct LDKOpenChannel *NONNULL_PTR o);
+
+/**
+ * Checks if two OpenChannels contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the OpenChannelV2, if is_owned is set and inner is non-NULL.
+ */
+void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj);
+
+/**
+ * Common fields of `open_channel(2)`-like messages
+ */
+struct LDKCommonOpenChannelFields OpenChannelV2_get_common_fields(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
+
+/**
+ * Common fields of `open_channel(2)`-like messages
+ */
+void OpenChannelV2_set_common_fields(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
+
+/**
+ * The feerate for the funding transaction set by the channel initiator
+ */
+uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
+
+/**
+ * The feerate for the funding transaction set by the channel initiator
+ */
+void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The locktime for the funding transaction
+ */
+uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
+
+/**
+ * The locktime for the funding transaction
+ */
+void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
+ */
+struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
+
+/**
+ * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
+ */
+void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Optionally, a requirement that only confirmed inputs can be added
+ */
+enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
+
+/**
+ * Optionally, a requirement that only confirmed inputs can be added
+ */
+void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
+
+/**
+ * Constructs a new OpenChannelV2 given each field
  */
-MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry);
+MUST_USE_RES struct LDKOpenChannelV2 OpenChannelV2_new(struct LDKCommonOpenChannelFields common_fields_arg, uint32_t funding_feerate_sat_per_1000_weight_arg, uint32_t locktime_arg, struct LDKPublicKey second_per_commitment_point_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
 
 /**
- * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
- * previously returned from [`create_inbound_payment`].
- *
- * [`create_inbound_payment`]: Self::create_inbound_payment
+ * Creates a copy of the OpenChannelV2
  */
-MUST_USE_RES struct LDKCResult_ThirtyTwoBytesAPIErrorZ ChannelManager_get_payment_preimage(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
+struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig);
 
 /**
- * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
- * are used when constructing the phantom invoice's route hints.
- *
- * [phantom node payments]: crate::sign::PhantomKeysManager
+ * Generates a non-cryptographic 64-bit hash of the OpenChannelV2.
  */
-MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
+uint64_t OpenChannelV2_hash(const struct LDKOpenChannelV2 *NONNULL_PTR o);
 
 /**
- * Gets route hints for use in receiving [phantom node payments].
- *
- * [phantom node payments]: crate::sign::PhantomKeysManager
+ * Checks if two OpenChannelV2s contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
+bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b);
 
 /**
- * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
- * used when constructing the route hints for HTLCs intended to be intercepted. See
- * [`ChannelManager::forward_intercepted_htlc`].
- *
- * Note that this method is not guaranteed to return unique values, you may need to call it a few
- * times to get a unique scid.
+ * Frees any resources used by the CommonAcceptChannelFields, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
+void CommonAcceptChannelFields_free(struct LDKCommonAcceptChannelFields this_obj);
 
 /**
- * Gets inflight HTLC information by processing pending outbound payments that are in
- * our channels. May be used during pathfinding to account for in-use channel liquidity.
+ * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
  */
-MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
+struct LDKChannelId CommonAcceptChannelFields_get_temporary_channel_id(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
+ * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
  */
-struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
+void CommonAcceptChannelFields_set_temporary_channel_id(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Constructs a new EventsProvider which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
+ * The threshold below which outputs on transactions broadcast by the channel acceptor will be
+ * omitted
  */
-struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
+uint64_t CommonAcceptChannelFields_get_dust_limit_satoshis(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new Listen which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
+ * The threshold below which outputs on transactions broadcast by the channel acceptor will be
+ * omitted
  */
-struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
+void CommonAcceptChannelFields_set_dust_limit_satoshis(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Constructs a new Confirm which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
+ * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
  */
-struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
+uint64_t CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
 
 /**
- * Gets a [`Future`] that completes when this [`ChannelManager`] may need to be persisted or
- * may have events that need processing.
- *
- * In order to check if this [`ChannelManager`] needs persisting, call
- * [`Self::get_and_clear_needs_persistence`].
- *
- * Note that callbacks registered on the [`Future`] MUST NOT call back into this
- * [`ChannelManager`] and should instead register actions to be taken later.
+ * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
  */
-MUST_USE_RES struct LDKFuture ChannelManager_get_event_or_persistence_needed_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
+void CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Returns true if this [`ChannelManager`] needs to be persisted.
- *
- * See [`Self::get_event_or_persistence_needed_future`] for retrieving a [`Future`] that
- * indicates this should be checked.
+ * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
  */
-MUST_USE_RES bool ChannelManager_get_and_clear_needs_persistence(const struct LDKChannelManager *NONNULL_PTR this_arg);
+uint64_t CommonAcceptChannelFields_get_htlc_minimum_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
 
 /**
- * Gets the latest best block which was connected either via the [`chain::Listen`] or
- * [`chain::Confirm`] interfaces.
+ * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
  */
-MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
+void CommonAcceptChannelFields_set_htlc_minimum_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Fetches the set of [`NodeFeatures`] flags that are provided by or required by
- * [`ChannelManager`].
+ * Minimum depth of the funding transaction before the channel is considered open
  */
-MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
+uint32_t CommonAcceptChannelFields_get_minimum_depth(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
 
 /**
- * Fetches the set of [`ChannelFeatures`] flags that are provided by or required by
- * [`ChannelManager`].
+ * Minimum depth of the funding transaction before the channel is considered open
  */
-MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
+void CommonAcceptChannelFields_set_minimum_depth(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Fetches the set of [`ChannelTypeFeatures`] flags that are provided by or required by
- * [`ChannelManager`].
+ * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
+ * broadcast a commitment transaction
  */
-MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
+uint16_t CommonAcceptChannelFields_get_to_self_delay(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
 
 /**
- * Fetches the set of [`InitFeatures`] flags that are provided by or required by
- * [`ChannelManager`].
+ * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
+ * broadcast a commitment transaction
  */
-MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
+void CommonAcceptChannelFields_set_to_self_delay(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
- * 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
+ * The maximum number of inbound HTLCs towards channel acceptor
  */
-struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
+uint16_t CommonAcceptChannelFields_get_max_accepted_htlcs(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
+ * The maximum number of inbound HTLCs towards channel acceptor
  */
-struct LDKOffersMessageHandler ChannelManager_as_OffersMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
+void CommonAcceptChannelFields_set_max_accepted_htlcs(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
- * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is
+ * The channel acceptor's key controlling the funding transaction
  */
-struct LDKNodeIdLookUp ChannelManager_as_NodeIdLookUp(const struct LDKChannelManager *NONNULL_PTR this_arg);
+struct LDKPublicKey CommonAcceptChannelFields_get_funding_pubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
 
 /**
- * Fetches the set of [`InitFeatures`] flags that are provided by or required by
- * [`ChannelManager`].
+ * The channel acceptor's key controlling the funding transaction
  */
-struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config);
+void CommonAcceptChannelFields_set_funding_pubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
+ * Used to derive a revocation key for transactions broadcast by counterparty
  */
-struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
+struct LDKPublicKey CommonAcceptChannelFields_get_revocation_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
 
 /**
- * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
+ * Used to derive a revocation key for transactions broadcast by counterparty
  */
-struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
+void CommonAcceptChannelFields_set_revocation_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
+ * A payment key to channel acceptor for transactions broadcast by counterparty
  */
-struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
+struct LDKPublicKey CommonAcceptChannelFields_get_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
 
 /**
- * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
+ * A payment key to channel acceptor for transactions broadcast by counterparty
  */
-struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
+void CommonAcceptChannelFields_set_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
+ * Used to derive a payment key to channel acceptor for transactions broadcast by channel
+ * acceptor
  */
-struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
+struct LDKPublicKey CommonAcceptChannelFields_get_delayed_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
 
 /**
- * Read a ChannelDetails from a byte array, created by ChannelDetails_write
+ * Used to derive a payment key to channel acceptor for transactions broadcast by channel
+ * acceptor
  */
-struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
+void CommonAcceptChannelFields_set_delayed_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
+ * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
  */
-struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
+struct LDKPublicKey CommonAcceptChannelFields_get_htlc_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
 
 /**
- * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
+ * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
  */
-struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
+void CommonAcceptChannelFields_set_htlc_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Serialize the BlindedForward object into a byte array which can be read by BlindedForward_read
+ * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
  */
-struct LDKCVec_u8Z BlindedForward_write(const struct LDKBlindedForward *NONNULL_PTR obj);
+struct LDKPublicKey CommonAcceptChannelFields_get_first_per_commitment_point(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
 
 /**
- * Read a BlindedForward from a byte array, created by BlindedForward_write
+ * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
  */
-struct LDKCResult_BlindedForwardDecodeErrorZ BlindedForward_read(struct LDKu8slice ser);
+void CommonAcceptChannelFields_set_first_per_commitment_point(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Serialize the PendingHTLCRouting object into a byte array which can be read by PendingHTLCRouting_read
+ * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
+ * collaboratively close
  */
-struct LDKCVec_u8Z PendingHTLCRouting_write(const struct LDKPendingHTLCRouting *NONNULL_PTR obj);
+struct LDKCOption_CVec_u8ZZ CommonAcceptChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
 
 /**
- * Read a PendingHTLCRouting from a byte array, created by PendingHTLCRouting_write
+ * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
+ * collaboratively close
  */
-struct LDKCResult_PendingHTLCRoutingDecodeErrorZ PendingHTLCRouting_read(struct LDKu8slice ser);
+void CommonAcceptChannelFields_set_shutdown_scriptpubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
 
 /**
- * Serialize the PendingHTLCInfo object into a byte array which can be read by PendingHTLCInfo_read
+ * The channel type that this channel will represent. If none is set, we derive the channel
+ * type from the intersection of our feature bits with our counterparty's feature bits from
+ * the Init message.
+ *
+ * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
+ * [`CommonOpenChannelFields::channel_type`].
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKCVec_u8Z PendingHTLCInfo_write(const struct LDKPendingHTLCInfo *NONNULL_PTR obj);
+struct LDKChannelTypeFeatures CommonAcceptChannelFields_get_channel_type(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
 
 /**
- * Read a PendingHTLCInfo from a byte array, created by PendingHTLCInfo_write
+ * The channel type that this channel will represent. If none is set, we derive the channel
+ * type from the intersection of our feature bits with our counterparty's feature bits from
+ * the Init message.
+ *
+ * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
+ * [`CommonOpenChannelFields::channel_type`].
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKCResult_PendingHTLCInfoDecodeErrorZ PendingHTLCInfo_read(struct LDKu8slice ser);
+void CommonAcceptChannelFields_set_channel_type(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
 
 /**
- * Serialize the BlindedFailure object into a byte array which can be read by BlindedFailure_read
+ * Constructs a new CommonAcceptChannelFields given each field
+ *
+ * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKCVec_u8Z BlindedFailure_write(const enum LDKBlindedFailure *NONNULL_PTR obj);
+MUST_USE_RES struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_new(struct LDKChannelId temporary_channel_id_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
 
 /**
- * Read a BlindedFailure from a byte array, created by BlindedFailure_write
+ * Creates a copy of the CommonAcceptChannelFields
  */
-struct LDKCResult_BlindedFailureDecodeErrorZ BlindedFailure_read(struct LDKu8slice ser);
+struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_clone(const struct LDKCommonAcceptChannelFields *NONNULL_PTR orig);
 
 /**
- * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
+ * Generates a non-cryptographic 64-bit hash of the CommonAcceptChannelFields.
  */
-struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
+uint64_t CommonAcceptChannelFields_hash(const struct LDKCommonAcceptChannelFields *NONNULL_PTR o);
 
 /**
- * Serialize the ChannelShutdownState object into a byte array which can be read by ChannelShutdownState_read
+ * Checks if two CommonAcceptChannelFieldss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj);
+bool CommonAcceptChannelFields_eq(const struct LDKCommonAcceptChannelFields *NONNULL_PTR a, const struct LDKCommonAcceptChannelFields *NONNULL_PTR b);
 
 /**
- * Read a ChannelShutdownState from a byte array, created by ChannelShutdownState_write
+ * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
  */
-struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser);
+void AcceptChannel_free(struct LDKAcceptChannel this_obj);
 
 /**
- * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
+ * Common fields of `accept_channel(2)`-like messages
  */
-void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
+struct LDKCommonAcceptChannelFields AcceptChannel_get_common_fields(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
 
 /**
- * A cryptographically secure source of entropy.
+ * Common fields of `accept_channel(2)`-like messages
  */
-const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+void AcceptChannel_set_common_fields(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
 
 /**
- * A cryptographically secure source of entropy.
+ * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
  */
-void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
+uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
 
 /**
- * A signer that is able to perform node-scoped cryptographic operations.
+ * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
  */
-const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * A signer that is able to perform node-scoped cryptographic operations.
+ * Constructs a new AcceptChannel given each field
  */
-void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
+MUST_USE_RES struct LDKAcceptChannel AcceptChannel_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t channel_reserve_satoshis_arg);
 
 /**
- * The keys provider which will give us relevant keys. Some keys will be loaded during
- * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
- * signing data.
+ * Creates a copy of the AcceptChannel
  */
-const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
 
 /**
- * The keys provider which will give us relevant keys. Some keys will be loaded during
- * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
- * signing data.
+ * Generates a non-cryptographic 64-bit hash of the AcceptChannel.
  */
-void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
+uint64_t AcceptChannel_hash(const struct LDKAcceptChannel *NONNULL_PTR o);
 
 /**
- * The fee_estimator for use in the ChannelManager in the future.
- *
- * No calls to the FeeEstimator will be made during deserialization.
+ * Checks if two AcceptChannels contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
 
 /**
- * The fee_estimator for use in the ChannelManager in the future.
- *
- * No calls to the FeeEstimator will be made during deserialization.
+ * Frees any resources used by the AcceptChannelV2, if is_owned is set and inner is non-NULL.
  */
-void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
+void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj);
 
 /**
- * The chain::Watch for use in the ChannelManager in the future.
- *
- * No calls to the chain::Watch will be made during deserialization. It is assumed that
- * you have deserialized ChannelMonitors separately and will add them to your
- * chain::Watch after deserializing this ChannelManager.
+ * Common fields of `accept_channel(2)`-like messages
  */
-const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+struct LDKCommonAcceptChannelFields AcceptChannelV2_get_common_fields(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
 
 /**
- * The chain::Watch for use in the ChannelManager in the future.
- *
- * No calls to the chain::Watch will be made during deserialization. It is assumed that
- * you have deserialized ChannelMonitors separately and will add them to your
- * chain::Watch after deserializing this ChannelManager.
+ * Common fields of `accept_channel(2)`-like messages
  */
-void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
+void AcceptChannelV2_set_common_fields(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
 
 /**
- * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
- * used to broadcast the latest local commitment transactions of channels which must be
- * force-closed during deserialization.
+ * Part of the channel value contributed by the channel acceptor
  */
-const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
 
 /**
- * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
- * used to broadcast the latest local commitment transactions of channels which must be
- * force-closed during deserialization.
+ * Part of the channel value contributed by the channel acceptor
  */
-void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
+void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The router which will be used in the ChannelManager in the future for finding routes
- * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
- *
- * No calls to the router will be made during deserialization.
+ * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
  */
-const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
 
 /**
- * The router which will be used in the ChannelManager in the future for finding routes
- * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
- *
- * No calls to the router will be made during deserialization.
+ * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
  */
-void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
+void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * The Logger for use in the ChannelManager and which may be used to log information during
- * deserialization.
+ * Optionally, a requirement that only confirmed inputs can be added
  */
-const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
 
 /**
- * The Logger for use in the ChannelManager and which may be used to log information during
- * deserialization.
+ * Optionally, a requirement that only confirmed inputs can be added
  */
-void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
+void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
 
 /**
- * Default settings used for new channels. Any existing channels will continue to use the
- * runtime settings which were stored when the ChannelManager was serialized.
+ * Constructs a new AcceptChannelV2 given each field
  */
-struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKAcceptChannelV2 AcceptChannelV2_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t funding_satoshis_arg, struct LDKPublicKey second_per_commitment_point_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
 
 /**
- * Default settings used for new channels. Any existing channels will continue to use the
- * runtime settings which were stored when the ChannelManager was serialized.
+ * Creates a copy of the AcceptChannelV2
  */
-void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
+struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig);
 
 /**
- * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
- * HashMap for you. This is primarily useful for C bindings where it is not practical to
- * populate a HashMap directly from C.
+ * Generates a non-cryptographic 64-bit hash of the AcceptChannelV2.
  */
-MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors);
+uint64_t AcceptChannelV2_hash(const struct LDKAcceptChannelV2 *NONNULL_PTR o);
 
 /**
- * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write
+ * Checks if two AcceptChannelV2s contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
+bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the DelayedPaymentBasepoint, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
  */
-void DelayedPaymentBasepoint_free(struct LDKDelayedPaymentBasepoint this_obj);
+void FundingCreated_free(struct LDKFundingCreated this_obj);
 
-struct LDKPublicKey DelayedPaymentBasepoint_get_a(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr);
+/**
+ * A temporary channel ID, until the funding is established
+ */
+struct LDKChannelId FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
 
-void DelayedPaymentBasepoint_set_a(struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+/**
+ * A temporary channel ID, until the funding is established
+ */
+void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Constructs a new DelayedPaymentBasepoint given each field
+ * The funding transaction ID
  */
-MUST_USE_RES struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_new(struct LDKPublicKey a_arg);
+const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
 
 /**
- * Checks if two DelayedPaymentBasepoints contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The funding transaction ID
  */
-bool DelayedPaymentBasepoint_eq(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR a, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR b);
+void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Creates a copy of the DelayedPaymentBasepoint
+ * The specific output index funding this channel
  */
-struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_clone(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR orig);
+uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the DelayedPaymentBasepoint.
+ * The specific output index funding this channel
  */
-uint64_t DelayedPaymentBasepoint_hash(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR o);
+void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
- * Get inner Public Key
+ * The signature of the channel initiator (funder) on the initial commitment transaction
  */
-MUST_USE_RES struct LDKPublicKey DelayedPaymentBasepoint_to_public_key(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg);
+struct LDKECDSASignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
 
 /**
- *Derives the \"tweak\" used in calculate [`DelayedPaymentKey::from_basepoint`].\n\n[`DelayedPaymentKey::from_basepoint`] calculates a private key as:\n`privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)`\n\nThis calculates the hash part in the tweak derivation process, which is used to\nensure that each key is unique and cannot be guessed by an external party.
+ * The signature of the channel initiator (funder) on the initial commitment transaction
  */
-MUST_USE_RES struct LDKThirtyTwoBytes DelayedPaymentBasepoint_derive_add_tweak(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
+void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
 
 /**
- * Serialize the DelayedPaymentBasepoint object into a byte array which can be read by DelayedPaymentBasepoint_read
+ * Constructs a new FundingCreated given each field
  */
-struct LDKCVec_u8Z DelayedPaymentBasepoint_write(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR obj);
+MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKChannelId temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKECDSASignature signature_arg);
 
 /**
- * Read a DelayedPaymentBasepoint from a byte array, created by DelayedPaymentBasepoint_write
+ * Creates a copy of the FundingCreated
  */
-struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ DelayedPaymentBasepoint_read(struct LDKu8slice ser);
+struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the DelayedPaymentKey, if is_owned is set and inner is non-NULL.
+ * Generates a non-cryptographic 64-bit hash of the FundingCreated.
  */
-void DelayedPaymentKey_free(struct LDKDelayedPaymentKey this_obj);
+uint64_t FundingCreated_hash(const struct LDKFundingCreated *NONNULL_PTR o);
 
-struct LDKPublicKey DelayedPaymentKey_get_a(const struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr);
+/**
+ * Checks if two FundingCreateds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
 
-void DelayedPaymentKey_set_a(struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+/**
+ * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
+ */
+void FundingSigned_free(struct LDKFundingSigned this_obj);
 
 /**
- * Constructs a new DelayedPaymentKey given each field
+ * The channel ID
  */
-MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_new(struct LDKPublicKey a_arg);
+struct LDKChannelId FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two DelayedPaymentKeys contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The channel ID
  */
-bool DelayedPaymentKey_eq(const struct LDKDelayedPaymentKey *NONNULL_PTR a, const struct LDKDelayedPaymentKey *NONNULL_PTR b);
+void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Creates a copy of the DelayedPaymentKey
+ * The signature of the channel acceptor (fundee) on the initial commitment transaction
  */
-struct LDKDelayedPaymentKey DelayedPaymentKey_clone(const struct LDKDelayedPaymentKey *NONNULL_PTR orig);
+struct LDKECDSASignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
 
 /**
- *Derive a public delayedpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
+ * The signature of the channel acceptor (fundee) on the initial commitment transaction
  */
-MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_basepoint(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
+void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
 
 /**
- *Build a delayedpubkey directly from an already-derived private key
+ * Constructs a new FundingSigned given each field
  */
-MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_secret_key(const uint8_t (*sk)[32]);
+MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg);
 
 /**
- * Get inner Public Key
+ * Creates a copy of the FundingSigned
  */
-MUST_USE_RES struct LDKPublicKey DelayedPaymentKey_to_public_key(const struct LDKDelayedPaymentKey *NONNULL_PTR this_arg);
+struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
 
 /**
- * Serialize the DelayedPaymentKey object into a byte array which can be read by DelayedPaymentKey_read
+ * Generates a non-cryptographic 64-bit hash of the FundingSigned.
  */
-struct LDKCVec_u8Z DelayedPaymentKey_write(const struct LDKDelayedPaymentKey *NONNULL_PTR obj);
+uint64_t FundingSigned_hash(const struct LDKFundingSigned *NONNULL_PTR o);
 
 /**
- * Read a DelayedPaymentKey from a byte array, created by DelayedPaymentKey_write
+ * Checks if two FundingSigneds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-struct LDKCResult_DelayedPaymentKeyDecodeErrorZ DelayedPaymentKey_read(struct LDKu8slice ser);
+bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the HtlcBasepoint, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
  */
-void HtlcBasepoint_free(struct LDKHtlcBasepoint this_obj);
+void ChannelReady_free(struct LDKChannelReady this_obj);
 
-struct LDKPublicKey HtlcBasepoint_get_a(const struct LDKHtlcBasepoint *NONNULL_PTR this_ptr);
+/**
+ * The channel ID
+ */
+struct LDKChannelId ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr);
 
-void HtlcBasepoint_set_a(struct LDKHtlcBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+/**
+ * The channel ID
+ */
+void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Constructs a new HtlcBasepoint given each field
+ * The per-commitment point of the second commitment transaction
  */
-MUST_USE_RES struct LDKHtlcBasepoint HtlcBasepoint_new(struct LDKPublicKey a_arg);
+struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two HtlcBasepoints contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The per-commitment point of the second commitment transaction
  */
-bool HtlcBasepoint_eq(const struct LDKHtlcBasepoint *NONNULL_PTR a, const struct LDKHtlcBasepoint *NONNULL_PTR b);
+void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Creates a copy of the HtlcBasepoint
+ * If set, provides a `short_channel_id` alias for this channel.
+ *
+ * The sender will accept payments to be forwarded over this SCID and forward them to this
+ * messages' recipient.
  */
-struct LDKHtlcBasepoint HtlcBasepoint_clone(const struct LDKHtlcBasepoint *NONNULL_PTR orig);
+struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the HtlcBasepoint.
+ * If set, provides a `short_channel_id` alias for this channel.
+ *
+ * The sender will accept payments to be forwarded over this SCID and forward them to this
+ * messages' recipient.
  */
-uint64_t HtlcBasepoint_hash(const struct LDKHtlcBasepoint *NONNULL_PTR o);
+void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
 
 /**
- * Get inner Public Key
+ * Constructs a new ChannelReady given each field
  */
-MUST_USE_RES struct LDKPublicKey HtlcBasepoint_to_public_key(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKChannelReady ChannelReady_new(struct LDKChannelId channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg);
 
 /**
- *Derives the \"tweak\" used in calculate [`HtlcKey::from_basepoint`].\n\n[`HtlcKey::from_basepoint`] calculates a private key as:\n`privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)`\n\nThis calculates the hash part in the tweak derivation process, which is used to\nensure that each key is unique and cannot be guessed by an external party.
+ * Creates a copy of the ChannelReady
  */
-MUST_USE_RES struct LDKThirtyTwoBytes HtlcBasepoint_derive_add_tweak(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
+struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
 
 /**
- * Serialize the HtlcBasepoint object into a byte array which can be read by HtlcBasepoint_read
+ * Generates a non-cryptographic 64-bit hash of the ChannelReady.
  */
-struct LDKCVec_u8Z HtlcBasepoint_write(const struct LDKHtlcBasepoint *NONNULL_PTR obj);
+uint64_t ChannelReady_hash(const struct LDKChannelReady *NONNULL_PTR o);
 
 /**
- * Read a HtlcBasepoint from a byte array, created by HtlcBasepoint_write
+ * Checks if two ChannelReadys contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-struct LDKCResult_HtlcBasepointDecodeErrorZ HtlcBasepoint_read(struct LDKu8slice ser);
+bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the HtlcKey, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the Stfu, if is_owned is set and inner is non-NULL.
  */
-void HtlcKey_free(struct LDKHtlcKey this_obj);
+void Stfu_free(struct LDKStfu this_obj);
 
-struct LDKPublicKey HtlcKey_get_a(const struct LDKHtlcKey *NONNULL_PTR this_ptr);
+/**
+ * The channel ID where quiescence is intended
+ */
+struct LDKChannelId Stfu_get_channel_id(const struct LDKStfu *NONNULL_PTR this_ptr);
 
-void HtlcKey_set_a(struct LDKHtlcKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+/**
+ * The channel ID where quiescence is intended
+ */
+void Stfu_set_channel_id(struct LDKStfu *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Constructs a new HtlcKey given each field
+ * Initiator flag, 1 if initiating, 0 if replying to an stfu.
  */
-MUST_USE_RES struct LDKHtlcKey HtlcKey_new(struct LDKPublicKey a_arg);
+uint8_t Stfu_get_initiator(const struct LDKStfu *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two HtlcKeys contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Initiator flag, 1 if initiating, 0 if replying to an stfu.
  */
-bool HtlcKey_eq(const struct LDKHtlcKey *NONNULL_PTR a, const struct LDKHtlcKey *NONNULL_PTR b);
+void Stfu_set_initiator(struct LDKStfu *NONNULL_PTR this_ptr, uint8_t val);
 
 /**
- * Creates a copy of the HtlcKey
+ * Constructs a new Stfu given each field
  */
-struct LDKHtlcKey HtlcKey_clone(const struct LDKHtlcKey *NONNULL_PTR orig);
+MUST_USE_RES struct LDKStfu Stfu_new(struct LDKChannelId channel_id_arg, uint8_t initiator_arg);
 
 /**
- *Derive a public htlcpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
+ * Creates a copy of the Stfu
  */
-MUST_USE_RES struct LDKHtlcKey HtlcKey_from_basepoint(const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
+struct LDKStfu Stfu_clone(const struct LDKStfu *NONNULL_PTR orig);
 
 /**
- *Build a htlcpubkey directly from an already-derived private key
+ * Checks if two Stfus contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-MUST_USE_RES struct LDKHtlcKey HtlcKey_from_secret_key(const uint8_t (*sk)[32]);
+bool Stfu_eq(const struct LDKStfu *NONNULL_PTR a, const struct LDKStfu *NONNULL_PTR b);
 
 /**
- * Get inner Public Key
+ * Frees any resources used by the SpliceInit, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKPublicKey HtlcKey_to_public_key(const struct LDKHtlcKey *NONNULL_PTR this_arg);
+void SpliceInit_free(struct LDKSpliceInit this_obj);
 
 /**
- * Serialize the HtlcKey object into a byte array which can be read by HtlcKey_read
+ * The channel ID where splicing is intended
  */
-struct LDKCVec_u8Z HtlcKey_write(const struct LDKHtlcKey *NONNULL_PTR obj);
+struct LDKChannelId SpliceInit_get_channel_id(const struct LDKSpliceInit *NONNULL_PTR this_ptr);
 
 /**
- * Read a HtlcKey from a byte array, created by HtlcKey_write
+ * The channel ID where splicing is intended
  */
-struct LDKCResult_HtlcKeyDecodeErrorZ HtlcKey_read(struct LDKu8slice ser);
+void SpliceInit_set_channel_id(struct LDKSpliceInit *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Adds a tweak to a public key to derive a new public key.
- *
- * May panic if `tweak` is not the output of a SHA-256 hash.
+ * The amount the splice initiator is intending to add to its channel balance (splice-in)
+ * or remove from its channel balance (splice-out).
  */
-struct LDKPublicKey add_public_key_tweak(struct LDKPublicKey base_point, const uint8_t (*tweak)[32]);
+int64_t SpliceInit_get_funding_contribution_satoshis(const struct LDKSpliceInit *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the RevocationBasepoint, if is_owned is set and inner is non-NULL.
+ * The amount the splice initiator is intending to add to its channel balance (splice-in)
+ * or remove from its channel balance (splice-out).
  */
-void RevocationBasepoint_free(struct LDKRevocationBasepoint this_obj);
-
-struct LDKPublicKey RevocationBasepoint_get_a(const struct LDKRevocationBasepoint *NONNULL_PTR this_ptr);
-
-void RevocationBasepoint_set_a(struct LDKRevocationBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void SpliceInit_set_funding_contribution_satoshis(struct LDKSpliceInit *NONNULL_PTR this_ptr, int64_t val);
 
 /**
- * Constructs a new RevocationBasepoint given each field
+ * The feerate for the new funding transaction, set by the splice initiator
  */
-MUST_USE_RES struct LDKRevocationBasepoint RevocationBasepoint_new(struct LDKPublicKey a_arg);
+uint32_t SpliceInit_get_funding_feerate_perkw(const struct LDKSpliceInit *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two RevocationBasepoints contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The feerate for the new funding transaction, set by the splice initiator
  */
-bool RevocationBasepoint_eq(const struct LDKRevocationBasepoint *NONNULL_PTR a, const struct LDKRevocationBasepoint *NONNULL_PTR b);
+void SpliceInit_set_funding_feerate_perkw(struct LDKSpliceInit *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Creates a copy of the RevocationBasepoint
+ * The locktime for the new funding transaction
  */
-struct LDKRevocationBasepoint RevocationBasepoint_clone(const struct LDKRevocationBasepoint *NONNULL_PTR orig);
+uint32_t SpliceInit_get_locktime(const struct LDKSpliceInit *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the RevocationBasepoint.
+ * The locktime for the new funding transaction
  */
-uint64_t RevocationBasepoint_hash(const struct LDKRevocationBasepoint *NONNULL_PTR o);
+void SpliceInit_set_locktime(struct LDKSpliceInit *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Get inner Public Key
+ * The key of the sender (splice initiator) controlling the new funding transaction
  */
-MUST_USE_RES struct LDKPublicKey RevocationBasepoint_to_public_key(const struct LDKRevocationBasepoint *NONNULL_PTR this_arg);
+struct LDKPublicKey SpliceInit_get_funding_pubkey(const struct LDKSpliceInit *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the RevocationBasepoint object into a byte array which can be read by RevocationBasepoint_read
+ * The key of the sender (splice initiator) controlling the new funding transaction
  */
-struct LDKCVec_u8Z RevocationBasepoint_write(const struct LDKRevocationBasepoint *NONNULL_PTR obj);
+void SpliceInit_set_funding_pubkey(struct LDKSpliceInit *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Read a RevocationBasepoint from a byte array, created by RevocationBasepoint_write
+ * If set, only confirmed inputs added (by the splice acceptor) will be accepted
  */
-struct LDKCResult_RevocationBasepointDecodeErrorZ RevocationBasepoint_read(struct LDKu8slice ser);
+enum LDKCOption_NoneZ SpliceInit_get_require_confirmed_inputs(const struct LDKSpliceInit *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the RevocationKey, if is_owned is set and inner is non-NULL.
+ * If set, only confirmed inputs added (by the splice acceptor) will be accepted
  */
-void RevocationKey_free(struct LDKRevocationKey this_obj);
-
-struct LDKPublicKey RevocationKey_get_a(const struct LDKRevocationKey *NONNULL_PTR this_ptr);
-
-void RevocationKey_set_a(struct LDKRevocationKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void SpliceInit_set_require_confirmed_inputs(struct LDKSpliceInit *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
 
 /**
- * Constructs a new RevocationKey given each field
+ * Constructs a new SpliceInit given each field
  */
-MUST_USE_RES struct LDKRevocationKey RevocationKey_new(struct LDKPublicKey a_arg);
+MUST_USE_RES struct LDKSpliceInit SpliceInit_new(struct LDKChannelId channel_id_arg, int64_t funding_contribution_satoshis_arg, uint32_t funding_feerate_perkw_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
 
 /**
- * Checks if two RevocationKeys contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Creates a copy of the SpliceInit
  */
-bool RevocationKey_eq(const struct LDKRevocationKey *NONNULL_PTR a, const struct LDKRevocationKey *NONNULL_PTR b);
+struct LDKSpliceInit SpliceInit_clone(const struct LDKSpliceInit *NONNULL_PTR orig);
 
 /**
- * Creates a copy of the RevocationKey
+ * Checks if two SpliceInits contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-struct LDKRevocationKey RevocationKey_clone(const struct LDKRevocationKey *NONNULL_PTR orig);
+bool SpliceInit_eq(const struct LDKSpliceInit *NONNULL_PTR a, const struct LDKSpliceInit *NONNULL_PTR b);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the RevocationKey.
+ * Frees any resources used by the SpliceAck, if is_owned is set and inner is non-NULL.
  */
-uint64_t RevocationKey_hash(const struct LDKRevocationKey *NONNULL_PTR o);
+void SpliceAck_free(struct LDKSpliceAck this_obj);
 
 /**
- * Derives a per-commitment-transaction revocation public key from one party's per-commitment
- * point and the other party's [`RevocationBasepoint`]. This is the public equivalent of
- * [`chan_utils::derive_private_revocation_key`] - using only public keys to derive a public
- * key instead of private keys.
- *
- * Note that this is infallible iff we trust that at least one of the two input keys are randomly
- * generated (ie our own).
- *
- * [`chan_utils::derive_private_revocation_key`]: crate::ln::chan_utils::derive_private_revocation_key
+ * The channel ID where splicing is intended
  */
-MUST_USE_RES struct LDKRevocationKey RevocationKey_from_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
+struct LDKChannelId SpliceAck_get_channel_id(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
 
 /**
- * Get inner Public Key
+ * The channel ID where splicing is intended
  */
-MUST_USE_RES struct LDKPublicKey RevocationKey_to_public_key(const struct LDKRevocationKey *NONNULL_PTR this_arg);
+void SpliceAck_set_channel_id(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Serialize the RevocationKey object into a byte array which can be read by RevocationKey_read
+ * The amount the splice acceptor is intending to add to its channel balance (splice-in)
+ * or remove from its channel balance (splice-out).
  */
-struct LDKCVec_u8Z RevocationKey_write(const struct LDKRevocationKey *NONNULL_PTR obj);
+int64_t SpliceAck_get_funding_contribution_satoshis(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
 
 /**
- * Read a RevocationKey from a byte array, created by RevocationKey_write
+ * The amount the splice acceptor is intending to add to its channel balance (splice-in)
+ * or remove from its channel balance (splice-out).
  */
-struct LDKCResult_RevocationKeyDecodeErrorZ RevocationKey_read(struct LDKu8slice ser);
+void SpliceAck_set_funding_contribution_satoshis(struct LDKSpliceAck *NONNULL_PTR this_ptr, int64_t val);
 
 /**
- * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
+ * The key of the sender (splice acceptor) controlling the new funding transaction
  */
-void ExpandedKey_free(struct LDKExpandedKey this_obj);
+struct LDKPublicKey SpliceAck_get_funding_pubkey(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
 
 /**
- * Create a  new [`ExpandedKey`] for generating an inbound payment hash and secret.
- *
- * It is recommended to cache this value and not regenerate it for each new inbound payment.
+ * The key of the sender (splice acceptor) controlling the new funding transaction
  */
-MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
+void SpliceAck_set_funding_pubkey(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
- * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
- * a `ChannelManager`.
- *
- * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
- * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
- * regenerate it for each new inbound payment.
- *
- * `current_time` is a Unix timestamp representing the current time.
- *
- * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
- * on versions of LDK prior to 0.0.114.
- *
- * [phantom node payments]: crate::sign::PhantomKeysManager
- * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
+ * If set, only confirmed inputs added (by the splice initiator) will be accepted
  */
-struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ create(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, const struct LDKEntropySource *NONNULL_PTR entropy_source, uint64_t current_time, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
+enum LDKCOption_NoneZ SpliceAck_get_require_confirmed_inputs(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
 
 /**
- * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
- * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
- * without a `ChannelManager`.
- *
- * See [`create`] for information on the `keys` and `current_time` parameters.
- *
- * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
- * on versions of LDK prior to 0.0.114.
- *
- * [phantom node payments]: crate::sign::PhantomKeysManager
+ * If set, only confirmed inputs added (by the splice initiator) will be accepted
  */
-struct LDKCResult_ThirtyTwoBytesNoneZ create_from_hash(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, uint64_t current_time, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
+void SpliceAck_set_require_confirmed_inputs(struct LDKSpliceAck *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
 
 /**
- * Frees any resources used by the DecodeError
+ * Constructs a new SpliceAck given each field
  */
-void DecodeError_free(struct LDKDecodeError this_ptr);
+MUST_USE_RES struct LDKSpliceAck SpliceAck_new(struct LDKChannelId channel_id_arg, int64_t funding_contribution_satoshis_arg, struct LDKPublicKey funding_pubkey_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
 
 /**
- * Creates a copy of the DecodeError
+ * Creates a copy of the SpliceAck
  */
-struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
+struct LDKSpliceAck SpliceAck_clone(const struct LDKSpliceAck *NONNULL_PTR orig);
 
 /**
- * Utility method to constructs a new UnknownVersion-variant DecodeError
+ * Checks if two SpliceAcks contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-struct LDKDecodeError DecodeError_unknown_version(void);
+bool SpliceAck_eq(const struct LDKSpliceAck *NONNULL_PTR a, const struct LDKSpliceAck *NONNULL_PTR b);
 
 /**
- * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
+ * Frees any resources used by the SpliceLocked, if is_owned is set and inner is non-NULL.
  */
-struct LDKDecodeError DecodeError_unknown_required_feature(void);
+void SpliceLocked_free(struct LDKSpliceLocked this_obj);
 
 /**
- * Utility method to constructs a new InvalidValue-variant DecodeError
+ * The channel ID
  */
-struct LDKDecodeError DecodeError_invalid_value(void);
+struct LDKChannelId SpliceLocked_get_channel_id(const struct LDKSpliceLocked *NONNULL_PTR this_ptr);
 
 /**
- * Utility method to constructs a new ShortRead-variant DecodeError
+ * The channel ID
  */
-struct LDKDecodeError DecodeError_short_read(void);
+void SpliceLocked_set_channel_id(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
+ * The ID of the new funding transaction that has been locked
  */
-struct LDKDecodeError DecodeError_bad_length_descriptor(void);
+const uint8_t (*SpliceLocked_get_splice_txid(const struct LDKSpliceLocked *NONNULL_PTR this_ptr))[32];
 
 /**
- * Utility method to constructs a new Io-variant DecodeError
+ * The ID of the new funding transaction that has been locked
  */
-struct LDKDecodeError DecodeError_io(enum LDKIOError a);
+void SpliceLocked_set_splice_txid(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Utility method to constructs a new UnsupportedCompression-variant DecodeError
+ * Constructs a new SpliceLocked given each field
  */
-struct LDKDecodeError DecodeError_unsupported_compression(void);
+MUST_USE_RES struct LDKSpliceLocked SpliceLocked_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes splice_txid_arg);
 
 /**
- * Utility method to constructs a new DangerousValue-variant DecodeError
+ * Creates a copy of the SpliceLocked
  */
-struct LDKDecodeError DecodeError_dangerous_value(void);
+struct LDKSpliceLocked SpliceLocked_clone(const struct LDKSpliceLocked *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the DecodeError.
+ * Checks if two SpliceLockeds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-uint64_t DecodeError_hash(const struct LDKDecodeError *NONNULL_PTR o);
+bool SpliceLocked_eq(const struct LDKSpliceLocked *NONNULL_PTR a, const struct LDKSpliceLocked *NONNULL_PTR b);
 
 /**
- * Checks if two DecodeErrors contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Frees any resources used by the TxAddInput, if is_owned is set and inner is non-NULL.
  */
-bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
+void TxAddInput_free(struct LDKTxAddInput this_obj);
 
 /**
- * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
+ * The channel ID
  */
-void Init_free(struct LDKInit this_obj);
+struct LDKChannelId TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
 
 /**
- * The relevant features which the sender supports.
+ * The channel ID
  */
-struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
+void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * The relevant features which the sender supports.
+ * A randomly chosen unique identifier for this input, which is even for initiators and odd for
+ * non-initiators.
  */
-void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
+uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
 
 /**
- * Indicates chains the sender is interested in.
- *
- * If there are no common chains, the connection will be closed.
- *
- * Returns a copy of the field.
+ * A randomly chosen unique identifier for this input, which is even for initiators and odd for
+ * non-initiators.
  */
-struct LDKCOption_CVec_ThirtyTwoBytesZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr);
+void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Indicates chains the sender is interested in.
- *
- * If there are no common chains, the connection will be closed.
+ * Serialized transaction that contains the output this input spends to verify that it is non
+ * malleable.
  */
-void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ThirtyTwoBytesZZ val);
+struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
 
 /**
- * The receipient's network address.
- *
- * This adds the option to report a remote IP address back to a connecting peer using the init
- * message. A node can decide to use that information to discover a potential update to its
- * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
- * the new address.
+ * Serialized transaction that contains the output this input spends to verify that it is non
+ * malleable.
  */
-struct LDKCOption_SocketAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
+void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val);
 
 /**
- * The receipient's network address.
- *
- * This adds the option to report a remote IP address back to a connecting peer using the init
- * message. A node can decide to use that information to discover a potential update to its
- * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
- * the new address.
+ * The index of the output being spent
  */
-void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
+uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new Init given each field
+ * The index of the output being spent
  */
-MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg, struct LDKCOption_SocketAddressZ remote_network_address_arg);
+void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Creates a copy of the Init
+ * The sequence number of this input
  */
-struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
+uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Init.
+ * The sequence number of this input
  */
-uint64_t Init_hash(const struct LDKInit *NONNULL_PTR o);
+void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Checks if two Inits contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The ID of the previous funding transaction, when it is being added as an input during splicing
  */
-bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
+struct LDKCOption_ThirtyTwoBytesZ TxAddInput_get_shared_input_txid(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
+ * The ID of the previous funding transaction, when it is being added as an input during splicing
  */
-void ErrorMessage_free(struct LDKErrorMessage this_obj);
+void TxAddInput_set_shared_input_txid(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
 
 /**
- * The channel ID involved in the error.
- *
- * All-0s indicates a general error unrelated to a specific channel, after which all channels
- * with the sending peer should be closed.
+ * Constructs a new TxAddInput given each field
  */
-struct LDKChannelId ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKTxAddInput TxAddInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg, struct LDKTransactionU16LenLimited prevtx_arg, uint32_t prevtx_out_arg, uint32_t sequence_arg, struct LDKCOption_ThirtyTwoBytesZ shared_input_txid_arg);
 
 /**
- * The channel ID involved in the error.
- *
- * All-0s indicates a general error unrelated to a specific channel, after which all channels
- * with the sending peer should be closed.
+ * Creates a copy of the TxAddInput
  */
-void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
+struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig);
 
 /**
- * A possibly human-readable error description.
- *
- * The string should be sanitized before it is used (e.g., emitted to logs or printed to
- * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
- * the terminal emulator or the logging subsystem.
+ * Generates a non-cryptographic 64-bit hash of the TxAddInput.
  */
-struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
+uint64_t TxAddInput_hash(const struct LDKTxAddInput *NONNULL_PTR o);
 
 /**
- * A possibly human-readable error description.
- *
- * The string should be sanitized before it is used (e.g., emitted to logs or printed to
- * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
- * the terminal emulator or the logging subsystem.
+ * Checks if two TxAddInputs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
+bool TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b);
 
 /**
- * Constructs a new ErrorMessage given each field
+ * Frees any resources used by the TxAddOutput, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
+void TxAddOutput_free(struct LDKTxAddOutput this_obj);
 
 /**
- * Creates a copy of the ErrorMessage
+ * The channel ID
  */
-struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
+struct LDKChannelId TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ErrorMessage.
+ * The channel ID
  */
-uint64_t ErrorMessage_hash(const struct LDKErrorMessage *NONNULL_PTR o);
+void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Checks if two ErrorMessages contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * A randomly chosen unique identifier for this output, which is even for initiators and odd for
+ * non-initiators.
  */
-bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
+uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
+ * A randomly chosen unique identifier for this output, which is even for initiators and odd for
+ * non-initiators.
  */
-void WarningMessage_free(struct LDKWarningMessage this_obj);
+void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The channel ID involved in the warning.
- *
- * All-0s indicates a warning unrelated to a specific channel.
+ * The satoshi value of the output
  */
-struct LDKChannelId WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
+uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
 
 /**
- * The channel ID involved in the warning.
- *
- * All-0s indicates a warning unrelated to a specific channel.
+ * The satoshi value of the output
  */
-void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
+void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * A possibly human-readable warning description.
- *
- * The string should be sanitized before it is used (e.g. emitted to logs or printed to
- * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
- * the terminal emulator or the logging subsystem.
+ * The scriptPubKey for the output
  */
-struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
 
 /**
- * A possibly human-readable warning description.
- *
- * The string should be sanitized before it is used (e.g. emitted to logs or printed to
- * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
- * the terminal emulator or the logging subsystem.
+ * The scriptPubKey for the output
  */
-void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
+void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
 
 /**
- * Constructs a new WarningMessage given each field
+ * Constructs a new TxAddOutput given each field
  */
-MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
+MUST_USE_RES struct LDKTxAddOutput TxAddOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg, uint64_t sats_arg, struct LDKCVec_u8Z script_arg);
 
 /**
- * Creates a copy of the WarningMessage
+ * Creates a copy of the TxAddOutput
  */
-struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
+struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the WarningMessage.
+ * Generates a non-cryptographic 64-bit hash of the TxAddOutput.
  */
-uint64_t WarningMessage_hash(const struct LDKWarningMessage *NONNULL_PTR o);
+uint64_t TxAddOutput_hash(const struct LDKTxAddOutput *NONNULL_PTR o);
 
 /**
- * Checks if two WarningMessages contain equal inner contents.
+ * Checks if two TxAddOutputs contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
  * Two objects with NULL inner values will be considered "equal" here.
  */
-bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
+bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the TxRemoveInput, if is_owned is set and inner is non-NULL.
  */
-void Ping_free(struct LDKPing this_obj);
+void TxRemoveInput_free(struct LDKTxRemoveInput this_obj);
 
 /**
- * The desired response length.
+ * The channel ID
  */
-uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
+struct LDKChannelId TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
 
 /**
- * The desired response length.
+ * The channel ID
  */
-void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
+void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * The ping packet size.
- *
- * This field is not sent on the wire. byteslen zeros are sent.
+ * The serial ID of the input to be removed
  */
-uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
+uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
 
 /**
- * The ping packet size.
- *
- * This field is not sent on the wire. byteslen zeros are sent.
+ * The serial ID of the input to be removed
  */
-void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
+void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Constructs a new Ping given each field
+ * Constructs a new TxRemoveInput given each field
  */
-MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
+MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
 
 /**
- * Creates a copy of the Ping
+ * Creates a copy of the TxRemoveInput
  */
-struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
+struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Ping.
+ * Generates a non-cryptographic 64-bit hash of the TxRemoveInput.
  */
-uint64_t Ping_hash(const struct LDKPing *NONNULL_PTR o);
+uint64_t TxRemoveInput_hash(const struct LDKTxRemoveInput *NONNULL_PTR o);
 
 /**
- * Checks if two Pings contain equal inner contents.
+ * Checks if two TxRemoveInputs contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
  * Two objects with NULL inner values will be considered "equal" here.
  */
-bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
+bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the TxRemoveOutput, if is_owned is set and inner is non-NULL.
  */
-void Pong_free(struct LDKPong this_obj);
+void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj);
 
 /**
- * The pong packet size.
- *
- * This field is not sent on the wire. byteslen zeros are sent.
+ * The channel ID
  */
-uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
+struct LDKChannelId TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
 
 /**
- * The pong packet size.
- *
- * This field is not sent on the wire. byteslen zeros are sent.
+ * The channel ID
  */
-void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
+void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Constructs a new Pong given each field
+ * The serial ID of the output to be removed
  */
-MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
+uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the Pong
+ * The serial ID of the output to be removed
  */
-struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
+void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Pong.
+ * Constructs a new TxRemoveOutput given each field
  */
-uint64_t Pong_hash(const struct LDKPong *NONNULL_PTR o);
+MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
 
 /**
- * Checks if two Pongs contain equal inner contents.
+ * Creates a copy of the TxRemoveOutput
+ */
+struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the TxRemoveOutput.
+ */
+uint64_t TxRemoveOutput_hash(const struct LDKTxRemoveOutput *NONNULL_PTR o);
+
+/**
+ * Checks if two TxRemoveOutputs contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
  * Two objects with NULL inner values will be considered "equal" here.
  */
-bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
+bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the CommonOpenChannelFields, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the TxComplete, if is_owned is set and inner is non-NULL.
  */
-void CommonOpenChannelFields_free(struct LDKCommonOpenChannelFields this_obj);
+void TxComplete_free(struct LDKTxComplete this_obj);
 
 /**
- * The genesis hash of the blockchain where the channel is to be opened
+ * The channel ID
  */
-const uint8_t (*CommonOpenChannelFields_get_chain_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr))[32];
+struct LDKChannelId TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr);
 
 /**
- * The genesis hash of the blockchain where the channel is to be opened
+ * The channel ID
  */
-void CommonOpenChannelFields_set_chain_hash(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * A temporary channel ID
- * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
- * For V1 channels: a temporary channel ID, until the funding outpoint is announced
+ * Constructs a new TxComplete given each field
  */
-struct LDKChannelId CommonOpenChannelFields_get_temporary_channel_id(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKChannelId channel_id_arg);
 
 /**
- * A temporary channel ID
- * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
- * For V1 channels: a temporary channel ID, until the funding outpoint is announced
+ * Creates a copy of the TxComplete
  */
-void CommonOpenChannelFields_set_temporary_channel_id(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
+struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig);
 
 /**
- * For V1 channels: The channel value
- * For V2 channels: Part of the channel value contributed by the channel initiator
+ * Generates a non-cryptographic 64-bit hash of the TxComplete.
  */
-uint64_t CommonOpenChannelFields_get_funding_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+uint64_t TxComplete_hash(const struct LDKTxComplete *NONNULL_PTR o);
 
 /**
- * For V1 channels: The channel value
- * For V2 channels: Part of the channel value contributed by the channel initiator
+ * Checks if two TxCompletes contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-void CommonOpenChannelFields_set_funding_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b);
 
 /**
- * The threshold below which outputs on transactions broadcast by the channel initiator will be
- * omitted
+ * Frees any resources used by the TxSignatures, if is_owned is set and inner is non-NULL.
  */
-uint64_t CommonOpenChannelFields_get_dust_limit_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+void TxSignatures_free(struct LDKTxSignatures this_obj);
 
 /**
- * The threshold below which outputs on transactions broadcast by the channel initiator will be
- * omitted
+ * The channel ID
  */
-void CommonOpenChannelFields_set_dust_limit_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKChannelId TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
 
 /**
- * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
+ * The channel ID
  */
-uint64_t CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
+ * The TXID
  */
-void CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
 
 /**
- * The minimum HTLC size incoming to channel initiator, in milli-satoshi
+ * The TXID
  */
-uint64_t CommonOpenChannelFields_get_htlc_minimum_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * The minimum HTLC size incoming to channel initiator, in milli-satoshi
+ * The list of witnesses
+ *
+ * Returns a copy of the field.
  */
-void CommonOpenChannelFields_set_htlc_minimum_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
 
 /**
- * The feerate for the commitment transaction set by the channel initiator until updated by
- * [`UpdateFee`]
+ * The list of witnesses
  */
-uint32_t CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val);
 
 /**
- * The feerate for the commitment transaction set by the channel initiator until updated by
- * [`UpdateFee`]
+ * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
+ */
+struct LDKCOption_ECDSASignatureZ TxSignatures_get_shared_input_signature(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
+
+/**
+ * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
  */
-void CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint32_t val);
+void TxSignatures_set_shared_input_signature(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCOption_ECDSASignatureZ val);
 
 /**
- * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
- * broadcast a commitment transaction
+ * Constructs a new TxSignatures given each field
  */
-uint16_t CommonOpenChannelFields_get_to_self_delay(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg, struct LDKCOption_ECDSASignatureZ shared_input_signature_arg);
 
 /**
- * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
- * broadcast a commitment transaction
+ * Creates a copy of the TxSignatures
  */
-void CommonOpenChannelFields_set_to_self_delay(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
+struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig);
 
 /**
- * The maximum number of inbound HTLCs towards channel initiator
+ * Generates a non-cryptographic 64-bit hash of the TxSignatures.
  */
-uint16_t CommonOpenChannelFields_get_max_accepted_htlcs(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+uint64_t TxSignatures_hash(const struct LDKTxSignatures *NONNULL_PTR o);
 
 /**
- * The maximum number of inbound HTLCs towards channel initiator
+ * Checks if two TxSignaturess contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-void CommonOpenChannelFields_set_max_accepted_htlcs(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
+bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b);
 
 /**
- * The channel initiator's key controlling the funding transaction
+ * Frees any resources used by the TxInitRbf, if is_owned is set and inner is non-NULL.
  */
-struct LDKPublicKey CommonOpenChannelFields_get_funding_pubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+void TxInitRbf_free(struct LDKTxInitRbf this_obj);
 
 /**
- * The channel initiator's key controlling the funding transaction
+ * The channel ID
  */
-void CommonOpenChannelFields_set_funding_pubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+struct LDKChannelId TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
 
 /**
- * Used to derive a revocation key for transactions broadcast by counterparty
+ * The channel ID
  */
-struct LDKPublicKey CommonOpenChannelFields_get_revocation_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Used to derive a revocation key for transactions broadcast by counterparty
+ * The locktime of the transaction
  */
-void CommonOpenChannelFields_set_revocation_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
 
 /**
- * A payment key to channel initiator for transactions broadcast by counterparty
+ * The locktime of the transaction
  */
-struct LDKPublicKey CommonOpenChannelFields_get_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * A payment key to channel initiator for transactions broadcast by counterparty
+ * The feerate of the transaction
  */
-void CommonOpenChannelFields_set_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
 
 /**
- * Used to derive a payment key to channel initiator for transactions broadcast by channel
- * initiator
+ * The feerate of the transaction
  */
-struct LDKPublicKey CommonOpenChannelFields_get_delayed_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Used to derive a payment key to channel initiator for transactions broadcast by channel
- * initiator
+ * The number of satoshis the sender will contribute to or, if negative, remove from
+ * (e.g. splice-out) the funding output of the transaction
  */
-void CommonOpenChannelFields_set_delayed_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
 
 /**
- * Used to derive an HTLC payment key to channel initiator
+ * The number of satoshis the sender will contribute to or, if negative, remove from
+ * (e.g. splice-out) the funding output of the transaction
  */
-struct LDKPublicKey CommonOpenChannelFields_get_htlc_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
 
 /**
- * Used to derive an HTLC payment key to channel initiator
+ * Constructs a new TxInitRbf given each field
  */
-void CommonOpenChannelFields_set_htlc_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+MUST_USE_RES struct LDKTxInitRbf TxInitRbf_new(struct LDKChannelId channel_id_arg, uint32_t locktime_arg, uint32_t feerate_sat_per_1000_weight_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
 
 /**
- * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
+ * Creates a copy of the TxInitRbf
  */
-struct LDKPublicKey CommonOpenChannelFields_get_first_per_commitment_point(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig);
 
 /**
- * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
+ * Generates a non-cryptographic 64-bit hash of the TxInitRbf.
  */
-void CommonOpenChannelFields_set_first_per_commitment_point(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+uint64_t TxInitRbf_hash(const struct LDKTxInitRbf *NONNULL_PTR o);
 
 /**
- * The channel flags to be used
+ * Checks if two TxInitRbfs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-uint8_t CommonOpenChannelFields_get_channel_flags(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b);
 
 /**
- * The channel flags to be used
+ * Frees any resources used by the TxAckRbf, if is_owned is set and inner is non-NULL.
  */
-void CommonOpenChannelFields_set_channel_flags(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint8_t val);
+void TxAckRbf_free(struct LDKTxAckRbf this_obj);
 
 /**
- * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
- * collaboratively close
+ * The channel ID
  */
-struct LDKCOption_CVec_u8ZZ CommonOpenChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+struct LDKChannelId TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
 
 /**
- * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
- * collaboratively close
+ * The channel ID
  */
-void CommonOpenChannelFields_set_shutdown_scriptpubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
+void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * The channel type that this channel will represent
- *
- * If this is `None`, we derive the channel type from the intersection of our
- * feature bits with our counterparty's feature bits from the [`Init`] message.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The number of satoshis the sender will contribute to or, if negative, remove from
+ * (e.g. splice-out) the funding output of the transaction
  */
-struct LDKChannelTypeFeatures CommonOpenChannelFields_get_channel_type(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
 
 /**
- * The channel type that this channel will represent
- *
- * If this is `None`, we derive the channel type from the intersection of our
- * feature bits with our counterparty's feature bits from the [`Init`] message.
- *
- * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The number of satoshis the sender will contribute to or, if negative, remove from
+ * (e.g. splice-out) the funding output of the transaction
  */
-void CommonOpenChannelFields_set_channel_type(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
+void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
 
 /**
- * Constructs a new CommonOpenChannelFields given each field
- *
- * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Constructs a new TxAckRbf given each field
  */
-MUST_USE_RES struct LDKCommonOpenChannelFields CommonOpenChannelFields_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKChannelId temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t commitment_feerate_sat_per_1000_weight_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
+MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKChannelId channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
 
 /**
- * Creates a copy of the CommonOpenChannelFields
+ * Creates a copy of the TxAckRbf
  */
-struct LDKCommonOpenChannelFields CommonOpenChannelFields_clone(const struct LDKCommonOpenChannelFields *NONNULL_PTR orig);
+struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the CommonOpenChannelFields.
+ * Generates a non-cryptographic 64-bit hash of the TxAckRbf.
  */
-uint64_t CommonOpenChannelFields_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR o);
+uint64_t TxAckRbf_hash(const struct LDKTxAckRbf *NONNULL_PTR o);
 
 /**
- * Checks if two CommonOpenChannelFieldss contain equal inner contents.
+ * Checks if two TxAckRbfs contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
  * Two objects with NULL inner values will be considered "equal" here.
  */
-bool CommonOpenChannelFields_eq(const struct LDKCommonOpenChannelFields *NONNULL_PTR a, const struct LDKCommonOpenChannelFields *NONNULL_PTR b);
+bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the TxAbort, if is_owned is set and inner is non-NULL.
  */
-void OpenChannel_free(struct LDKOpenChannel this_obj);
+void TxAbort_free(struct LDKTxAbort this_obj);
 
 /**
- * Common fields of `open_channel(2)`-like messages
+ * The channel ID
  */
-struct LDKCommonOpenChannelFields OpenChannel_get_common_fields(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
+struct LDKChannelId TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr);
 
 /**
- * Common fields of `open_channel(2)`-like messages
+ * The channel ID
  */
-void OpenChannel_set_common_fields(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
+void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * The amount to push to the counterparty as part of the open, in milli-satoshi
+ * Message data
+ *
+ * Returns a copy of the field.
  */
-uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr);
 
 /**
- * The amount to push to the counterparty as part of the open, in milli-satoshi
+ * Message data
  */
-void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
+void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
 
 /**
- * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
+ * Constructs a new TxAbort given each field
  */
-uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z data_arg);
 
 /**
- * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
+ * Creates a copy of the TxAbort
  */
-void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig);
 
 /**
- * Constructs a new OpenChannel given each field
+ * Generates a non-cryptographic 64-bit hash of the TxAbort.
  */
-MUST_USE_RES struct LDKOpenChannel OpenChannel_new(struct LDKCommonOpenChannelFields common_fields_arg, uint64_t push_msat_arg, uint64_t channel_reserve_satoshis_arg);
+uint64_t TxAbort_hash(const struct LDKTxAbort *NONNULL_PTR o);
 
 /**
- * Creates a copy of the OpenChannel
+ * Checks if two TxAborts contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
+bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the OpenChannel.
+ * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
  */
-uint64_t OpenChannel_hash(const struct LDKOpenChannel *NONNULL_PTR o);
+void Shutdown_free(struct LDKShutdown this_obj);
 
 /**
- * Checks if two OpenChannels contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The channel ID
  */
-bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
+struct LDKChannelId Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the OpenChannelV2, if is_owned is set and inner is non-NULL.
+ * The channel ID
  */
-void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj);
+void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Common fields of `open_channel(2)`-like messages
+ * The destination of this peer's funds on closing.
+ *
+ * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
  */
-struct LDKCommonOpenChannelFields OpenChannelV2_get_common_fields(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
 
 /**
- * Common fields of `open_channel(2)`-like messages
+ * The destination of this peer's funds on closing.
+ *
+ * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
  */
-void OpenChannelV2_set_common_fields(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
+void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
 
 /**
- * The feerate for the funding transaction set by the channel initiator
+ * Constructs a new Shutdown given each field
  */
-uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
 
 /**
- * The feerate for the funding transaction set by the channel initiator
+ * Creates a copy of the Shutdown
  */
-void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
 
 /**
- * The locktime for the funding transaction
+ * Generates a non-cryptographic 64-bit hash of the Shutdown.
  */
-uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
+uint64_t Shutdown_hash(const struct LDKShutdown *NONNULL_PTR o);
 
 /**
- * The locktime for the funding transaction
+ * Checks if two Shutdowns contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
+bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
 
 /**
- * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
+ * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
  */
-struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
+void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
 
 /**
- * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
+ * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
+ * transaction.
  */
-void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
 
 /**
- * Optionally, a requirement that only confirmed inputs can be added
+ * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
+ * transaction.
  */
-enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
+void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Optionally, a requirement that only confirmed inputs can be added
+ * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
+ * transaction.
  */
-void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
+uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new OpenChannelV2 given each field
+ * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
+ * transaction.
  */
-MUST_USE_RES struct LDKOpenChannelV2 OpenChannelV2_new(struct LDKCommonOpenChannelFields common_fields_arg, uint32_t funding_feerate_sat_per_1000_weight_arg, uint32_t locktime_arg, struct LDKPublicKey second_per_commitment_point_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
+void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Creates a copy of the OpenChannelV2
+ * Constructs a new ClosingSignedFeeRange given each field
  */
-struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig);
+MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the OpenChannelV2.
+ * Creates a copy of the ClosingSignedFeeRange
  */
-uint64_t OpenChannelV2_hash(const struct LDKOpenChannelV2 *NONNULL_PTR o);
+struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
 
 /**
- * Checks if two OpenChannelV2s contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Generates a non-cryptographic 64-bit hash of the ClosingSignedFeeRange.
  */
-bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b);
+uint64_t ClosingSignedFeeRange_hash(const struct LDKClosingSignedFeeRange *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CommonAcceptChannelFields, if is_owned is set and inner is non-NULL.
+ * Checks if two ClosingSignedFeeRanges contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-void CommonAcceptChannelFields_free(struct LDKCommonAcceptChannelFields this_obj);
+bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
 
 /**
- * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
+ * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
  */
-struct LDKChannelId CommonAcceptChannelFields_get_temporary_channel_id(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+void ClosingSigned_free(struct LDKClosingSigned this_obj);
 
 /**
- * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
+ * The channel ID
  */
-void CommonAcceptChannelFields_set_temporary_channel_id(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
+struct LDKChannelId ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
 
 /**
- * The threshold below which outputs on transactions broadcast by the channel acceptor will be
- * omitted
+ * The channel ID
  */
-uint64_t CommonAcceptChannelFields_get_dust_limit_satoshis(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * The threshold below which outputs on transactions broadcast by the channel acceptor will be
- * omitted
+ * The proposed total fee for the closing transaction
  */
-void CommonAcceptChannelFields_set_dust_limit_satoshis(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
 
 /**
- * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
+ * The proposed total fee for the closing transaction
  */
-uint64_t CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
+ * A signature on the closing transaction
  */
-void CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKECDSASignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
 
 /**
- * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
+ * A signature on the closing transaction
  */
-uint64_t CommonAcceptChannelFields_get_htlc_minimum_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
 
 /**
- * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
+ * 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
  */
-void CommonAcceptChannelFields_set_htlc_minimum_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
 
 /**
- * Minimum depth of the funding transaction before the channel is considered open
+ * 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
  */
-uint32_t CommonAcceptChannelFields_get_minimum_depth(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
 
 /**
- * Minimum depth of the funding transaction before the channel is considered open
+ * Constructs a new ClosingSigned given each field
+ *
+ * Note that fee_range_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void CommonAcceptChannelFields_set_minimum_depth(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint32_t val);
+MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKChannelId channel_id_arg, uint64_t fee_satoshis_arg, struct LDKECDSASignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg);
 
 /**
- * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
- * broadcast a commitment transaction
+ * Creates a copy of the ClosingSigned
  */
-uint16_t CommonAcceptChannelFields_get_to_self_delay(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
 
 /**
- * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
- * broadcast a commitment transaction
+ * Generates a non-cryptographic 64-bit hash of the ClosingSigned.
  */
-void CommonAcceptChannelFields_set_to_self_delay(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
+uint64_t ClosingSigned_hash(const struct LDKClosingSigned *NONNULL_PTR o);
 
 /**
- * The maximum number of inbound HTLCs towards channel acceptor
+ * Checks if two ClosingSigneds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-uint16_t CommonAcceptChannelFields_get_max_accepted_htlcs(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
 
 /**
- * The maximum number of inbound HTLCs towards channel acceptor
+ * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
  */
-void CommonAcceptChannelFields_set_max_accepted_htlcs(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
+void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
 
 /**
- * The channel acceptor's key controlling the funding transaction
+ * The channel ID
  */
-struct LDKPublicKey CommonAcceptChannelFields_get_funding_pubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+struct LDKChannelId UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
 
 /**
- * The channel acceptor's key controlling the funding transaction
+ * The channel ID
  */
-void CommonAcceptChannelFields_set_funding_pubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Used to derive a revocation key for transactions broadcast by counterparty
+ * The HTLC ID
  */
-struct LDKPublicKey CommonAcceptChannelFields_get_revocation_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
 
 /**
- * Used to derive a revocation key for transactions broadcast by counterparty
+ * The HTLC ID
  */
-void CommonAcceptChannelFields_set_revocation_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * A payment key to channel acceptor for transactions broadcast by counterparty
+ * The HTLC value in milli-satoshi
  */
-struct LDKPublicKey CommonAcceptChannelFields_get_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
 
 /**
- * A payment key to channel acceptor for transactions broadcast by counterparty
+ * The HTLC value in milli-satoshi
  */
-void CommonAcceptChannelFields_set_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Used to derive a payment key to channel acceptor for transactions broadcast by channel
- * acceptor
+ * The payment hash, the pre-image of which controls HTLC redemption
  */
-struct LDKPublicKey CommonAcceptChannelFields_get_delayed_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
 
 /**
- * Used to derive a payment key to channel acceptor for transactions broadcast by channel
- * acceptor
+ * The payment hash, the pre-image of which controls HTLC redemption
  */
-void CommonAcceptChannelFields_set_delayed_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
+ * The expiry height of the HTLC
  */
-struct LDKPublicKey CommonAcceptChannelFields_get_htlc_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
 
 /**
- * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
+ * The expiry height of the HTLC
  */
-void CommonAcceptChannelFields_set_htlc_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
+ * The extra fee skimmed by the sender of this message. See
+ * [`ChannelConfig::accept_underpaying_htlcs`].
+ *
+ * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
  */
-struct LDKPublicKey CommonAcceptChannelFields_get_first_per_commitment_point(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
 
 /**
- * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
+ * The extra fee skimmed by the sender of this message. See
+ * [`ChannelConfig::accept_underpaying_htlcs`].
+ *
+ * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
  */
-void CommonAcceptChannelFields_set_first_per_commitment_point(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
 
 /**
- * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
- * collaboratively close
+ * The onion routing packet with encrypted data for the next hop.
  */
-struct LDKCOption_CVec_u8ZZ CommonAcceptChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+struct LDKOnionPacket UpdateAddHTLC_get_onion_routing_packet(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
 
 /**
- * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
- * collaboratively close
+ * The onion routing packet with encrypted data for the next hop.
  */
-void CommonAcceptChannelFields_set_shutdown_scriptpubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
+void UpdateAddHTLC_set_onion_routing_packet(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKOnionPacket val);
 
 /**
- * The channel type that this channel will represent. If none is set, we derive the channel
- * type from the intersection of our feature bits with our counterparty's feature bits from
- * the Init message.
- *
- * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
- * [`CommonOpenChannelFields::channel_type`].
+ * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
+ * routing packet and the recipient-provided encrypted payload within.
  *
  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKChannelTypeFeatures CommonAcceptChannelFields_get_channel_type(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+struct LDKPublicKey UpdateAddHTLC_get_blinding_point(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
 
 /**
- * The channel type that this channel will represent. If none is set, we derive the channel
- * type from the intersection of our feature bits with our counterparty's feature bits from
- * the Init message.
- *
- * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
- * [`CommonOpenChannelFields::channel_type`].
+ * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
+ * routing packet and the recipient-provided encrypted payload within.
  *
  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void CommonAcceptChannelFields_set_channel_type(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
+void UpdateAddHTLC_set_blinding_point(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Constructs a new CommonAcceptChannelFields given each field
+ * Constructs a new UpdateAddHTLC given each field
  *
- * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that blinding_point_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_new(struct LDKChannelId temporary_channel_id_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
+MUST_USE_RES struct LDKUpdateAddHTLC UpdateAddHTLC_new(struct LDKChannelId channel_id_arg, uint64_t htlc_id_arg, uint64_t amount_msat_arg, struct LDKThirtyTwoBytes payment_hash_arg, uint32_t cltv_expiry_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg, struct LDKOnionPacket onion_routing_packet_arg, struct LDKPublicKey blinding_point_arg);
 
 /**
- * Creates a copy of the CommonAcceptChannelFields
+ * Creates a copy of the UpdateAddHTLC
  */
-struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_clone(const struct LDKCommonAcceptChannelFields *NONNULL_PTR orig);
+struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the CommonAcceptChannelFields.
+ * Generates a non-cryptographic 64-bit hash of the UpdateAddHTLC.
  */
-uint64_t CommonAcceptChannelFields_hash(const struct LDKCommonAcceptChannelFields *NONNULL_PTR o);
+uint64_t UpdateAddHTLC_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR o);
 
 /**
- * Checks if two CommonAcceptChannelFieldss contain equal inner contents.
+ * Checks if two UpdateAddHTLCs contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
  * Two objects with NULL inner values will be considered "equal" here.
  */
-bool CommonAcceptChannelFields_eq(const struct LDKCommonAcceptChannelFields *NONNULL_PTR a, const struct LDKCommonAcceptChannelFields *NONNULL_PTR b);
+bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
  */
-void AcceptChannel_free(struct LDKAcceptChannel this_obj);
+void OnionMessage_free(struct LDKOnionMessage this_obj);
 
 /**
- * Common fields of `accept_channel(2)`-like messages
+ * Used in decrypting the onion packet's payload.
  */
-struct LDKCommonAcceptChannelFields AcceptChannel_get_common_fields(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
+struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
 
 /**
- * Common fields of `accept_channel(2)`-like messages
+ * Used in decrypting the onion packet's payload.
  */
-void AcceptChannel_set_common_fields(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
+void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
+ * The full onion packet including hop data, pubkey, and hmac
  */
-uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
+struct LDKPacket OnionMessage_get_onion_routing_packet(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
 
 /**
- * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
+ * The full onion packet including hop data, pubkey, and hmac
  */
-void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
+void OnionMessage_set_onion_routing_packet(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPacket val);
 
 /**
- * Constructs a new AcceptChannel given each field
+ * Constructs a new OnionMessage given each field
  */
-MUST_USE_RES struct LDKAcceptChannel AcceptChannel_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t channel_reserve_satoshis_arg);
+MUST_USE_RES struct LDKOnionMessage OnionMessage_new(struct LDKPublicKey blinding_point_arg, struct LDKPacket onion_routing_packet_arg);
 
 /**
- * Creates a copy of the AcceptChannel
+ * Creates a copy of the OnionMessage
  */
-struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
+struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the AcceptChannel.
+ * Generates a non-cryptographic 64-bit hash of the OnionMessage.
  */
-uint64_t AcceptChannel_hash(const struct LDKAcceptChannel *NONNULL_PTR o);
+uint64_t OnionMessage_hash(const struct LDKOnionMessage *NONNULL_PTR o);
 
 /**
- * Checks if two AcceptChannels contain equal inner contents.
+ * Checks if two OnionMessages contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
  * Two objects with NULL inner values will be considered "equal" here.
  */
-bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
+bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the AcceptChannelV2, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
  */
-void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj);
+void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
 
 /**
- * Common fields of `accept_channel(2)`-like messages
+ * The channel ID
  */
-struct LDKCommonAcceptChannelFields AcceptChannelV2_get_common_fields(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
+struct LDKChannelId UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
 
 /**
- * Common fields of `accept_channel(2)`-like messages
+ * The channel ID
  */
-void AcceptChannelV2_set_common_fields(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
+void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Part of the channel value contributed by the channel acceptor
+ * The HTLC ID
  */
-uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
+uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
 
 /**
- * Part of the channel value contributed by the channel acceptor
+ * The HTLC ID
  */
-void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
+void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
+ * The pre-image of the payment hash, allowing HTLC redemption
  */
-struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
+const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
 
 /**
- * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
+ * The pre-image of the payment hash, allowing HTLC redemption
  */
-void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Optionally, a requirement that only confirmed inputs can be added
+ * Constructs a new UpdateFulfillHTLC given each field
+ */
+MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKChannelId channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
+
+/**
+ * Creates a copy of the UpdateFulfillHTLC
+ */
+struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the UpdateFulfillHTLC.
+ */
+uint64_t UpdateFulfillHTLC_hash(const struct LDKUpdateFulfillHTLC *NONNULL_PTR o);
+
+/**
+ * Checks if two UpdateFulfillHTLCs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
+bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
 
 /**
- * Optionally, a requirement that only confirmed inputs can be added
+ * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
  */
-void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
+void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
 
 /**
- * Constructs a new AcceptChannelV2 given each field
+ * The channel ID
  */
-MUST_USE_RES struct LDKAcceptChannelV2 AcceptChannelV2_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t funding_satoshis_arg, struct LDKPublicKey second_per_commitment_point_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
+struct LDKChannelId UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the AcceptChannelV2
+ * The channel ID
  */
-struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig);
+void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the AcceptChannelV2.
+ * The HTLC ID
  */
-uint64_t AcceptChannelV2_hash(const struct LDKAcceptChannelV2 *NONNULL_PTR o);
+uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two AcceptChannelV2s contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The HTLC ID
  */
-bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b);
+void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the UpdateFailHTLC
  */
-void FundingCreated_free(struct LDKFundingCreated this_obj);
+struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
 
 /**
- * A temporary channel ID, until the funding is established
+ * Generates a non-cryptographic 64-bit hash of the UpdateFailHTLC.
  */
-struct LDKChannelId FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
+uint64_t UpdateFailHTLC_hash(const struct LDKUpdateFailHTLC *NONNULL_PTR o);
 
 /**
- * A temporary channel ID, until the funding is established
+ * Checks if two UpdateFailHTLCs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKChannelId val);
+bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
 
 /**
- * The funding transaction ID
+ * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
  */
-const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
+void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
 
 /**
- * The funding transaction ID
+ * The channel ID
  */
-void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKChannelId UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
 
 /**
- * The specific output index funding this channel
+ * The channel ID
  */
-uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
+void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * The specific output index funding this channel
+ * The HTLC ID
  */
-void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
+uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
 
 /**
- * The signature of the channel initiator (funder) on the initial commitment transaction
+ * The HTLC ID
  */
-struct LDKECDSASignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
+void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The signature of the channel initiator (funder) on the initial commitment transaction
+ * The failure code
  */
-void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new FundingCreated given each field
+ * The failure code
  */
-MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKChannelId temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKECDSASignature signature_arg);
+void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
- * Creates a copy of the FundingCreated
+ * Creates a copy of the UpdateFailMalformedHTLC
  */
-struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
+struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the FundingCreated.
+ * Generates a non-cryptographic 64-bit hash of the UpdateFailMalformedHTLC.
  */
-uint64_t FundingCreated_hash(const struct LDKFundingCreated *NONNULL_PTR o);
+uint64_t UpdateFailMalformedHTLC_hash(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR o);
 
 /**
- * Checks if two FundingCreateds contain equal inner contents.
+ * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
  * Two objects with NULL inner values will be considered "equal" here.
  */
-bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
+bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the CommitmentSignedBatch, if is_owned is set and inner is non-NULL.
  */
-void FundingSigned_free(struct LDKFundingSigned this_obj);
+void CommitmentSignedBatch_free(struct LDKCommitmentSignedBatch this_obj);
 
 /**
- * The channel ID
+ * Batch size N: all N `commitment_signed` messages must be received before being processed
  */
-struct LDKChannelId FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
+uint16_t CommitmentSignedBatch_get_batch_size(const struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr);
 
 /**
- * The channel ID
+ * Batch size N: all N `commitment_signed` messages must be received before being processed
  */
-void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
+void CommitmentSignedBatch_set_batch_size(struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
- * The signature of the channel acceptor (fundee) on the initial commitment transaction
+ * The funding transaction, to discriminate among multiple pending funding transactions (e.g. in case of splicing)
  */
-struct LDKECDSASignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
+const uint8_t (*CommitmentSignedBatch_get_funding_txid(const struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr))[32];
 
 /**
- * The signature of the channel acceptor (fundee) on the initial commitment transaction
+ * The funding transaction, to discriminate among multiple pending funding transactions (e.g. in case of splicing)
  */
-void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+void CommitmentSignedBatch_set_funding_txid(struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Constructs a new FundingSigned given each field
+ * Constructs a new CommitmentSignedBatch given each field
  */
-MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg);
+MUST_USE_RES struct LDKCommitmentSignedBatch CommitmentSignedBatch_new(uint16_t batch_size_arg, struct LDKThirtyTwoBytes funding_txid_arg);
 
 /**
- * Creates a copy of the FundingSigned
+ * Creates a copy of the CommitmentSignedBatch
  */
-struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
+struct LDKCommitmentSignedBatch CommitmentSignedBatch_clone(const struct LDKCommitmentSignedBatch *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the FundingSigned.
+ * Generates a non-cryptographic 64-bit hash of the CommitmentSignedBatch.
  */
-uint64_t FundingSigned_hash(const struct LDKFundingSigned *NONNULL_PTR o);
+uint64_t CommitmentSignedBatch_hash(const struct LDKCommitmentSignedBatch *NONNULL_PTR o);
 
 /**
- * Checks if two FundingSigneds contain equal inner contents.
+ * Checks if two CommitmentSignedBatchs contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
  * Two objects with NULL inner values will be considered "equal" here.
  */
-bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
+bool CommitmentSignedBatch_eq(const struct LDKCommitmentSignedBatch *NONNULL_PTR a, const struct LDKCommitmentSignedBatch *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
  */
-void ChannelReady_free(struct LDKChannelReady this_obj);
+void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
 
 /**
  * The channel ID
  */
-struct LDKChannelId ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr);
+struct LDKChannelId CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
 
 /**
  * The channel ID
  */
-void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKChannelId val);
-
-/**
- * The per-commitment point of the second commitment transaction
- */
-struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
+void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * The per-commitment point of the second commitment transaction
+ * A signature on the commitment transaction
  */
-void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+struct LDKECDSASignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
 
 /**
- * If set, provides a `short_channel_id` alias for this channel.
- *
- * The sender will accept payments to be forwarded over this SCID and forward them to this
- * messages' recipient.
+ * A signature on the commitment transaction
  */
-struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
+void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
 
 /**
- * If set, provides a `short_channel_id` alias for this channel.
+ * Signatures on the HTLC transactions
  *
- * The sender will accept payments to be forwarded over this SCID and forward them to this
- * messages' recipient.
- */
-void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
-
-/**
- * Constructs a new ChannelReady given each field
+ * Returns a copy of the field.
  */
-MUST_USE_RES struct LDKChannelReady ChannelReady_new(struct LDKChannelId channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg);
+struct LDKCVec_ECDSASignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the ChannelReady
+ * Signatures on the HTLC transactions
  */
-struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
+void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ChannelReady.
+ * Optional batch size and other parameters
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-uint64_t ChannelReady_hash(const struct LDKChannelReady *NONNULL_PTR o);
+struct LDKCommitmentSignedBatch CommitmentSigned_get_batch(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two ChannelReadys contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Optional batch size and other parameters
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
+void CommitmentSigned_set_batch(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCommitmentSignedBatch val);
 
 /**
- * Frees any resources used by the Stfu, if is_owned is set and inner is non-NULL.
+ * Constructs a new CommitmentSigned given each field
+ *
+ * Note that batch_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void Stfu_free(struct LDKStfu this_obj);
+MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg, struct LDKCommitmentSignedBatch batch_arg);
 
 /**
- * The channel ID where quiescence is intended
+ * Creates a copy of the CommitmentSigned
  */
-struct LDKChannelId Stfu_get_channel_id(const struct LDKStfu *NONNULL_PTR this_ptr);
+struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
 
 /**
- * The channel ID where quiescence is intended
+ * Generates a non-cryptographic 64-bit hash of the CommitmentSigned.
  */
-void Stfu_set_channel_id(struct LDKStfu *NONNULL_PTR this_ptr, struct LDKChannelId val);
+uint64_t CommitmentSigned_hash(const struct LDKCommitmentSigned *NONNULL_PTR o);
 
 /**
- * Initiator flag, 1 if initiating, 0 if replying to an stfu.
+ * Checks if two CommitmentSigneds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-uint8_t Stfu_get_initiator(const struct LDKStfu *NONNULL_PTR this_ptr);
+bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
 
 /**
- * Initiator flag, 1 if initiating, 0 if replying to an stfu.
+ * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
  */
-void Stfu_set_initiator(struct LDKStfu *NONNULL_PTR this_ptr, uint8_t val);
+void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
 
 /**
- * Constructs a new Stfu given each field
+ * The channel ID
  */
-MUST_USE_RES struct LDKStfu Stfu_new(struct LDKChannelId channel_id_arg, uint8_t initiator_arg);
+struct LDKChannelId RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the Stfu
+ * The channel ID
  */
-struct LDKStfu Stfu_clone(const struct LDKStfu *NONNULL_PTR orig);
+void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Checks if two Stfus contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The secret corresponding to the per-commitment point
  */
-bool Stfu_eq(const struct LDKStfu *NONNULL_PTR a, const struct LDKStfu *NONNULL_PTR b);
+const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
 
 /**
- * Frees any resources used by the Splice, if is_owned is set and inner is non-NULL.
+ * The secret corresponding to the per-commitment point
  */
-void Splice_free(struct LDKSplice this_obj);
+void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * The channel ID where splicing is intended
+ * The next sender-broadcast commitment transaction's per-commitment point
  */
-struct LDKChannelId Splice_get_channel_id(const struct LDKSplice *NONNULL_PTR this_ptr);
+struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
 
 /**
- * The channel ID where splicing is intended
+ * The next sender-broadcast commitment transaction's per-commitment point
  */
-void Splice_set_channel_id(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKChannelId val);
+void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * The genesis hash of the blockchain where the channel is intended to be spliced
+ * Constructs a new RevokeAndACK given each field
  */
-const uint8_t (*Splice_get_chain_hash(const struct LDKSplice *NONNULL_PTR this_ptr))[32];
+MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg);
 
 /**
- * The genesis hash of the blockchain where the channel is intended to be spliced
+ * Creates a copy of the RevokeAndACK
  */
-void Splice_set_chain_hash(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
 
 /**
- * The intended change in channel capacity: the amount to be added (positive value)
- * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
+ * Generates a non-cryptographic 64-bit hash of the RevokeAndACK.
  */
-int64_t Splice_get_relative_satoshis(const struct LDKSplice *NONNULL_PTR this_ptr);
+uint64_t RevokeAndACK_hash(const struct LDKRevokeAndACK *NONNULL_PTR o);
 
 /**
- * The intended change in channel capacity: the amount to be added (positive value)
- * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
+ * Checks if two RevokeAndACKs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-void Splice_set_relative_satoshis(struct LDKSplice *NONNULL_PTR this_ptr, int64_t val);
+bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
 
 /**
- * The feerate for the new funding transaction, set by the splice initiator
+ * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
  */
-uint32_t Splice_get_funding_feerate_perkw(const struct LDKSplice *NONNULL_PTR this_ptr);
+void UpdateFee_free(struct LDKUpdateFee this_obj);
 
 /**
- * The feerate for the new funding transaction, set by the splice initiator
+ * The channel ID
  */
-void Splice_set_funding_feerate_perkw(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKChannelId UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
 
 /**
- * The locktime for the new funding transaction
+ * The channel ID
  */
-uint32_t Splice_get_locktime(const struct LDKSplice *NONNULL_PTR this_ptr);
+void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * The locktime for the new funding transaction
+ * Fee rate per 1000-weight of the transaction
  */
-void Splice_set_locktime(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
+uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
 
 /**
- * The key of the sender (splice initiator) controlling the new funding transaction
+ * Fee rate per 1000-weight of the transaction
  */
-struct LDKPublicKey Splice_get_funding_pubkey(const struct LDKSplice *NONNULL_PTR this_ptr);
+void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * The key of the sender (splice initiator) controlling the new funding transaction
+ * Constructs a new UpdateFee given each field
  */
-void Splice_set_funding_pubkey(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKChannelId channel_id_arg, uint32_t feerate_per_kw_arg);
 
 /**
- * Constructs a new Splice given each field
+ * Creates a copy of the UpdateFee
  */
-MUST_USE_RES struct LDKSplice Splice_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes chain_hash_arg, int64_t relative_satoshis_arg, uint32_t funding_feerate_perkw_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg);
+struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
 
 /**
- * Creates a copy of the Splice
+ * Generates a non-cryptographic 64-bit hash of the UpdateFee.
  */
-struct LDKSplice Splice_clone(const struct LDKSplice *NONNULL_PTR orig);
+uint64_t UpdateFee_hash(const struct LDKUpdateFee *NONNULL_PTR o);
 
 /**
- * Checks if two Splices contain equal inner contents.
+ * Checks if two UpdateFees contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
  * Two objects with NULL inner values will be considered "equal" here.
  */
-bool Splice_eq(const struct LDKSplice *NONNULL_PTR a, const struct LDKSplice *NONNULL_PTR b);
-
-/**
- * Frees any resources used by the SpliceAck, if is_owned is set and inner is non-NULL.
- */
-void SpliceAck_free(struct LDKSpliceAck this_obj);
+bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
 
 /**
- * The channel ID where splicing is intended
+ * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
  */
-struct LDKChannelId SpliceAck_get_channel_id(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
+void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
 
 /**
- * The channel ID where splicing is intended
+ * The channel ID
  */
-void SpliceAck_set_channel_id(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKChannelId val);
+struct LDKChannelId ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
 
 /**
- * The genesis hash of the blockchain where the channel is intended to be spliced
+ * The channel ID
  */
-const uint8_t (*SpliceAck_get_chain_hash(const struct LDKSpliceAck *NONNULL_PTR this_ptr))[32];
+void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * The genesis hash of the blockchain where the channel is intended to be spliced
+ * The next commitment number for the sender
  */
-void SpliceAck_set_chain_hash(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
 
 /**
- * The intended change in channel capacity: the amount to be added (positive value)
- * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
+ * The next commitment number for the sender
  */
-int64_t SpliceAck_get_relative_satoshis(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
+void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The intended change in channel capacity: the amount to be added (positive value)
- * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
+ * The next commitment number for the recipient
  */
-void SpliceAck_set_relative_satoshis(struct LDKSpliceAck *NONNULL_PTR this_ptr, int64_t val);
+uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
 
 /**
- * The key of the sender (splice acceptor) controlling the new funding transaction
+ * The next commitment number for the recipient
  */
-struct LDKPublicKey SpliceAck_get_funding_pubkey(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
+void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The key of the sender (splice acceptor) controlling the new funding transaction
+ * Proof that the sender knows the per-commitment secret of a specific commitment transaction
+ * belonging to the recipient
  */
-void SpliceAck_set_funding_pubkey(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
 
 /**
- * Constructs a new SpliceAck given each field
+ * Proof that the sender knows the per-commitment secret of a specific commitment transaction
+ * belonging to the recipient
  */
-MUST_USE_RES struct LDKSpliceAck SpliceAck_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes chain_hash_arg, int64_t relative_satoshis_arg, struct LDKPublicKey funding_pubkey_arg);
+void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Creates a copy of the SpliceAck
+ * The sender's per-commitment point for their current commitment transaction
  */
-struct LDKSpliceAck SpliceAck_clone(const struct LDKSpliceAck *NONNULL_PTR orig);
+struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two SpliceAcks contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The sender's per-commitment point for their current commitment transaction
  */
-bool SpliceAck_eq(const struct LDKSpliceAck *NONNULL_PTR a, const struct LDKSpliceAck *NONNULL_PTR b);
+void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Frees any resources used by the SpliceLocked, if is_owned is set and inner is non-NULL.
+ * The next funding transaction ID
  */
-void SpliceLocked_free(struct LDKSpliceLocked this_obj);
+struct LDKCOption_ThirtyTwoBytesZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
 
 /**
- * The channel ID
+ * The next funding transaction ID
  */
-struct LDKChannelId SpliceLocked_get_channel_id(const struct LDKSpliceLocked *NONNULL_PTR this_ptr);
+void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
 
 /**
- * The channel ID
+ * Constructs a new ChannelReestablish given each field
  */
-void SpliceLocked_set_channel_id(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKChannelId val);
+MUST_USE_RES struct LDKChannelReestablish ChannelReestablish_new(struct LDKChannelId channel_id_arg, uint64_t next_local_commitment_number_arg, uint64_t next_remote_commitment_number_arg, struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg, struct LDKCOption_ThirtyTwoBytesZ next_funding_txid_arg);
 
 /**
- * Constructs a new SpliceLocked given each field
+ * Creates a copy of the ChannelReestablish
  */
-MUST_USE_RES struct LDKSpliceLocked SpliceLocked_new(struct LDKChannelId channel_id_arg);
+struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
 
 /**
- * Creates a copy of the SpliceLocked
+ * Generates a non-cryptographic 64-bit hash of the ChannelReestablish.
  */
-struct LDKSpliceLocked SpliceLocked_clone(const struct LDKSpliceLocked *NONNULL_PTR orig);
+uint64_t ChannelReestablish_hash(const struct LDKChannelReestablish *NONNULL_PTR o);
 
 /**
- * Checks if two SpliceLockeds contain equal inner contents.
+ * Checks if two ChannelReestablishs contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
  * Two objects with NULL inner values will be considered "equal" here.
  */
-bool SpliceLocked_eq(const struct LDKSpliceLocked *NONNULL_PTR a, const struct LDKSpliceLocked *NONNULL_PTR b);
+bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the TxAddInput, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
  */
-void TxAddInput_free(struct LDKTxAddInput this_obj);
+void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
 
 /**
  * The channel ID
  */
-struct LDKChannelId TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
+struct LDKChannelId AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
 
 /**
  * The channel ID
  */
-void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
-
-/**
- * A randomly chosen unique identifier for this input, which is even for initiators and odd for
- * non-initiators.
- */
-uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
-
-/**
- * A randomly chosen unique identifier for this input, which is even for initiators and odd for
- * non-initiators.
- */
-void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val);
+void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Serialized transaction that contains the output this input spends to verify that it is non
- * malleable.
+ * The short channel ID
  */
-struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
+uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
 
 /**
- * Serialized transaction that contains the output this input spends to verify that it is non
- * malleable.
+ * The short channel ID
  */
-void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val);
+void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The index of the output being spent
+ * A signature by the node key
  */
-uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
+struct LDKECDSASignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
 
 /**
- * The index of the output being spent
+ * A signature by the node key
  */
-void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
+void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
 
 /**
- * The sequence number of this input
+ * A signature by the funding key
  */
-uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
+struct LDKECDSASignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
 
 /**
- * The sequence number of this input
+ * A signature by the funding key
  */
-void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
+void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
 
 /**
- * Constructs a new TxAddInput given each field
+ * Constructs a new AnnouncementSignatures given each field
  */
-MUST_USE_RES struct LDKTxAddInput TxAddInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg, struct LDKTransactionU16LenLimited prevtx_arg, uint32_t prevtx_out_arg, uint32_t sequence_arg);
+MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKChannelId channel_id_arg, uint64_t short_channel_id_arg, struct LDKECDSASignature node_signature_arg, struct LDKECDSASignature bitcoin_signature_arg);
 
 /**
- * Creates a copy of the TxAddInput
+ * Creates a copy of the AnnouncementSignatures
  */
-struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig);
+struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the TxAddInput.
+ * Generates a non-cryptographic 64-bit hash of the AnnouncementSignatures.
  */
-uint64_t TxAddInput_hash(const struct LDKTxAddInput *NONNULL_PTR o);
+uint64_t AnnouncementSignatures_hash(const struct LDKAnnouncementSignatures *NONNULL_PTR o);
 
 /**
- * Checks if two TxAddInputs contain equal inner contents.
+ * Checks if two AnnouncementSignaturess contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
  * Two objects with NULL inner values will be considered "equal" here.
  */
-bool TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b);
-
-/**
- * Frees any resources used by the TxAddOutput, if is_owned is set and inner is non-NULL.
- */
-void TxAddOutput_free(struct LDKTxAddOutput this_obj);
-
-/**
- * The channel ID
- */
-struct LDKChannelId TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
+bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
 
 /**
- * The channel ID
+ * Frees any resources used by the SocketAddress
  */
-void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
+void SocketAddress_free(struct LDKSocketAddress this_ptr);
 
 /**
- * A randomly chosen unique identifier for this output, which is even for initiators and odd for
- * non-initiators.
+ * Creates a copy of the SocketAddress
  */
-uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
+struct LDKSocketAddress SocketAddress_clone(const struct LDKSocketAddress *NONNULL_PTR orig);
 
 /**
- * A randomly chosen unique identifier for this output, which is even for initiators and odd for
- * non-initiators.
+ * Utility method to constructs a new TcpIpV4-variant SocketAddress
  */
-void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKSocketAddress SocketAddress_tcp_ip_v4(struct LDKFourBytes addr, uint16_t port);
 
 /**
- * The satoshi value of the output
+ * Utility method to constructs a new TcpIpV6-variant SocketAddress
  */
-uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
+struct LDKSocketAddress SocketAddress_tcp_ip_v6(struct LDKSixteenBytes addr, uint16_t port);
 
 /**
- * The satoshi value of the output
+ * Utility method to constructs a new OnionV2-variant SocketAddress
  */
-void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKSocketAddress SocketAddress_onion_v2(struct LDKTwelveBytes a);
 
 /**
- * The scriptPubKey for the output
+ * Utility method to constructs a new OnionV3-variant SocketAddress
  */
-struct LDKCVec_u8Z TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
+struct LDKSocketAddress SocketAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
 
 /**
- * The scriptPubKey for the output
+ * Utility method to constructs a new Hostname-variant SocketAddress
  */
-void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+struct LDKSocketAddress SocketAddress_hostname(struct LDKHostname hostname, uint16_t port);
 
 /**
- * Constructs a new TxAddOutput given each field
+ * Generates a non-cryptographic 64-bit hash of the SocketAddress.
  */
-MUST_USE_RES struct LDKTxAddOutput TxAddOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg, uint64_t sats_arg, struct LDKCVec_u8Z script_arg);
+uint64_t SocketAddress_hash(const struct LDKSocketAddress *NONNULL_PTR o);
 
 /**
- * Creates a copy of the TxAddOutput
+ * Checks if two SocketAddresss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig);
+bool SocketAddress_eq(const struct LDKSocketAddress *NONNULL_PTR a, const struct LDKSocketAddress *NONNULL_PTR b);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the TxAddOutput.
+ * Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
  */
-uint64_t TxAddOutput_hash(const struct LDKTxAddOutput *NONNULL_PTR o);
+struct LDKCVec_u8Z SocketAddress_write(const struct LDKSocketAddress *NONNULL_PTR obj);
 
 /**
- * Checks if two TxAddOutputs contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Read a SocketAddress from a byte array, created by SocketAddress_write
  */
-bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b);
+struct LDKCResult_SocketAddressDecodeErrorZ SocketAddress_read(struct LDKu8slice ser);
 
 /**
- * Frees any resources used by the TxRemoveInput, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the SocketAddressParseError
  */
-void TxRemoveInput_free(struct LDKTxRemoveInput this_obj);
+enum LDKSocketAddressParseError SocketAddressParseError_clone(const enum LDKSocketAddressParseError *NONNULL_PTR orig);
 
 /**
- * The channel ID
+ * Utility method to constructs a new SocketAddrParse-variant SocketAddressParseError
  */
-struct LDKChannelId TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
+enum LDKSocketAddressParseError SocketAddressParseError_socket_addr_parse(void);
 
 /**
- * The channel ID
+ * Utility method to constructs a new InvalidInput-variant SocketAddressParseError
  */
-void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
+enum LDKSocketAddressParseError SocketAddressParseError_invalid_input(void);
 
 /**
- * The serial ID of the input to be removed
+ * Utility method to constructs a new InvalidPort-variant SocketAddressParseError
  */
-uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
+enum LDKSocketAddressParseError SocketAddressParseError_invalid_port(void);
 
 /**
- * The serial ID of the input to be removed
+ * Utility method to constructs a new InvalidOnionV3-variant SocketAddressParseError
  */
-void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val);
+enum LDKSocketAddressParseError SocketAddressParseError_invalid_onion_v3(void);
 
 /**
- * Constructs a new TxRemoveInput given each field
+ * Generates a non-cryptographic 64-bit hash of the SocketAddressParseError.
  */
-MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
+uint64_t SocketAddressParseError_hash(const enum LDKSocketAddressParseError *NONNULL_PTR o);
 
 /**
- * Creates a copy of the TxRemoveInput
+ * Checks if two SocketAddressParseErrors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig);
+bool SocketAddressParseError_eq(const enum LDKSocketAddressParseError *NONNULL_PTR a, const enum LDKSocketAddressParseError *NONNULL_PTR b);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the TxRemoveInput.
+ * Get the string representation of a SocketAddressParseError object
  */
-uint64_t TxRemoveInput_hash(const struct LDKTxRemoveInput *NONNULL_PTR o);
+struct LDKStr SocketAddressParseError_to_str(const enum LDKSocketAddressParseError *NONNULL_PTR o);
 
 /**
- * Checks if two TxRemoveInputs contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Parses an OnionV3 host and port into a [`SocketAddress::OnionV3`].
+ *
+ * The host part must end with \".onion\".
  */
-bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b);
+struct LDKCResult_SocketAddressSocketAddressParseErrorZ parse_onion_address(struct LDKStr host, uint16_t port);
 
 /**
- * Frees any resources used by the TxRemoveOutput, if is_owned is set and inner is non-NULL.
+ * Get the string representation of a SocketAddress object
  */
-void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj);
+struct LDKStr SocketAddress_to_str(const struct LDKSocketAddress *NONNULL_PTR o);
 
 /**
- * The channel ID
+ * Read a SocketAddress object from a string
  */
-struct LDKChannelId TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
+struct LDKCResult_SocketAddressSocketAddressParseErrorZ SocketAddress_from_str(struct LDKStr s);
 
 /**
- * The channel ID
+ * Frees any resources used by the UnsignedGossipMessage
  */
-void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
+void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
 
 /**
- * The serial ID of the output to be removed
+ * Creates a copy of the UnsignedGossipMessage
  */
-uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
+struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
 
 /**
- * The serial ID of the output to be removed
+ * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
  */
-void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
 
 /**
- * Constructs a new TxRemoveOutput given each field
+ * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
  */
-MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
+struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
 
 /**
- * Creates a copy of the TxRemoveOutput
+ * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
  */
-struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig);
+struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the TxRemoveOutput.
+ * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
  */
-uint64_t TxRemoveOutput_hash(const struct LDKTxRemoveOutput *NONNULL_PTR o);
+struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
 
 /**
- * Checks if two TxRemoveOutputs contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
  */
-bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b);
+void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
 
 /**
- * Frees any resources used by the TxComplete, if is_owned is set and inner is non-NULL.
+ * The advertised features
  */
-void TxComplete_free(struct LDKTxComplete this_obj);
+struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * The channel ID
+ * The advertised features
  */
-struct LDKChannelId TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr);
+void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
 
 /**
- * The channel ID
+ * A strictly monotonic announcement counter, with gaps allowed
  */
-void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKChannelId val);
+uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new TxComplete given each field
+ * A strictly monotonic announcement counter, with gaps allowed
  */
-MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKChannelId channel_id_arg);
+void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Creates a copy of the TxComplete
+ * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
+ * to this node).
  */
-struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig);
+struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the TxComplete.
+ * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
+ * to this node).
  */
-uint64_t TxComplete_hash(const struct LDKTxComplete *NONNULL_PTR o);
+void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
 
 /**
- * Checks if two TxCompletes contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * An RGB color for UI purposes
  */
-bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b);
+const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
 
 /**
- * Frees any resources used by the TxSignatures, if is_owned is set and inner is non-NULL.
+ * An RGB color for UI purposes
  */
-void TxSignatures_free(struct LDKTxSignatures this_obj);
+void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
 
 /**
- * The channel ID
+ * An alias, for UI purposes.
+ *
+ * This should be sanitized before use. There is no guarantee of uniqueness.
  */
-struct LDKChannelId TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
+struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * The channel ID
+ * An alias, for UI purposes.
+ *
+ * This should be sanitized before use. There is no guarantee of uniqueness.
  */
-void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
+void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
 
 /**
- * The TXID
+ * List of addresses on which this node is reachable
+ *
+ * Returns a copy of the field.
  */
-const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
+struct LDKCVec_SocketAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * The TXID
+ * List of addresses on which this node is reachable
  */
-void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val);
 
 /**
- * The list of witnesses
+ * Excess address data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
  *
  * Returns a copy of the field.
  */
-struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_address_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * The list of witnesses
+ * Excess address data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
  */
-void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val);
+void UnsignedNodeAnnouncement_set_excess_address_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
 
 /**
- * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
+ * Excess data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
+ *
+ * Returns a copy of the field.
  */
-struct LDKCOption_ECDSASignatureZ TxSignatures_get_funding_outpoint_sig(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
+ * Excess data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
  */
-void TxSignatures_set_funding_outpoint_sig(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCOption_ECDSASignatureZ val);
+void UnsignedNodeAnnouncement_set_excess_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
 
 /**
- * Constructs a new TxSignatures given each field
+ * Constructs a new UnsignedNodeAnnouncement given each field
  */
-MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg, struct LDKCOption_ECDSASignatureZ funding_outpoint_sig_arg);
+MUST_USE_RES struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_new(struct LDKNodeFeatures features_arg, uint32_t timestamp_arg, struct LDKNodeId node_id_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKCVec_SocketAddressZ addresses_arg, struct LDKCVec_u8Z excess_address_data_arg, struct LDKCVec_u8Z excess_data_arg);
 
 /**
- * Creates a copy of the TxSignatures
+ * Creates a copy of the UnsignedNodeAnnouncement
  */
-struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig);
+struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the TxSignatures.
+ * Generates a non-cryptographic 64-bit hash of the UnsignedNodeAnnouncement.
  */
-uint64_t TxSignatures_hash(const struct LDKTxSignatures *NONNULL_PTR o);
+uint64_t UnsignedNodeAnnouncement_hash(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR o);
 
 /**
- * Checks if two TxSignaturess contain equal inner contents.
+ * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
  * Two objects with NULL inner values will be considered "equal" here.
  */
-bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b);
-
-/**
- * Frees any resources used by the TxInitRbf, if is_owned is set and inner is non-NULL.
- */
-void TxInitRbf_free(struct LDKTxInitRbf this_obj);
+bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
 
 /**
- * The channel ID
+ * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
  */
-struct LDKChannelId TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
+void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
 
 /**
- * The channel ID
+ * The signature by the node key
  */
-void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
+struct LDKECDSASignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * The locktime of the transaction
+ * The signature by the node key
  */
-uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
+void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
 
 /**
- * The locktime of the transaction
+ * The actual content of the announcement
  */
-void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * The feerate of the transaction
+ * The actual content of the announcement
  */
-uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
+void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
 
 /**
- * The feerate of the transaction
+ * Constructs a new NodeAnnouncement given each field
  */
-void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
+MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
 
 /**
- * The number of satoshis the sender will contribute to or, if negative, remove from
- * (e.g. splice-out) the funding output of the transaction
+ * Creates a copy of the NodeAnnouncement
  */
-struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
+struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
 
 /**
- * The number of satoshis the sender will contribute to or, if negative, remove from
- * (e.g. splice-out) the funding output of the transaction
+ * Generates a non-cryptographic 64-bit hash of the NodeAnnouncement.
  */
-void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
+uint64_t NodeAnnouncement_hash(const struct LDKNodeAnnouncement *NONNULL_PTR o);
 
 /**
- * Constructs a new TxInitRbf given each field
+ * Checks if two NodeAnnouncements contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-MUST_USE_RES struct LDKTxInitRbf TxInitRbf_new(struct LDKChannelId channel_id_arg, uint32_t locktime_arg, uint32_t feerate_sat_per_1000_weight_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
+bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
 
 /**
- * Creates a copy of the TxInitRbf
+ * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
  */
-struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig);
+void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the TxInitRbf.
+ * The advertised channel features
  */
-uint64_t TxInitRbf_hash(const struct LDKTxInitRbf *NONNULL_PTR o);
+struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two TxInitRbfs contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The advertised channel features
  */
-bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b);
+void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
 
 /**
- * Frees any resources used by the TxAckRbf, if is_owned is set and inner is non-NULL.
+ * The genesis hash of the blockchain where the channel is to be opened
  */
-void TxAckRbf_free(struct LDKTxAckRbf this_obj);
+const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
 
 /**
- * The channel ID
+ * The genesis hash of the blockchain where the channel is to be opened
  */
-struct LDKChannelId TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
+void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * The channel ID
+ * The short channel ID
  */
-void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
+uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * The number of satoshis the sender will contribute to or, if negative, remove from
- * (e.g. splice-out) the funding output of the transaction
+ * The short channel ID
  */
-struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
+void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The number of satoshis the sender will contribute to or, if negative, remove from
- * (e.g. splice-out) the funding output of the transaction
+ * One of the two `node_id`s which are endpoints of this channel
  */
-void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
+struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new TxAckRbf given each field
+ * One of the two `node_id`s which are endpoints of this channel
  */
-MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKChannelId channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
+void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
 
 /**
- * Creates a copy of the TxAckRbf
+ * The other of the two `node_id`s which are endpoints of this channel
  */
-struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig);
+struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the TxAckRbf.
+ * The other of the two `node_id`s which are endpoints of this channel
  */
-uint64_t TxAckRbf_hash(const struct LDKTxAckRbf *NONNULL_PTR o);
+void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
 
 /**
- * Checks if two TxAckRbfs contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The funding key for the first node
  */
-bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b);
+struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the TxAbort, if is_owned is set and inner is non-NULL.
+ * The funding key for the first node
  */
-void TxAbort_free(struct LDKTxAbort this_obj);
+void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
 
 /**
- * The channel ID
+ * The funding key for the second node
  */
-struct LDKChannelId TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr);
+struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * The channel ID
+ * The funding key for the second node
  */
-void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKChannelId val);
+void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
 
 /**
- * Message data
+ * Excess data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
  *
  * Returns a copy of the field.
  */
-struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z UnsignedChannelAnnouncement_get_excess_data(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * Message data
+ * Excess data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
  */
-void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+void UnsignedChannelAnnouncement_set_excess_data(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
 
 /**
- * Constructs a new TxAbort given each field
+ * Constructs a new UnsignedChannelAnnouncement given each field
  */
-MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z data_arg);
+MUST_USE_RES struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_new(struct LDKChannelFeatures features_arg, struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, struct LDKNodeId node_id_1_arg, struct LDKNodeId node_id_2_arg, struct LDKNodeId bitcoin_key_1_arg, struct LDKNodeId bitcoin_key_2_arg, struct LDKCVec_u8Z excess_data_arg);
 
 /**
- * Creates a copy of the TxAbort
+ * Creates a copy of the UnsignedChannelAnnouncement
  */
-struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig);
+struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the TxAbort.
+ * Generates a non-cryptographic 64-bit hash of the UnsignedChannelAnnouncement.
  */
-uint64_t TxAbort_hash(const struct LDKTxAbort *NONNULL_PTR o);
+uint64_t UnsignedChannelAnnouncement_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR o);
 
 /**
- * Checks if two TxAborts contain equal inner contents.
+ * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
  * Two objects with NULL inner values will be considered "equal" here.
  */
-bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b);
-
-/**
- * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
- */
-void Shutdown_free(struct LDKShutdown this_obj);
+bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
 
 /**
- * The channel ID
+ * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
  */
-struct LDKChannelId Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr);
+void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
 
 /**
- * The channel ID
+ * Authentication of the announcement by the first public node
  */
-void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKChannelId val);
+struct LDKECDSASignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * The destination of this peer's funds on closing.
- *
- * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
+ * Authentication of the announcement by the first public node
  */
-struct LDKCVec_u8Z Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
+void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
 
 /**
- * The destination of this peer's funds on closing.
- *
- * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
+ * Authentication of the announcement by the second public node
  */
-void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+struct LDKECDSASignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new Shutdown given each field
+ * Authentication of the announcement by the second public node
  */
-MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
+void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
 
 /**
- * Creates a copy of the Shutdown
+ * Proof of funding UTXO ownership by the first public node
  */
-struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
+struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Shutdown.
+ * Proof of funding UTXO ownership by the first public node
  */
-uint64_t Shutdown_hash(const struct LDKShutdown *NONNULL_PTR o);
+void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
 
 /**
- * Checks if two Shutdowns contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Proof of funding UTXO ownership by the second public node
  */
-bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
+struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
+ * Proof of funding UTXO ownership by the second public node
  */
-void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
+void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
 
 /**
- * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
- * transaction.
+ * The actual announcement
  */
-uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
+struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
 
 /**
- * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
- * transaction.
+ * The actual announcement
  */
-void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
+void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
 
 /**
- * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
- * transaction.
+ * Constructs a new ChannelAnnouncement given each field
  */
-uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKECDSASignature node_signature_1_arg, struct LDKECDSASignature node_signature_2_arg, struct LDKECDSASignature bitcoin_signature_1_arg, struct LDKECDSASignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg);
 
 /**
- * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
- * transaction.
+ * Creates a copy of the ChannelAnnouncement
  */
-void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
 
 /**
- * Constructs a new ClosingSignedFeeRange given each field
+ * Generates a non-cryptographic 64-bit hash of the ChannelAnnouncement.
  */
-MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
+uint64_t ChannelAnnouncement_hash(const struct LDKChannelAnnouncement *NONNULL_PTR o);
 
 /**
- * Creates a copy of the ClosingSignedFeeRange
+ * Checks if two ChannelAnnouncements contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
+bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ClosingSignedFeeRange.
+ * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
  */
-uint64_t ClosingSignedFeeRange_hash(const struct LDKClosingSignedFeeRange *NONNULL_PTR o);
+void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
 
 /**
- * Checks if two ClosingSignedFeeRanges contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The genesis hash of the blockchain where the channel is to be opened
  */
-bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
+const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
 
 /**
- * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
+ * The genesis hash of the blockchain where the channel is to be opened
  */
-void ClosingSigned_free(struct LDKClosingSigned this_obj);
+void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * The channel ID
+ * The short channel ID
  */
-struct LDKChannelId ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
+uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
 
 /**
- * The channel ID
+ * The short channel ID
  */
-void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
+void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The proposed total fee for the closing transaction
+ * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
  */
-uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
+uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
 
 /**
- * The proposed total fee for the closing transaction
+ * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
  */
-void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
+void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * A signature on the closing transaction
+ * Flags pertaining to this message.
  */
-struct LDKECDSASignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
+uint8_t UnsignedChannelUpdate_get_message_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
 
 /**
- * A signature on the closing transaction
+ * Flags pertaining to this message.
  */
-void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+void UnsignedChannelUpdate_set_message_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t 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
+ * Flags pertaining to the channel, including to which direction in the channel this update
+ * applies and whether the direction is currently able to forward HTLCs.
  */
-struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
+uint8_t UnsignedChannelUpdate_get_channel_flags(const struct LDKUnsignedChannelUpdate *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
+ * Flags pertaining to the channel, including to which direction in the channel this update
+ * applies and whether the direction is currently able to forward HTLCs.
  */
-void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
+void UnsignedChannelUpdate_set_channel_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
 
 /**
- * Constructs a new ClosingSigned given each field
- *
- * Note that fee_range_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The number of blocks such that if:
+ * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
+ * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
+ * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
+ * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
+ * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
+ * forwarding. Note that the HTLC sender is the one who originally sets this value when
+ * constructing the route.
  */
-MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKChannelId channel_id_arg, uint64_t fee_satoshis_arg, struct LDKECDSASignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg);
+uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the ClosingSigned
+ * The number of blocks such that if:
+ * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
+ * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
+ * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
+ * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
+ * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
+ * forwarding. Note that the HTLC sender is the one who originally sets this value when
+ * constructing the route.
  */
-struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
+void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ClosingSigned.
+ * The minimum HTLC size incoming to sender, in milli-satoshi
  */
-uint64_t ClosingSigned_hash(const struct LDKClosingSigned *NONNULL_PTR o);
+uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two ClosingSigneds contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The minimum HTLC size incoming to sender, in milli-satoshi
  */
-bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
+void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
+ * The maximum HTLC value incoming to sender, in milli-satoshi.
+ *
+ * This used to be optional.
  */
-void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
+uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
 
 /**
- * The channel ID
+ * The maximum HTLC value incoming to sender, in milli-satoshi.
+ *
+ * This used to be optional.
  */
-struct LDKChannelId UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
+void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The channel ID
+ * The base HTLC fee charged by sender, in milli-satoshi
  */
-void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
+uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
 
 /**
- * The HTLC ID
+ * The base HTLC fee charged by sender, in milli-satoshi
  */
-uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
+void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * The HTLC ID
+ * The amount to fee multiplier, in micro-satoshi
  */
-void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
+uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
 
 /**
- * The HTLC value in milli-satoshi
+ * The amount to fee multiplier, in micro-satoshi
  */
-uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
+void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * The HTLC value in milli-satoshi
+ * Excess data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
+ *
+ * Returns a copy of the field.
  */
-void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
 
 /**
- * The payment hash, the pre-image of which controls HTLC redemption
+ * Excess data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
  */
-const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
+void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
 
 /**
- * The payment hash, the pre-image of which controls HTLC redemption
+ * Constructs a new UnsignedChannelUpdate given each field
  */
-void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+MUST_USE_RES struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_new(struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, uint32_t timestamp_arg, uint8_t message_flags_arg, uint8_t channel_flags_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, struct LDKCVec_u8Z excess_data_arg);
 
 /**
- * The expiry height of the HTLC
+ * Creates a copy of the UnsignedChannelUpdate
  */
-uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
+struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
 
 /**
- * The expiry height of the HTLC
+ * Generates a non-cryptographic 64-bit hash of the UnsignedChannelUpdate.
  */
-void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
+uint64_t UnsignedChannelUpdate_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR o);
 
 /**
- * The extra fee skimmed by the sender of this message. See
- * [`ChannelConfig::accept_underpaying_htlcs`].
- *
- * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
+ * Checks if two UnsignedChannelUpdates contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
+bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
 
 /**
- * The extra fee skimmed by the sender of this message. See
- * [`ChannelConfig::accept_underpaying_htlcs`].
- *
- * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
+ * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
  */
-void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
 
 /**
- * The onion routing packet with encrypted data for the next hop.
+ * A signature of the channel update
  */
-struct LDKOnionPacket UpdateAddHTLC_get_onion_routing_packet(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
+struct LDKECDSASignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
 
 /**
- * The onion routing packet with encrypted data for the next hop.
+ * A signature of the channel update
  */
-void UpdateAddHTLC_set_onion_routing_packet(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKOnionPacket val);
+void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
 
 /**
- * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
- * routing packet and the recipient-provided encrypted payload within.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The actual channel update
  */
-struct LDKPublicKey UpdateAddHTLC_get_blinding_point(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
+struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
 
 /**
- * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
- * routing packet and the recipient-provided encrypted payload within.
- *
- * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The actual channel update
  */
-void UpdateAddHTLC_set_blinding_point(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
 
 /**
- * Constructs a new UpdateAddHTLC given each field
- *
- * Note that blinding_point_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Constructs a new ChannelUpdate given each field
  */
-MUST_USE_RES struct LDKUpdateAddHTLC UpdateAddHTLC_new(struct LDKChannelId channel_id_arg, uint64_t htlc_id_arg, uint64_t amount_msat_arg, struct LDKThirtyTwoBytes payment_hash_arg, uint32_t cltv_expiry_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg, struct LDKOnionPacket onion_routing_packet_arg, struct LDKPublicKey blinding_point_arg);
+MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
 
 /**
- * Creates a copy of the UpdateAddHTLC
+ * Creates a copy of the ChannelUpdate
  */
-struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
+struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the UpdateAddHTLC.
+ * Generates a non-cryptographic 64-bit hash of the ChannelUpdate.
  */
-uint64_t UpdateAddHTLC_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR o);
+uint64_t ChannelUpdate_hash(const struct LDKChannelUpdate *NONNULL_PTR o);
 
 /**
- * Checks if two UpdateAddHTLCs contain equal inner contents.
+ * Checks if two ChannelUpdates contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
  * Two objects with NULL inner values will be considered "equal" here.
  */
-bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
+bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
  */
-void OnionMessage_free(struct LDKOnionMessage this_obj);
+void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
 
 /**
- * Used in decrypting the onion packet's payload.
+ * The genesis hash of the blockchain being queried
  */
-struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
+const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
 
 /**
- * Used in decrypting the onion packet's payload.
+ * The genesis hash of the blockchain being queried
  */
-void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * The full onion packet including hop data, pubkey, and hmac
+ * The height of the first block for the channel UTXOs being queried
  */
-struct LDKPacket OnionMessage_get_onion_routing_packet(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
+uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
 
 /**
- * The full onion packet including hop data, pubkey, and hmac
+ * The height of the first block for the channel UTXOs being queried
  */
-void OnionMessage_set_onion_routing_packet(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPacket val);
+void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Constructs a new OnionMessage given each field
+ * The number of blocks to include in the query results
  */
-MUST_USE_RES struct LDKOnionMessage OnionMessage_new(struct LDKPublicKey blinding_point_arg, struct LDKPacket onion_routing_packet_arg);
+uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the OnionMessage
+ * The number of blocks to include in the query results
  */
-struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
+void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the OnionMessage.
+ * Constructs a new QueryChannelRange given each field
  */
-uint64_t OnionMessage_hash(const struct LDKOnionMessage *NONNULL_PTR o);
+MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
 
 /**
- * Checks if two OnionMessages contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Creates a copy of the QueryChannelRange
  */
-bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
+struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
+ * Generates a non-cryptographic 64-bit hash of the QueryChannelRange.
  */
-void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
+uint64_t QueryChannelRange_hash(const struct LDKQueryChannelRange *NONNULL_PTR o);
 
 /**
- * The channel ID
+ * Checks if two QueryChannelRanges contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-struct LDKChannelId UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
+bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
 
 /**
- * The channel ID
+ * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
  */
-void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
+void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
 
 /**
- * The HTLC ID
+ * The genesis hash of the blockchain being queried
  */
-uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
+const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
 
 /**
- * The HTLC ID
+ * The genesis hash of the blockchain being queried
  */
-void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
+void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * The pre-image of the payment hash, allowing HTLC redemption
+ * The height of the first block in the range of the reply
  */
-const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
+uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
 
 /**
- * The pre-image of the payment hash, allowing HTLC redemption
+ * The height of the first block in the range of the reply
  */
-void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Constructs a new UpdateFulfillHTLC given each field
+ * The number of blocks included in the range of the reply
  */
-MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKChannelId channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
+uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the UpdateFulfillHTLC
+ * The number of blocks included in the range of the reply
  */
-struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
+void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the UpdateFulfillHTLC.
+ * True when this is the final reply for a query
  */
-uint64_t UpdateFulfillHTLC_hash(const struct LDKUpdateFulfillHTLC *NONNULL_PTR o);
+bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two UpdateFulfillHTLCs contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * True when this is the final reply for a query
  */
-bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
+void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
 
 /**
- * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
+ * The `short_channel_id`s in the channel range
+ *
+ * Returns a copy of the field.
  */
-void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
+struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
 
 /**
- * The channel ID
+ * The `short_channel_id`s in the channel range
  */
-struct LDKChannelId UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
+void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
 
 /**
- * The channel ID
+ * Constructs a new ReplyChannelRange given each field
  */
-void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
+MUST_USE_RES struct LDKReplyChannelRange ReplyChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg, bool sync_complete_arg, struct LDKCVec_u64Z short_channel_ids_arg);
 
 /**
- * The HTLC ID
+ * Creates a copy of the ReplyChannelRange
  */
-uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
+struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
 
 /**
- * The HTLC ID
+ * Generates a non-cryptographic 64-bit hash of the ReplyChannelRange.
  */
-void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
+uint64_t ReplyChannelRange_hash(const struct LDKReplyChannelRange *NONNULL_PTR o);
 
 /**
- * Creates a copy of the UpdateFailHTLC
+ * Checks if two ReplyChannelRanges contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
+bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the UpdateFailHTLC.
+ * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
  */
-uint64_t UpdateFailHTLC_hash(const struct LDKUpdateFailHTLC *NONNULL_PTR o);
+void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
 
 /**
- * Checks if two UpdateFailHTLCs contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The genesis hash of the blockchain being queried
  */
-bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
+const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
 
 /**
- * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
+ * The genesis hash of the blockchain being queried
  */
-void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
+void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * The channel ID
+ * The short_channel_ids that are being queried
+ *
+ * Returns a copy of the field.
  */
-struct LDKChannelId UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
+struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
 
 /**
- * The channel ID
+ * The short_channel_ids that are being queried
  */
-void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
+void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
 
 /**
- * The HTLC ID
+ * Constructs a new QueryShortChannelIds given each field
  */
-uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
 
 /**
- * The HTLC ID
+ * Creates a copy of the QueryShortChannelIds
  */
-void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
 
 /**
- * The failure code
+ * Generates a non-cryptographic 64-bit hash of the QueryShortChannelIds.
  */
-uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
+uint64_t QueryShortChannelIds_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR o);
 
 /**
- * The failure code
+ * Checks if two QueryShortChannelIdss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
+bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
 
 /**
- * Creates a copy of the UpdateFailMalformedHTLC
+ * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
  */
-struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
+void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the UpdateFailMalformedHTLC.
+ * The genesis hash of the blockchain that was queried
  */
-uint64_t UpdateFailMalformedHTLC_hash(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR o);
+const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
 
 /**
- * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The genesis hash of the blockchain that was queried
  */
-bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
+void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
+ * Indicates if the query recipient maintains up-to-date channel
+ * information for the `chain_hash`
  */
-void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
+bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
 
 /**
- * The channel ID
+ * Indicates if the query recipient maintains up-to-date channel
+ * information for the `chain_hash`
  */
-struct LDKChannelId CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
+void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
 
 /**
- * The channel ID
+ * Constructs a new ReplyShortChannelIdsEnd given each field
  */
-void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
+MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
 
 /**
- * A signature on the commitment transaction
+ * Creates a copy of the ReplyShortChannelIdsEnd
  */
-struct LDKECDSASignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
+struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
 
 /**
- * A signature on the commitment transaction
+ * Generates a non-cryptographic 64-bit hash of the ReplyShortChannelIdsEnd.
  */
-void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+uint64_t ReplyShortChannelIdsEnd_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR o);
 
 /**
- * Signatures on the HTLC transactions
- *
- * Returns a copy of the field.
+ * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-struct LDKCVec_ECDSASignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
+bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
 
 /**
- * Signatures on the HTLC transactions
+ * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
  */
-void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
+void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
 
 /**
- * Constructs a new CommitmentSigned given each field
+ * The genesis hash of the blockchain for channel and node information
  */
-MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg);
+const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
 
 /**
- * Creates a copy of the CommitmentSigned
+ * The genesis hash of the blockchain for channel and node information
  */
-struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
+void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the CommitmentSigned.
+ * The starting unix timestamp
  */
-uint64_t CommitmentSigned_hash(const struct LDKCommitmentSigned *NONNULL_PTR o);
+uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two CommitmentSigneds contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The starting unix timestamp
  */
-bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
+void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
+ * The range of information in seconds
  */
-void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
+uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
 
 /**
- * The channel ID
+ * The range of information in seconds
  */
-struct LDKChannelId RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
+void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * The channel ID
+ * Constructs a new GossipTimestampFilter given each field
  */
-void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKChannelId val);
+MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
 
 /**
- * The secret corresponding to the per-commitment point
+ * Creates a copy of the GossipTimestampFilter
  */
-const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
+struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
 
 /**
- * The secret corresponding to the per-commitment point
+ * Generates a non-cryptographic 64-bit hash of the GossipTimestampFilter.
  */
-void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+uint64_t GossipTimestampFilter_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR o);
 
 /**
- * The next sender-broadcast commitment transaction's per-commitment point
+ * Checks if two GossipTimestampFilters contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
+bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
 
 /**
- * The next sender-broadcast commitment transaction's per-commitment point
+ * Frees any resources used by the ErrorAction
  */
-void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void ErrorAction_free(struct LDKErrorAction this_ptr);
 
 /**
- * Constructs a new RevokeAndACK given each field
+ * Creates a copy of the ErrorAction
  */
-MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg);
+struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
 
 /**
- * Creates a copy of the RevokeAndACK
+ * Utility method to constructs a new DisconnectPeer-variant ErrorAction
  */
-struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
+struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the RevokeAndACK.
+ * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction
  */
-uint64_t RevokeAndACK_hash(const struct LDKRevokeAndACK *NONNULL_PTR o);
+struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg);
 
 /**
- * Checks if two RevokeAndACKs contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Utility method to constructs a new IgnoreError-variant ErrorAction
  */
-bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
+struct LDKErrorAction ErrorAction_ignore_error(void);
 
 /**
- * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
+ * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
  */
-void UpdateFee_free(struct LDKUpdateFee this_obj);
+struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
 
 /**
- * The channel ID
+ * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
  */
-struct LDKChannelId UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
+struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
 
 /**
- * The channel ID
+ * Utility method to constructs a new SendErrorMessage-variant ErrorAction
  */
-void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKChannelId val);
+struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
 
 /**
- * Fee rate per 1000-weight of the transaction
+ * Utility method to constructs a new SendWarningMessage-variant ErrorAction
  */
-uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
+struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
 
 /**
- * Fee rate per 1000-weight of the transaction
+ * Generates a non-cryptographic 64-bit hash of the ErrorAction.
  */
-void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
+uint64_t ErrorAction_hash(const struct LDKErrorAction *NONNULL_PTR o);
 
 /**
- * Constructs a new UpdateFee given each field
+ * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKChannelId channel_id_arg, uint32_t feerate_per_kw_arg);
+void LightningError_free(struct LDKLightningError this_obj);
 
 /**
- * Creates a copy of the UpdateFee
+ * A human-readable message describing the error
  */
-struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
+struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the UpdateFee.
+ * A human-readable message describing the error
  */
-uint64_t UpdateFee_hash(const struct LDKUpdateFee *NONNULL_PTR o);
+void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
 
 /**
- * Checks if two UpdateFees contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The action which should be taken against the offending peer.
  */
-bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
+struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
+ * The action which should be taken against the offending peer.
  */
-void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
+void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
 
 /**
- * The channel ID
+ * Constructs a new LightningError given each field
  */
-struct LDKChannelId ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
 
 /**
- * The channel ID
+ * Creates a copy of the LightningError
  */
-void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKChannelId val);
+struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
 
 /**
- * The next commitment number for the sender
+ * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
  */
-uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
+void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
 
 /**
- * The next commitment number for the sender
+ * `update_add_htlc` messages which should be sent
  */
-void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
 
 /**
- * The next commitment number for the recipient
+ * `update_add_htlc` messages which should be sent
  */
-uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
+void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
 
 /**
- * The next commitment number for the recipient
+ * `update_fulfill_htlc` messages which should be sent
  */
-void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
 
 /**
- * Proof that the sender knows the per-commitment secret of a specific commitment transaction
- * belonging to the recipient
+ * `update_fulfill_htlc` messages which should be sent
  */
-const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
+void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
 
 /**
- * Proof that the sender knows the per-commitment secret of a specific commitment transaction
- * belonging to the recipient
+ * `update_fail_htlc` messages which should be sent
  */
-void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
 
 /**
- * The sender's per-commitment point for their current commitment transaction
+ * `update_fail_htlc` messages which should be sent
  */
-struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
+void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
 
 /**
- * The sender's per-commitment point for their current commitment transaction
+ * `update_fail_malformed_htlc` messages which should be sent
  */
-void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
 
 /**
- * The next funding transaction ID
+ * `update_fail_malformed_htlc` messages which should be sent
  */
-struct LDKCOption_ThirtyTwoBytesZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
+void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
 
 /**
- * The next funding transaction ID
+ * 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
  */
-void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
+struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new ChannelReestablish given each field
+ * 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
  */
-MUST_USE_RES struct LDKChannelReestablish ChannelReestablish_new(struct LDKChannelId channel_id_arg, uint64_t next_local_commitment_number_arg, uint64_t next_remote_commitment_number_arg, struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg, struct LDKCOption_ThirtyTwoBytesZ next_funding_txid_arg);
+void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
 
 /**
- * Creates a copy of the ChannelReestablish
+ * A `commitment_signed` message which should be sent
  */
-struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
+struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ChannelReestablish.
+ * A `commitment_signed` message which should be sent
  */
-uint64_t ChannelReestablish_hash(const struct LDKChannelReestablish *NONNULL_PTR o);
+void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
 
 /**
- * Checks if two ChannelReestablishs contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Constructs a new CommitmentUpdate given each field
+ *
+ * Note that update_fee_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
+MUST_USE_RES struct LDKCommitmentUpdate CommitmentUpdate_new(struct LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg, struct LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg, struct LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg, struct LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg, struct LDKUpdateFee update_fee_arg, struct LDKCommitmentSigned commitment_signed_arg);
 
 /**
- * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the CommitmentUpdate
  */
-void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
+struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
 
 /**
- * The channel ID
+ * Generates a non-cryptographic 64-bit hash of the CommitmentUpdate.
  */
-struct LDKChannelId AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
+uint64_t CommitmentUpdate_hash(const struct LDKCommitmentUpdate *NONNULL_PTR o);
 
 /**
- * The channel ID
+ * Checks if two CommitmentUpdates contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
  */
-void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
+bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
 
 /**
- * The short channel ID
+ * Calls the free function if one is set
  */
-uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
+void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
 
 /**
- * The short channel ID
+ * Calls the free function if one is set
  */
-void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
+void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
 
 /**
- * A signature by the node key
+ * Calls the free function if one is set
  */
-struct LDKECDSASignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
+void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
 
 /**
- * A signature by the node key
+ * Frees any resources used by the FinalOnionHopData, if is_owned is set and inner is non-NULL.
  */
-void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+void FinalOnionHopData_free(struct LDKFinalOnionHopData this_obj);
 
 /**
- * A signature by the funding key
+ * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
+ * Because it is generated by the recipient and included in the invoice, it also provides
+ * proof to the recipient that the payment was sent by someone with the generated invoice.
  */
-struct LDKECDSASignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
+const uint8_t (*FinalOnionHopData_get_payment_secret(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr))[32];
 
 /**
- * A signature by the funding key
+ * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
+ * Because it is generated by the recipient and included in the invoice, it also provides
+ * proof to the recipient that the payment was sent by someone with the generated invoice.
  */
-void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+void FinalOnionHopData_set_payment_secret(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Constructs a new AnnouncementSignatures given each field
+ * The intended total amount that this payment is for.
+ *
+ * Message serialization may panic if this value is more than 21 million Bitcoin.
  */
-MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKChannelId channel_id_arg, uint64_t short_channel_id_arg, struct LDKECDSASignature node_signature_arg, struct LDKECDSASignature bitcoin_signature_arg);
+uint64_t FinalOnionHopData_get_total_msat(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the AnnouncementSignatures
+ * The intended total amount that this payment is for.
+ *
+ * Message serialization may panic if this value is more than 21 million Bitcoin.
  */
-struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
+void FinalOnionHopData_set_total_msat(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the AnnouncementSignatures.
+ * Constructs a new FinalOnionHopData given each field
  */
-uint64_t AnnouncementSignatures_hash(const struct LDKAnnouncementSignatures *NONNULL_PTR o);
+MUST_USE_RES struct LDKFinalOnionHopData FinalOnionHopData_new(struct LDKThirtyTwoBytes payment_secret_arg, uint64_t total_msat_arg);
 
 /**
- * Checks if two AnnouncementSignaturess contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Creates a copy of the FinalOnionHopData
  */
-bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
+struct LDKFinalOnionHopData FinalOnionHopData_clone(const struct LDKFinalOnionHopData *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the SocketAddress
+ * Frees any resources used by the OnionPacket, if is_owned is set and inner is non-NULL.
  */
-void SocketAddress_free(struct LDKSocketAddress this_ptr);
+void OnionPacket_free(struct LDKOnionPacket this_obj);
 
 /**
- * Creates a copy of the SocketAddress
+ * BOLT 4 version number.
  */
-struct LDKSocketAddress SocketAddress_clone(const struct LDKSocketAddress *NONNULL_PTR orig);
+uint8_t OnionPacket_get_version(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
 
 /**
- * Utility method to constructs a new TcpIpV4-variant SocketAddress
+ * BOLT 4 version number.
  */
-struct LDKSocketAddress SocketAddress_tcp_ip_v4(struct LDKFourBytes addr, uint16_t port);
+void OnionPacket_set_version(struct LDKOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
 
 /**
- * Utility method to constructs a new TcpIpV6-variant SocketAddress
+ * In order to ensure we always return an error on onion decode in compliance with [BOLT
+ * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
+ * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
+ * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
+ * like.
+ *
+ * Returns a copy of the field.
  */
-struct LDKSocketAddress SocketAddress_tcp_ip_v6(struct LDKSixteenBytes addr, uint16_t port);
+struct LDKCResult_PublicKeySecp256k1ErrorZ OnionPacket_get_public_key(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
 
 /**
- * Utility method to constructs a new OnionV2-variant SocketAddress
+ * In order to ensure we always return an error on onion decode in compliance with [BOLT
+ * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
+ * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
+ * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
+ * like.
  */
-struct LDKSocketAddress SocketAddress_onion_v2(struct LDKTwelveBytes a);
+void OnionPacket_set_public_key(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKCResult_PublicKeySecp256k1ErrorZ val);
 
 /**
- * Utility method to constructs a new OnionV3-variant SocketAddress
+ * HMAC to verify the integrity of hop_data.
  */
-struct LDKSocketAddress SocketAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
+const uint8_t (*OnionPacket_get_hmac(const struct LDKOnionPacket *NONNULL_PTR this_ptr))[32];
 
 /**
- * Utility method to constructs a new Hostname-variant SocketAddress
+ * HMAC to verify the integrity of hop_data.
  */
-struct LDKSocketAddress SocketAddress_hostname(struct LDKHostname hostname, uint16_t port);
+void OnionPacket_set_hmac(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the SocketAddress.
+ * Creates a copy of the OnionPacket
  */
-uint64_t SocketAddress_hash(const struct LDKSocketAddress *NONNULL_PTR o);
+struct LDKOnionPacket OnionPacket_clone(const struct LDKOnionPacket *NONNULL_PTR orig);
 
 /**
- * Checks if two SocketAddresss contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Generates a non-cryptographic 64-bit hash of the OnionPacket.
  */
-bool SocketAddress_eq(const struct LDKSocketAddress *NONNULL_PTR a, const struct LDKSocketAddress *NONNULL_PTR b);
+uint64_t OnionPacket_hash(const struct LDKOnionPacket *NONNULL_PTR o);
 
 /**
- * Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
+ * Checks if two OnionPackets 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 LDKCVec_u8Z SocketAddress_write(const struct LDKSocketAddress *NONNULL_PTR obj);
+bool OnionPacket_eq(const struct LDKOnionPacket *NONNULL_PTR a, const struct LDKOnionPacket *NONNULL_PTR b);
 
 /**
- * Read a SocketAddress from a byte array, created by SocketAddress_write
+ * Frees any resources used by the TrampolineOnionPacket, if is_owned is set and inner is non-NULL.
  */
-struct LDKCResult_SocketAddressDecodeErrorZ SocketAddress_read(struct LDKu8slice ser);
+void TrampolineOnionPacket_free(struct LDKTrampolineOnionPacket this_obj);
 
 /**
- * Creates a copy of the SocketAddressParseError
+ * Bolt 04 version number
  */
-enum LDKSocketAddressParseError SocketAddressParseError_clone(const enum LDKSocketAddressParseError *NONNULL_PTR orig);
+uint8_t TrampolineOnionPacket_get_version(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
 
 /**
- * Utility method to constructs a new SocketAddrParse-variant SocketAddressParseError
+ * Bolt 04 version number
  */
-enum LDKSocketAddressParseError SocketAddressParseError_socket_addr_parse(void);
+void TrampolineOnionPacket_set_version(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
 
 /**
- * Utility method to constructs a new InvalidInput-variant SocketAddressParseError
+ * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
  */
-enum LDKSocketAddressParseError SocketAddressParseError_invalid_input(void);
+struct LDKPublicKey TrampolineOnionPacket_get_public_key(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
 
 /**
- * Utility method to constructs a new InvalidPort-variant SocketAddressParseError
+ * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
  */
-enum LDKSocketAddressParseError SocketAddressParseError_invalid_port(void);
+void TrampolineOnionPacket_set_public_key(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Utility method to constructs a new InvalidOnionV3-variant SocketAddressParseError
+ * Encrypted payload for the next hop
+ *
+ * Returns a copy of the field.
  */
-enum LDKSocketAddressParseError SocketAddressParseError_invalid_onion_v3(void);
+struct LDKCVec_u8Z TrampolineOnionPacket_get_hop_data(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the SocketAddressParseError.
+ * Encrypted payload for the next hop
  */
-uint64_t SocketAddressParseError_hash(const enum LDKSocketAddressParseError *NONNULL_PTR o);
+void TrampolineOnionPacket_set_hop_data(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
 
 /**
- * Checks if two SocketAddressParseErrors contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * HMAC to verify the integrity of hop_data
  */
-bool SocketAddressParseError_eq(const enum LDKSocketAddressParseError *NONNULL_PTR a, const enum LDKSocketAddressParseError *NONNULL_PTR b);
+const uint8_t (*TrampolineOnionPacket_get_hmac(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr))[32];
 
 /**
- * Parses an OnionV3 host and port into a [`SocketAddress::OnionV3`].
- *
- * The host part must end with \".onion\".
+ * HMAC to verify the integrity of hop_data
  */
-struct LDKCResult_SocketAddressSocketAddressParseErrorZ parse_onion_address(struct LDKStr host, uint16_t port);
+void TrampolineOnionPacket_set_hmac(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Get the string representation of a SocketAddress object
+ * Constructs a new TrampolineOnionPacket given each field
  */
-struct LDKStr SocketAddress_to_str(const struct LDKSocketAddress *NONNULL_PTR o);
+MUST_USE_RES struct LDKTrampolineOnionPacket TrampolineOnionPacket_new(uint8_t version_arg, struct LDKPublicKey public_key_arg, struct LDKCVec_u8Z hop_data_arg, struct LDKThirtyTwoBytes hmac_arg);
 
 /**
- * Read a SocketAddress object from a string
+ * Creates a copy of the TrampolineOnionPacket
  */
-struct LDKCResult_SocketAddressSocketAddressParseErrorZ SocketAddress_from_str(struct LDKStr s);
+struct LDKTrampolineOnionPacket TrampolineOnionPacket_clone(const struct LDKTrampolineOnionPacket *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the UnsignedGossipMessage
+ * Generates a non-cryptographic 64-bit hash of the TrampolineOnionPacket.
  */
-void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
+uint64_t TrampolineOnionPacket_hash(const struct LDKTrampolineOnionPacket *NONNULL_PTR o);
 
 /**
- * Creates a copy of the UnsignedGossipMessage
+ * Checks if two TrampolineOnionPackets 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 LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
+bool TrampolineOnionPacket_eq(const struct LDKTrampolineOnionPacket *NONNULL_PTR a, const struct LDKTrampolineOnionPacket *NONNULL_PTR b);
 
 /**
- * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
+ * Serialize the TrampolineOnionPacket object into a byte array which can be read by TrampolineOnionPacket_read
  */
-struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
+struct LDKCVec_u8Z TrampolineOnionPacket_write(const struct LDKTrampolineOnionPacket *NONNULL_PTR obj);
 
 /**
- * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
+ * Get the string representation of a DecodeError object
  */
-struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
+struct LDKStr DecodeError_to_str(const struct LDKDecodeError *NONNULL_PTR o);
 
 /**
- * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
+ * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
  */
-struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
+struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
 
 /**
- * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
+ * Read a AcceptChannel from a byte array, created by AcceptChannel_write
  */
-struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
+struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
 
 /**
- * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
+ * Serialize the AcceptChannelV2 object into a byte array which can be read by AcceptChannelV2_read
  */
-void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
+struct LDKCVec_u8Z AcceptChannelV2_write(const struct LDKAcceptChannelV2 *NONNULL_PTR obj);
 
 /**
- * The advertised features
+ * Read a AcceptChannelV2 from a byte array, created by AcceptChannelV2_write
  */
-struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCResult_AcceptChannelV2DecodeErrorZ AcceptChannelV2_read(struct LDKu8slice ser);
 
 /**
- * The advertised features
+ * Serialize the Stfu object into a byte array which can be read by Stfu_read
  */
-void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
+struct LDKCVec_u8Z Stfu_write(const struct LDKStfu *NONNULL_PTR obj);
 
 /**
- * A strictly monotonic announcement counter, with gaps allowed
+ * Read a Stfu from a byte array, created by Stfu_write
  */
-uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCResult_StfuDecodeErrorZ Stfu_read(struct LDKu8slice ser);
 
 /**
- * A strictly monotonic announcement counter, with gaps allowed
+ * Serialize the SpliceInit object into a byte array which can be read by SpliceInit_read
  */
-void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKCVec_u8Z SpliceInit_write(const struct LDKSpliceInit *NONNULL_PTR obj);
 
 /**
- * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
- * to this node).
+ * Read a SpliceInit from a byte array, created by SpliceInit_write
  */
-struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCResult_SpliceInitDecodeErrorZ SpliceInit_read(struct LDKu8slice ser);
 
 /**
- * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
- * to this node).
+ * Serialize the SpliceAck object into a byte array which can be read by SpliceAck_read
  */
-void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
+struct LDKCVec_u8Z SpliceAck_write(const struct LDKSpliceAck *NONNULL_PTR obj);
 
 /**
- * An RGB color for UI purposes
+ * Read a SpliceAck from a byte array, created by SpliceAck_write
  */
-const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
+struct LDKCResult_SpliceAckDecodeErrorZ SpliceAck_read(struct LDKu8slice ser);
 
 /**
- * An RGB color for UI purposes
+ * Serialize the SpliceLocked object into a byte array which can be read by SpliceLocked_read
  */
-void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
+struct LDKCVec_u8Z SpliceLocked_write(const struct LDKSpliceLocked *NONNULL_PTR obj);
 
 /**
- * An alias, for UI purposes.
- *
- * This should be sanitized before use. There is no guarantee of uniqueness.
+ * Read a SpliceLocked from a byte array, created by SpliceLocked_write
  */
-struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCResult_SpliceLockedDecodeErrorZ SpliceLocked_read(struct LDKu8slice ser);
 
 /**
- * An alias, for UI purposes.
- *
- * This should be sanitized before use. There is no guarantee of uniqueness.
+ * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
  */
-void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
+struct LDKCVec_u8Z TxAddInput_write(const struct LDKTxAddInput *NONNULL_PTR obj);
 
 /**
- * List of addresses on which this node is reachable
- *
- * Returns a copy of the field.
+ * Read a TxAddInput from a byte array, created by TxAddInput_write
  */
-struct LDKCVec_SocketAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCResult_TxAddInputDecodeErrorZ TxAddInput_read(struct LDKu8slice ser);
 
 /**
- * List of addresses on which this node is reachable
+ * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read
  */
-void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val);
+struct LDKCVec_u8Z TxAddOutput_write(const struct LDKTxAddOutput *NONNULL_PTR obj);
 
 /**
- * Excess address data which was signed as a part of the message which we do not (yet) understand how
- * to decode.
- *
- * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
- *
- * Returns a copy of the field.
+ * Read a TxAddOutput from a byte array, created by TxAddOutput_write
  */
-struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_address_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCResult_TxAddOutputDecodeErrorZ TxAddOutput_read(struct LDKu8slice ser);
 
 /**
- * Excess address data which was signed as a part of the message which we do not (yet) understand how
- * to decode.
- *
- * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
+ * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
  */
-void UnsignedNodeAnnouncement_set_excess_address_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+struct LDKCVec_u8Z TxRemoveInput_write(const struct LDKTxRemoveInput *NONNULL_PTR obj);
 
 /**
- * Excess data which was signed as a part of the message which we do not (yet) understand how
- * to decode.
- *
- * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
- *
- * Returns a copy of the field.
+ * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
  */
-struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCResult_TxRemoveInputDecodeErrorZ TxRemoveInput_read(struct LDKu8slice ser);
 
 /**
- * Excess data which was signed as a part of the message which we do not (yet) understand how
- * to decode.
- *
- * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
+ * Serialize the TxRemoveOutput object into a byte array which can be read by TxRemoveOutput_read
  */
-void UnsignedNodeAnnouncement_set_excess_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+struct LDKCVec_u8Z TxRemoveOutput_write(const struct LDKTxRemoveOutput *NONNULL_PTR obj);
 
 /**
- * Constructs a new UnsignedNodeAnnouncement given each field
+ * Read a TxRemoveOutput from a byte array, created by TxRemoveOutput_write
  */
-MUST_USE_RES struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_new(struct LDKNodeFeatures features_arg, uint32_t timestamp_arg, struct LDKNodeId node_id_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKCVec_SocketAddressZ addresses_arg, struct LDKCVec_u8Z excess_address_data_arg, struct LDKCVec_u8Z excess_data_arg);
+struct LDKCResult_TxRemoveOutputDecodeErrorZ TxRemoveOutput_read(struct LDKu8slice ser);
 
 /**
- * Creates a copy of the UnsignedNodeAnnouncement
+ * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
  */
-struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
+struct LDKCVec_u8Z TxComplete_write(const struct LDKTxComplete *NONNULL_PTR obj);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the UnsignedNodeAnnouncement.
+ * Read a TxComplete from a byte array, created by TxComplete_write
  */
-uint64_t UnsignedNodeAnnouncement_hash(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR o);
+struct LDKCResult_TxCompleteDecodeErrorZ TxComplete_read(struct LDKu8slice ser);
 
 /**
- * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
  */
-bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
+struct LDKCVec_u8Z TxSignatures_write(const struct LDKTxSignatures *NONNULL_PTR obj);
 
 /**
- * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
+ * Read a TxSignatures from a byte array, created by TxSignatures_write
  */
-void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
+struct LDKCResult_TxSignaturesDecodeErrorZ TxSignatures_read(struct LDKu8slice ser);
 
 /**
- * The signature by the node key
+ * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
  */
-struct LDKECDSASignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z TxInitRbf_write(const struct LDKTxInitRbf *NONNULL_PTR obj);
 
 /**
- * The signature by the node key
+ * Read a TxInitRbf from a byte array, created by TxInitRbf_write
  */
-void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+struct LDKCResult_TxInitRbfDecodeErrorZ TxInitRbf_read(struct LDKu8slice ser);
 
 /**
- * The actual content of the announcement
+ * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
  */
-struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z TxAckRbf_write(const struct LDKTxAckRbf *NONNULL_PTR obj);
 
 /**
- * The actual content of the announcement
+ * Read a TxAckRbf from a byte array, created by TxAckRbf_write
  */
-void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
+struct LDKCResult_TxAckRbfDecodeErrorZ TxAckRbf_read(struct LDKu8slice ser);
 
 /**
- * Constructs a new NodeAnnouncement given each field
+ * Serialize the TxAbort object into a byte array which can be read by TxAbort_read
  */
-MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
+struct LDKCVec_u8Z TxAbort_write(const struct LDKTxAbort *NONNULL_PTR obj);
 
 /**
- * Creates a copy of the NodeAnnouncement
+ * Read a TxAbort from a byte array, created by TxAbort_write
  */
-struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
+struct LDKCResult_TxAbortDecodeErrorZ TxAbort_read(struct LDKu8slice ser);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the NodeAnnouncement.
+ * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
  */
-uint64_t NodeAnnouncement_hash(const struct LDKNodeAnnouncement *NONNULL_PTR o);
+struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
 
 /**
- * Checks if two NodeAnnouncements contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
  */
-bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
+struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
 
 /**
- * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
+ * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
  */
-void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
+struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
 
 /**
- * The advertised channel features
+ * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
  */
-struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
 
 /**
- * The advertised channel features
+ * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
  */
-void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
+struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
 
 /**
- * The genesis hash of the blockchain where the channel is to be opened
+ * Read a ClosingSigned from a byte array, created by ClosingSigned_write
  */
-const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
+struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
 
 /**
- * The genesis hash of the blockchain where the channel is to be opened
+ * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
  */
-void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
 
 /**
- * The short channel ID
+ * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
  */
-uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
 
 /**
- * The short channel ID
+ * Serialize the CommitmentSignedBatch object into a byte array which can be read by CommitmentSignedBatch_read
  */
-void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKCVec_u8Z CommitmentSignedBatch_write(const struct LDKCommitmentSignedBatch *NONNULL_PTR obj);
 
 /**
- * One of the two `node_id`s which are endpoints of this channel
+ * Read a CommitmentSignedBatch from a byte array, created by CommitmentSignedBatch_write
  */
-struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCResult_CommitmentSignedBatchDecodeErrorZ CommitmentSignedBatch_read(struct LDKu8slice ser);
 
 /**
- * One of the two `node_id`s which are endpoints of this channel
+ * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
  */
-void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
+struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
 
 /**
- * The other of the two `node_id`s which are endpoints of this channel
+ * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
  */
-struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
 
 /**
- * The other of the two `node_id`s which are endpoints of this channel
+ * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
  */
-void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
+struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
 
 /**
- * The funding key for the first node
+ * Read a FundingCreated from a byte array, created by FundingCreated_write
  */
-struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
 
 /**
- * The funding key for the first node
+ * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
  */
-void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
+struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
 
 /**
- * The funding key for the second node
+ * Read a FundingSigned from a byte array, created by FundingSigned_write
  */
-struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
 
 /**
- * The funding key for the second node
+ * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
  */
-void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
+struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
 
 /**
- * Excess data which was signed as a part of the message which we do not (yet) understand how
- * to decode.
- *
- * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
- *
- * Returns a copy of the field.
+ * Read a ChannelReady from a byte array, created by ChannelReady_write
  */
-struct LDKCVec_u8Z UnsignedChannelAnnouncement_get_excess_data(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
 
 /**
- * Excess data which was signed as a part of the message which we do not (yet) understand how
- * to decode.
- *
- * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
+ * Serialize the Init object into a byte array which can be read by Init_read
  */
-void UnsignedChannelAnnouncement_set_excess_data(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
 
 /**
- * Constructs a new UnsignedChannelAnnouncement given each field
+ * Read a Init from a byte array, created by Init_write
  */
-MUST_USE_RES struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_new(struct LDKChannelFeatures features_arg, struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, struct LDKNodeId node_id_1_arg, struct LDKNodeId node_id_2_arg, struct LDKNodeId bitcoin_key_1_arg, struct LDKNodeId bitcoin_key_2_arg, struct LDKCVec_u8Z excess_data_arg);
+struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
 
 /**
- * Creates a copy of the UnsignedChannelAnnouncement
+ * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
  */
-struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
+struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the UnsignedChannelAnnouncement.
+ * Read a OpenChannel from a byte array, created by OpenChannel_write
  */
-uint64_t UnsignedChannelAnnouncement_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR o);
+struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
 
 /**
- * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
  */
-bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
+struct LDKCVec_u8Z OpenChannelV2_write(const struct LDKOpenChannelV2 *NONNULL_PTR obj);
 
 /**
- * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
+ * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
  */
-void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
+struct LDKCResult_OpenChannelV2DecodeErrorZ OpenChannelV2_read(struct LDKu8slice ser);
 
 /**
- * Authentication of the announcement by the first public node
+ * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
  */
-struct LDKECDSASignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
 
 /**
- * Authentication of the announcement by the first public node
+ * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
  */
-void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
 
 /**
- * Authentication of the announcement by the second public node
+ * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
  */
-struct LDKECDSASignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
 
 /**
- * Authentication of the announcement by the second public node
+ * Read a Shutdown from a byte array, created by Shutdown_write
  */
-void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
 
 /**
- * Proof of funding UTXO ownership by the first public node
+ * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
  */
-struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
 
 /**
- * Proof of funding UTXO ownership by the first public node
+ * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
  */
-void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
 
 /**
- * Proof of funding UTXO ownership by the second public node
+ * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
  */
-struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
 
 /**
- * Proof of funding UTXO ownership by the second public node
+ * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
  */
-void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
 
 /**
- * The actual announcement
+ * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
  */
-struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
 
 /**
- * The actual announcement
+ * Read a UpdateFee from a byte array, created by UpdateFee_write
  */
-void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
+struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
 
 /**
- * Constructs a new ChannelAnnouncement given each field
+ * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
  */
-MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKECDSASignature node_signature_1_arg, struct LDKECDSASignature node_signature_2_arg, struct LDKECDSASignature bitcoin_signature_1_arg, struct LDKECDSASignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg);
+struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
 
 /**
- * Creates a copy of the ChannelAnnouncement
+ * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
  */
-struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
+struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ChannelAnnouncement.
+ * Serialize the OnionPacket object into a byte array which can be read by OnionPacket_read
  */
-uint64_t ChannelAnnouncement_hash(const struct LDKChannelAnnouncement *NONNULL_PTR o);
+struct LDKCVec_u8Z OnionPacket_write(const struct LDKOnionPacket *NONNULL_PTR obj);
 
 /**
- * Checks if two ChannelAnnouncements contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Read a OnionPacket from a byte array, created by OnionPacket_write
  */
-bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
+struct LDKCResult_OnionPacketDecodeErrorZ OnionPacket_read(struct LDKu8slice ser);
 
 /**
- * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
+ * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
  */
-void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
+struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
 
 /**
- * The genesis hash of the blockchain where the channel is to be opened
+ * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
  */
-const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
+struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
 
 /**
- * The genesis hash of the blockchain where the channel is to be opened
+ * Read a OnionMessage from a byte array, created by OnionMessage_write
  */
-void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
 
 /**
- * The short channel ID
+ * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
  */
-uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
 
 /**
- * The short channel ID
+ * Serialize the FinalOnionHopData object into a byte array which can be read by FinalOnionHopData_read
  */
-void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKCVec_u8Z FinalOnionHopData_write(const struct LDKFinalOnionHopData *NONNULL_PTR obj);
 
 /**
- * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
+ * Read a FinalOnionHopData from a byte array, created by FinalOnionHopData_write
  */
-uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+struct LDKCResult_FinalOnionHopDataDecodeErrorZ FinalOnionHopData_read(struct LDKu8slice ser);
 
 /**
- * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
+ * Serialize the Ping object into a byte array which can be read by Ping_read
  */
-void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
 
 /**
- * Channel flags
+ * Read a Ping from a byte array, created by Ping_write
  */
-uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
 
 /**
- * Channel flags
+ * Serialize the Pong object into a byte array which can be read by Pong_read
  */
-void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
+struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
 
 /**
- * The number of blocks such that if:
- * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
- * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
- * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
- * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
- * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
- * forwarding. Note that the HTLC sender is the one who originally sets this value when
- * constructing the route.
+ * Read a Pong from a byte array, created by Pong_write
  */
-uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
 
 /**
- * The number of blocks such that if:
- * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
- * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
- * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
- * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
- * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
- * forwarding. Note that the HTLC sender is the one who originally sets this value when
- * constructing the route.
+ * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
  */
-void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
+struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
 
 /**
- * The minimum HTLC size incoming to sender, in milli-satoshi
+ * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
  */
-uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
 
 /**
- * The minimum HTLC size incoming to sender, in milli-satoshi
+ * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
  */
-void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
 
 /**
- * The maximum HTLC value incoming to sender, in milli-satoshi.
- *
- * This used to be optional.
+ * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
  */
-uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
 
 /**
- * The maximum HTLC value incoming to sender, in milli-satoshi.
- *
- * This used to be optional.
+ * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
  */
-void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
 
 /**
- * The base HTLC fee charged by sender, in milli-satoshi
+ * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
  */
-uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
 
 /**
- * The base HTLC fee charged by sender, in milli-satoshi
+ * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
  */
-void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
 
 /**
- * The amount to fee multiplier, in micro-satoshi
+ * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
  */
-uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
 
 /**
- * The amount to fee multiplier, in micro-satoshi
+ * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
  */
-void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
 
 /**
- * Excess data which was signed as a part of the message which we do not (yet) understand how
- * to decode.
- *
- * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
- *
- * Returns a copy of the field.
+ * Read a ErrorMessage from a byte array, created by ErrorMessage_write
  */
-struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
 
 /**
- * Excess data which was signed as a part of the message which we do not (yet) understand how
- * to decode.
- *
- * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
+ * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
  */
-void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
 
 /**
- * Constructs a new UnsignedChannelUpdate given each field
+ * Read a WarningMessage from a byte array, created by WarningMessage_write
  */
-MUST_USE_RES struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_new(struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, uint32_t timestamp_arg, uint8_t flags_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, struct LDKCVec_u8Z excess_data_arg);
+struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
 
 /**
- * Creates a copy of the UnsignedChannelUpdate
+ * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
  */
-struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
+struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the UnsignedChannelUpdate.
+ * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
  */
-uint64_t UnsignedChannelUpdate_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR o);
+struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
 
 /**
- * Checks if two UnsignedChannelUpdates contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
  */
-bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
+struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
 
 /**
- * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
+ * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
  */
-void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
+struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
 
 /**
- * A signature of the channel update
+ * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
  */
-struct LDKECDSASignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
+struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
 
 /**
- * A signature of the channel update
+ * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
  */
-void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
 
 /**
- * The actual channel update
+ * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
  */
-struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
 
 /**
- * The actual channel update
+ * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
  */
-void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
+struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
 
 /**
- * Constructs a new ChannelUpdate given each field
+ * Calculates the overflow safe ending block height for the query.
+ *
+ * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
  */
-MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
+MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the ChannelUpdate
+ * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
  */
-struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
+struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ChannelUpdate.
+ * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
  */
-uint64_t ChannelUpdate_hash(const struct LDKChannelUpdate *NONNULL_PTR o);
+struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
 
 /**
- * Checks if two ChannelUpdates contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
  */
-bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
+struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
 
 /**
- * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
+ * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
  */
-void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
+struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
 
 /**
- * The genesis hash of the blockchain being queried
+ * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
  */
-const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
+struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
 
 /**
- * The genesis hash of the blockchain being queried
+ * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
  */
-void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
 
 /**
- * The height of the first block for the channel UTXOs being queried
+ * Calls the free function if one is set
  */
-uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
+void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
 
 /**
- * The height of the first block for the channel UTXOs being queried
+ * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
  */
-void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
+void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
 
 /**
- * The number of blocks to include in the query results
+ * Constructs a new IgnoringMessageHandler given each field
  */
-uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
 
 /**
- * The number of blocks to include in the query results
+ * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
  */
-void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new QueryChannelRange given each field
+ * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
  */
-MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
+struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the QueryChannelRange
+ * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
  */
-struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
+struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the QueryChannelRange.
+ * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
  */
-uint64_t QueryChannelRange_hash(const struct LDKQueryChannelRange *NONNULL_PTR o);
+struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
 
 /**
- * Checks if two QueryChannelRanges contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Constructs a new AsyncPaymentsMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned AsyncPaymentsMessageHandler must be freed before this_arg is
  */
-bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
+struct LDKAsyncPaymentsMessageHandler IgnoringMessageHandler_as_AsyncPaymentsMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
+ * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
  */
-void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
+struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
 
 /**
- * The genesis hash of the blockchain being queried
+ * 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
  */
-const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
+struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
 
 /**
- * The genesis hash of the blockchain being queried
+ * 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
  */
-void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
 
 /**
- * The height of the first block in the range of the reply
+ * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
  */
-uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
+void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
 
 /**
- * The height of the first block in the range of the reply
+ * Constructs a new ErroringMessageHandler
  */
-void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
+MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
 
 /**
- * The number of blocks included in the range of the reply
+ * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
  */
-uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
+struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
 
 /**
- * The number of blocks included in the range of the reply
+ * 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
  */
-void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
 
 /**
- * True when this is the final reply for a query
+ * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
  */
-bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
+void MessageHandler_free(struct LDKMessageHandler this_obj);
 
 /**
- * True when this is the final reply for a query
+ * A message handler which handles messages specific to channels. Usually this is just a
+ * [`ChannelManager`] object or an [`ErroringMessageHandler`].
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
  */
-void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
+const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
 
 /**
- * The `short_channel_id`s in the channel range
+ * A message handler which handles messages specific to channels. Usually this is just a
+ * [`ChannelManager`] object or an [`ErroringMessageHandler`].
  *
- * Returns a copy of the field.
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
  */
-struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
+void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
 
 /**
- * The `short_channel_id`s in the channel range
+ * A message handler which handles messages updating our knowledge of the network channel
+ * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
+ *
+ * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
  */
-void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
+const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new ReplyChannelRange given each field
+ * A message handler which handles messages updating our knowledge of the network channel
+ * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
+ *
+ * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
  */
-MUST_USE_RES struct LDKReplyChannelRange ReplyChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg, bool sync_complete_arg, struct LDKCVec_u64Z short_channel_ids_arg);
+void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
 
 /**
- * Creates a copy of the ReplyChannelRange
+ * A message handler which handles onion messages. This should generally be an
+ * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
+ *
+ * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
  */
-struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
+const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ReplyChannelRange.
+ * A message handler which handles onion messages. This should generally be an
+ * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
+ *
+ * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
  */
-uint64_t ReplyChannelRange_hash(const struct LDKReplyChannelRange *NONNULL_PTR o);
+void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
 
 /**
- * Checks if two ReplyChannelRanges contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * A message handler which handles custom messages. The only LDK-provided implementation is
+ * [`IgnoringMessageHandler`].
  */
-bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
+const struct LDKCustomMessageHandler *MessageHandler_get_custom_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
+ * A message handler which handles custom messages. The only LDK-provided implementation is
+ * [`IgnoringMessageHandler`].
  */
-void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
+void MessageHandler_set_custom_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKCustomMessageHandler val);
 
 /**
- * The genesis hash of the blockchain being queried
+ * Constructs a new MessageHandler given each field
  */
-const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
+MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg, struct LDKOnionMessageHandler onion_message_handler_arg, struct LDKCustomMessageHandler custom_message_handler_arg);
 
 /**
- * The genesis hash of the blockchain being queried
+ * Creates a copy of a SocketDescriptor
  */
-void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
 
 /**
- * The short_channel_ids that are being queried
- *
- * Returns a copy of the field.
+ * Calls the free function if one is set
  */
-struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
+void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
 
 /**
- * The short_channel_ids that are being queried
+ * Frees any resources used by the PeerDetails, if is_owned is set and inner is non-NULL.
  */
-void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
+void PeerDetails_free(struct LDKPeerDetails this_obj);
 
 /**
- * Constructs a new QueryShortChannelIds given each field
+ * The node id of the peer.
+ *
+ * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter
+ * passed in to [`PeerManager::new_outbound_connection`].
  */
-MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
+struct LDKPublicKey PeerDetails_get_counterparty_node_id(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the QueryShortChannelIds
+ * The node id of the peer.
+ *
+ * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter
+ * passed in to [`PeerManager::new_outbound_connection`].
  */
-struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
+void PeerDetails_set_counterparty_node_id(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the QueryShortChannelIds.
+ * The socket address the peer provided in the initial handshake.
+ *
+ * Will only be `Some` if an address had been previously provided to
+ * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`].
+ *
+ * Returns a copy of the field.
  */
-uint64_t QueryShortChannelIds_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR o);
+struct LDKCOption_SocketAddressZ PeerDetails_get_socket_address(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two QueryShortChannelIdss contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * The socket address the peer provided in the initial handshake.
+ *
+ * Will only be `Some` if an address had been previously provided to
+ * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`].
  */
-bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
+void PeerDetails_set_socket_address(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
 
 /**
- * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
+ * The features the peer provided in the initial handshake.
  */
-void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
+struct LDKInitFeatures PeerDetails_get_init_features(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
 
 /**
- * The genesis hash of the blockchain that was queried
+ * The features the peer provided in the initial handshake.
  */
-const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
+void PeerDetails_set_init_features(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
 
 /**
- * The genesis hash of the blockchain that was queried
+ * Indicates the direction of the peer connection.
+ *
+ * Will be `true` for inbound connections, and `false` for outbound connections.
  */
-void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+bool PeerDetails_get_is_inbound_connection(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
 
 /**
- * Indicates if the query recipient maintains up-to-date channel
- * information for the `chain_hash`
+ * Indicates the direction of the peer connection.
+ *
+ * Will be `true` for inbound connections, and `false` for outbound connections.
  */
-bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
+void PeerDetails_set_is_inbound_connection(struct LDKPeerDetails *NONNULL_PTR this_ptr, bool val);
 
 /**
- * Indicates if the query recipient maintains up-to-date channel
- * information for the `chain_hash`
+ * Constructs a new PeerDetails given each field
  */
-void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
+MUST_USE_RES struct LDKPeerDetails PeerDetails_new(struct LDKPublicKey counterparty_node_id_arg, struct LDKCOption_SocketAddressZ socket_address_arg, struct LDKInitFeatures init_features_arg, bool is_inbound_connection_arg);
 
 /**
- * Constructs a new ReplyShortChannelIdsEnd given each field
+ * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
+void PeerHandleError_free(struct LDKPeerHandleError this_obj);
 
 /**
- * Creates a copy of the ReplyShortChannelIdsEnd
+ * Constructs a new PeerHandleError given each field
  */
-struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
+MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ReplyShortChannelIdsEnd.
+ * Creates a copy of the PeerHandleError
  */
-uint64_t ReplyShortChannelIdsEnd_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR o);
+struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
 
 /**
- * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Get the string representation of a PeerHandleError object
  */
-bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
+struct LDKStr PeerHandleError_to_str(const struct LDKPeerHandleError *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
  */
-void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
+void PeerManager_free(struct LDKPeerManager this_obj);
 
 /**
- * The genesis hash of the blockchain for channel and node information
+ * Constructs a new `PeerManager` with the given message handlers.
+ *
+ * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
+ * cryptographically secure random bytes.
+ *
+ * `current_time` is used as an always-increasing counter that survives across restarts and is
+ * incremented irregularly internally. In general it is best to simply use the current UNIX
+ * timestamp, however if it is not available a persistent counter that increases once per
+ * minute should suffice.
  */
-const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
+MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, uint32_t current_time, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKNodeSigner node_signer);
 
 /**
- * The genesis hash of the blockchain for channel and node information
+ * Returns a list of [`PeerDetails`] for connected peers that have completed the initial
+ * handshake.
  */
-void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+MUST_USE_RES struct LDKCVec_PeerDetailsZ PeerManager_list_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
 
 /**
- * The starting unix timestamp
+ * Returns the [`PeerDetails`] of a connected peer that has completed the initial handshake.
+ *
+ * Will return `None` if the peer is unknown or it hasn't completed the initial handshake.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKPeerDetails PeerManager_peer_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id);
 
 /**
- * The starting unix timestamp
+ * Indicates a new outbound connection has been established to a node with the given `node_id`
+ * and an optional remote network address.
+ *
+ * The remote network address adds the option to report a remote IP address back to a connecting
+ * peer using the init message.
+ * The user should pass the remote network address of the host they are connected to.
+ *
+ * If an `Err` is returned here you must disconnect the connection immediately.
+ *
+ * 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 been
+ * [`socket_disconnected`].
+ *
+ * [`socket_disconnected`]: PeerManager::socket_disconnected
  */
-void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
+MUST_USE_RES struct LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKSocketDescriptor descriptor, struct LDKCOption_SocketAddressZ remote_network_address);
 
 /**
- * The range of information in seconds
+ * Indicates a new inbound connection has been established to a node with an optional remote
+ * network address.
+ *
+ * The remote network address adds the option to report a remote IP address back to a connecting
+ * peer using the init message.
+ * The user should pass the remote network address of the host they are connected to.
+ *
+ * May refuse the connection by returning an Err, but will never write bytes to the remote end
+ * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
+ * the connection immediately.
+ *
+ * Panics if descriptor is duplicative with some other descriptor which has not yet been
+ * [`socket_disconnected`].
+ *
+ * [`socket_disconnected`]: PeerManager::socket_disconnected
  */
-uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor, struct LDKCOption_SocketAddressZ remote_network_address);
 
 /**
- * The range of information in seconds
+ * Indicates that there is room to write data to the given socket descriptor.
+ *
+ * May return an Err to indicate that the connection should be closed.
+ *
+ * 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
  */
-void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
+MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
 
 /**
- * Constructs a new GossipTimestampFilter given each field
+ * Indicates that data was read from the given socket descriptor.
+ *
+ * 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 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 descriptor has `resume_read` set (preventing DoS issues in the
+ * send buffer).
+ *
+ * In order to avoid processing too many messages at once per peer, `data` should be on the
+ * order of 4KiB.
+ *
+ * [`send_data`]: SocketDescriptor::send_data
+ * [`process_events`]: PeerManager::process_events
  */
-MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
+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);
 
 /**
- * Creates a copy of the GossipTimestampFilter
+ * 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_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.
+ *
+ * Note that if there are any other calls to this function waiting on lock(s) this may return
+ * without doing any work. All available events that need handling will be handled before the
+ * other calls return.
+ *
+ * [`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
  */
-struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
+void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the GossipTimestampFilter.
+ * Indicates that the given socket descriptor's connection is now closed.
  */
-uint64_t GossipTimestampFilter_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR o);
+void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
 
 /**
- * Checks if two GossipTimestampFilters contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Disconnect a peer given its node id.
+ *
+ * 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
  */
-bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
+void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
 
 /**
- * Frees any resources used by the ErrorAction
+ * 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 ErrorAction_free(struct LDKErrorAction this_ptr);
+void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the ErrorAction
+ * 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 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
  */
-struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
+void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new DisconnectPeer-variant ErrorAction
+ * Generates a signed node_announcement from the given arguments, sending it to all connected
+ * peers. Note that peers will likely ignore this message unless we have at least one public
+ * channel which has at least six confirmations on-chain.
+ *
+ * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
+ * node to humans. They carry no in-protocol meaning.
+ *
+ * `addresses` represent the set (possibly empty) of socket addresses on which this node
+ * accepts incoming connections. These will be included in the node_announcement, publicly
+ * tying these addresses together and to this node. If you wish to preserve user privacy,
+ * addresses should likely contain only Tor Onion addresses.
+ *
+ * Panics if `addresses` is absurdly large (more than 100).
+ *
+ * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
  */
-struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
+void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_SocketAddressZ addresses);
 
 /**
- * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction
+ * Gets the weight for an HTLC-Success transaction.
  */
-struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg);
+uint64_t htlc_success_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
 
 /**
- * Utility method to constructs a new IgnoreError-variant ErrorAction
+ * Gets the weight for an HTLC-Timeout transaction.
  */
-struct LDKErrorAction ErrorAction_ignore_error(void);
+uint64_t htlc_timeout_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
 
 /**
- * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
+ * Creates a copy of the HTLCClaim
  */
-struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
+enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
 
 /**
- * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
+ * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
  */
-struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
+enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
 
 /**
- * Utility method to constructs a new SendErrorMessage-variant ErrorAction
+ * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
  */
-struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
+enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
 
 /**
- * Utility method to constructs a new SendWarningMessage-variant ErrorAction
+ * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
  */
-struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
+enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ErrorAction.
+ * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
  */
-uint64_t ErrorAction_hash(const struct LDKErrorAction *NONNULL_PTR o);
+enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
 
 /**
- * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
+ * Utility method to constructs a new Revocation-variant HTLCClaim
  */
-void LightningError_free(struct LDKLightningError this_obj);
+enum LDKHTLCClaim HTLCClaim_revocation(void);
 
 /**
- * A human-readable message describing the error
+ * Checks if two HTLCClaims contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
+bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
 
 /**
- * A human-readable message describing the error
+ * Check if a given input witness attempts to claim a HTLC.
  */
-void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
+MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
 
 /**
- * The action which should be taken against the offending peer.
+ * Build the commitment secret from the seed and the commitment number
  */
-struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
+struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
 
 /**
- * The action which should be taken against the offending peer.
+ * Build a closing transaction
  */
-void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
+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);
 
 /**
- * Constructs a new LightningError given each field
+ * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
+void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
 
 /**
- * Creates a copy of the LightningError
+ * Creates a copy of the CounterpartyCommitmentSecrets
  */
-struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
+struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
+ * Creates a new empty `CounterpartyCommitmentSecrets` structure.
  */
-void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
+MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
 
 /**
- * `update_add_htlc` messages which should be sent
+ * Returns the minimum index of all stored secrets. Note that indexes start
+ * at 1 << 48 and get decremented by one for each new secret.
  */
-struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
+MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
 
 /**
- * `update_add_htlc` messages which should be sent
+ * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
+ * was generated in accordance with BOLT 3 and is consistent with previous secrets.
  */
-void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
+MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
 
 /**
- * `update_fulfill_htlc` messages which should be sent
+ * Returns the secret at `idx`.
+ * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
 
 /**
- * `update_fulfill_htlc` messages which should be sent
+ * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
  */
-void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
+struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
 
 /**
- * `update_fail_htlc` messages which should be sent
+ * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
  */
-struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
+struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
 
 /**
- * `update_fail_htlc` messages which should be sent
+ * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
+ * from the base secret and the per_commitment_point.
  */
-void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
+struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
 
 /**
- * `update_fail_malformed_htlc` messages which should be sent
+ * Derives a per-commitment-transaction revocation key from its constituent parts.
+ *
+ * Only the cheating participant owns a valid witness to propagate a revoked
+ * commitment transaction, thus per_commitment_secret always come from cheater
+ * and revocation_base_secret always come from punisher, which is the broadcaster
+ * of the transaction spending with this key knowledge.
  */
-struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
+struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
 
 /**
- * `update_fail_malformed_htlc` messages which should be sent
+ * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
  */
-void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
+void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
 
 /**
- * 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
+ * The broadcaster's per-commitment public key which was used to derive the other keys.
  */
-struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
+struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *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
+ * The broadcaster's per-commitment public key which was used to derive the other keys.
  */
-void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
+void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * A `commitment_signed` message which should be sent
+ * The revocation key which is used to allow the broadcaster of the commitment
+ * transaction to provide their counterparty the ability to punish them if they broadcast
+ * an old state.
  */
-struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
+struct LDKRevocationKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
 
 /**
- * A `commitment_signed` message which should be sent
+ * The revocation key which is used to allow the broadcaster of the commitment
+ * transaction to provide their counterparty the ability to punish them if they broadcast
+ * an old state.
  */
-void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
+void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
 
 /**
- * Constructs a new CommitmentUpdate given each field
- *
- * Note that update_fee_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Broadcaster's HTLC Key
  */
-MUST_USE_RES struct LDKCommitmentUpdate CommitmentUpdate_new(struct LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg, struct LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg, struct LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg, struct LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg, struct LDKUpdateFee update_fee_arg, struct LDKCommitmentSigned commitment_signed_arg);
+struct LDKHtlcKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the CommitmentUpdate
+ * Broadcaster's HTLC Key
  */
-struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
+void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the CommitmentUpdate.
+ * Countersignatory's HTLC Key
  */
-uint64_t CommitmentUpdate_hash(const struct LDKCommitmentUpdate *NONNULL_PTR o);
+struct LDKHtlcKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two CommitmentUpdates contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
- * Two objects with NULL inner values will be considered "equal" here.
+ * Countersignatory's HTLC Key
  */
-bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
+void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
 
 /**
- * Calls the free function if one is set
+ * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
  */
-void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
+struct LDKDelayedPaymentKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
 
 /**
- * Calls the free function if one is set
+ * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
  */
-void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
+void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentKey val);
 
 /**
- * Calls the free function if one is set
+ * Constructs a new TxCreationKeys given each field
  */
-void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
+MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKRevocationKey revocation_key_arg, struct LDKHtlcKey broadcaster_htlc_key_arg, struct LDKHtlcKey countersignatory_htlc_key_arg, struct LDKDelayedPaymentKey broadcaster_delayed_payment_key_arg);
 
 /**
- * Frees any resources used by the FinalOnionHopData, if is_owned is set and inner is non-NULL.
+ * Checks if two TxCreationKeyss 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 FinalOnionHopData_free(struct LDKFinalOnionHopData this_obj);
+bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
 
 /**
- * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
- * Because it is generated by the recipient and included in the invoice, it also provides
- * proof to the recipient that the payment was sent by someone with the generated invoice.
+ * Creates a copy of the TxCreationKeys
  */
-const uint8_t (*FinalOnionHopData_get_payment_secret(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr))[32];
+struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
 
 /**
- * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
- * Because it is generated by the recipient and included in the invoice, it also provides
- * proof to the recipient that the payment was sent by someone with the generated invoice.
+ * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
  */
-void FinalOnionHopData_set_payment_secret(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
 
 /**
- * The intended total amount that this payment is for.
- *
- * Message serialization may panic if this value is more than 21 million Bitcoin.
+ * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
  */
-uint64_t FinalOnionHopData_get_total_msat(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr);
+struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
 
 /**
- * The intended total amount that this payment is for.
- *
- * Message serialization may panic if this value is more than 21 million Bitcoin.
+ * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
  */
-void FinalOnionHopData_set_total_msat(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, uint64_t val);
+void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
 
 /**
- * Constructs a new FinalOnionHopData given each field
+ * The public key which is used to sign all commitment transactions, as it appears in the
+ * on-chain channel lock-in 2-of-2 multisig output.
  */
-MUST_USE_RES struct LDKFinalOnionHopData FinalOnionHopData_new(struct LDKThirtyTwoBytes payment_secret_arg, uint64_t total_msat_arg);
+struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the FinalOnionHopData
+ * The public key which is used to sign all commitment transactions, as it appears in the
+ * on-chain channel lock-in 2-of-2 multisig output.
  */
-struct LDKFinalOnionHopData FinalOnionHopData_clone(const struct LDKFinalOnionHopData *NONNULL_PTR orig);
+void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Frees any resources used by the OnionPacket, if is_owned is set and inner is non-NULL.
+ * The base point which is used (with [`RevocationKey::from_basepoint`]) to derive per-commitment
+ * revocation keys. This is combined with the per-commitment-secret generated by the
+ * counterparty to create a secret which the counterparty can reveal to revoke previous
+ * states.
  */
-void OnionPacket_free(struct LDKOnionPacket this_obj);
+struct LDKRevocationBasepoint ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
 
 /**
- * BOLT 4 version number.
+ * The base point which is used (with [`RevocationKey::from_basepoint`]) to derive per-commitment
+ * revocation keys. This is combined with the per-commitment-secret generated by the
+ * counterparty to create a secret which the counterparty can reveal to revoke previous
+ * states.
  */
-uint8_t OnionPacket_get_version(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
+void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKRevocationBasepoint val);
 
 /**
- * BOLT 4 version number.
+ * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
+ * spendable primary channel balance on the broadcaster's commitment transaction. This key is
+ * static across every commitment transaction.
  */
-void OnionPacket_set_version(struct LDKOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
+struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
 
 /**
- * In order to ensure we always return an error on onion decode in compliance with [BOLT
- * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
- * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
- * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
- * like.
- *
- * Returns a copy of the field.
+ * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
+ * spendable primary channel balance on the broadcaster's commitment transaction. This key is
+ * static across every commitment transaction.
  */
-struct LDKCResult_PublicKeySecp256k1ErrorZ OnionPacket_get_public_key(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
+void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * In order to ensure we always return an error on onion decode in compliance with [BOLT
- * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
- * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
- * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
- * like.
+ * The base point which is used (with derive_public_key) to derive a per-commitment payment
+ * public key which receives non-HTLC-encumbered funds which are only available for spending
+ * after some delay (or can be claimed via the revocation path).
  */
-void OnionPacket_set_public_key(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKCResult_PublicKeySecp256k1ErrorZ val);
+struct LDKDelayedPaymentBasepoint ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
 
 /**
- * HMAC to verify the integrity of hop_data.
+ * The base point which is used (with derive_public_key) to derive a per-commitment payment
+ * public key which receives non-HTLC-encumbered funds which are only available for spending
+ * after some delay (or can be claimed via the revocation path).
  */
-const uint8_t (*OnionPacket_get_hmac(const struct LDKOnionPacket *NONNULL_PTR this_ptr))[32];
+void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentBasepoint val);
 
 /**
- * HMAC to verify the integrity of hop_data.
+ * The base point which is used (with derive_public_key) to derive a per-commitment public key
+ * which is used to encumber HTLC-in-flight outputs.
  */
-void OnionPacket_set_hmac(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKHtlcBasepoint ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the OnionPacket
+ * The base point which is used (with derive_public_key) to derive a per-commitment public key
+ * which is used to encumber HTLC-in-flight outputs.
  */
-struct LDKOnionPacket OnionPacket_clone(const struct LDKOnionPacket *NONNULL_PTR orig);
+void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKHtlcBasepoint val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the OnionPacket.
+ * Constructs a new ChannelPublicKeys given each field
  */
-uint64_t OnionPacket_hash(const struct LDKOnionPacket *NONNULL_PTR o);
+MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKRevocationBasepoint revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKDelayedPaymentBasepoint delayed_payment_basepoint_arg, struct LDKHtlcBasepoint htlc_basepoint_arg);
 
 /**
- * Checks if two OnionPackets 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 ChannelPublicKeys
  */
-bool OnionPacket_eq(const struct LDKOnionPacket *NONNULL_PTR a, const struct LDKOnionPacket *NONNULL_PTR b);
+struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the TrampolineOnionPacket, if is_owned is set and inner is non-NULL.
+ * Generates a non-cryptographic 64-bit hash of the ChannelPublicKeys.
  */
-void TrampolineOnionPacket_free(struct LDKTrampolineOnionPacket this_obj);
+uint64_t ChannelPublicKeys_hash(const struct LDKChannelPublicKeys *NONNULL_PTR o);
 
 /**
- * Bolt 04 version number
+ * Checks if two ChannelPublicKeyss 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.
  */
-uint8_t TrampolineOnionPacket_get_version(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
+bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
 
 /**
- * Bolt 04 version number
+ * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
  */
-void TrampolineOnionPacket_set_version(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
+struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
 
 /**
- * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
+ * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
  */
-struct LDKPublicKey TrampolineOnionPacket_get_public_key(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
+struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
 
 /**
- * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
+ * Create per-state keys from channel base points and the per-commitment point.
+ * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
  */
-void TrampolineOnionPacket_set_public_key(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR broadcaster_delayed_payment_base, const struct LDKHtlcBasepoint *NONNULL_PTR broadcaster_htlc_base, const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_revocation_base, const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_htlc_base);
 
 /**
- * Encrypted payload for the next hop
- *
- * Returns a copy of the field.
+ * Generate per-state keys from channel static keys.
+ * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
  */
-struct LDKCVec_u8Z TrampolineOnionPacket_get_hop_data(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys);
 
 /**
- * Encrypted payload for the next hop
+ * A script either spendable by the revocation
+ * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
+ * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
  */
-void TrampolineOnionPacket_set_hop_data(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+struct LDKCVec_u8Z get_revokeable_redeemscript(const struct LDKRevocationKey *NONNULL_PTR revocation_key, uint16_t contest_delay, const struct LDKDelayedPaymentKey *NONNULL_PTR broadcaster_delayed_payment_key);
 
 /**
- * HMAC to verify the integrity of hop_data
+ * Returns the script for the counterparty's output on a holder's commitment transaction based on
+ * the channel type.
  */
-const uint8_t (*TrampolineOnionPacket_get_hmac(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr))[32];
+struct LDKCVec_u8Z get_counterparty_payment_script(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey payment_key);
 
 /**
- * HMAC to verify the integrity of hop_data
+ * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
  */
-void TrampolineOnionPacket_set_hmac(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
 
 /**
- * Constructs a new TrampolineOnionPacket given each field
+ * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
+ * Note that this is not the same as whether it is ountbound *from us*. To determine that you
+ * need to compare this value to whether the commitment transaction in question is that of
+ * the counterparty or our own.
  */
-MUST_USE_RES struct LDKTrampolineOnionPacket TrampolineOnionPacket_new(uint8_t version_arg, struct LDKPublicKey public_key_arg, struct LDKCVec_u8Z hop_data_arg, struct LDKThirtyTwoBytes hmac_arg);
+bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the TrampolineOnionPacket
+ * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
+ * Note that this is not the same as whether it is ountbound *from us*. To determine that you
+ * need to compare this value to whether the commitment transaction in question is that of
+ * the counterparty or our own.
  */
-struct LDKTrampolineOnionPacket TrampolineOnionPacket_clone(const struct LDKTrampolineOnionPacket *NONNULL_PTR orig);
+void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the TrampolineOnionPacket.
+ * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
+ * this divided by 1000.
  */
-uint64_t TrampolineOnionPacket_hash(const struct LDKTrampolineOnionPacket *NONNULL_PTR o);
+uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two TrampolineOnionPackets 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 value, in msat, of the HTLC. The value as it appears in the commitment transaction is
+ * this divided by 1000.
  */
-bool TrampolineOnionPacket_eq(const struct LDKTrampolineOnionPacket *NONNULL_PTR a, const struct LDKTrampolineOnionPacket *NONNULL_PTR b);
+void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Serialize the TrampolineOnionPacket object into a byte array which can be read by TrampolineOnionPacket_read
+ * The CLTV lock-time at which this HTLC expires.
  */
-struct LDKCVec_u8Z TrampolineOnionPacket_write(const struct LDKTrampolineOnionPacket *NONNULL_PTR obj);
+uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
+ * The CLTV lock-time at which this HTLC expires.
  */
-struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
+void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Read a AcceptChannel from a byte array, created by AcceptChannel_write
+ * The hash of the preimage which unlocks this HTLC.
  */
-struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
+const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
 
 /**
- * Serialize the AcceptChannelV2 object into a byte array which can be read by AcceptChannelV2_read
+ * The hash of the preimage which unlocks this HTLC.
  */
-struct LDKCVec_u8Z AcceptChannelV2_write(const struct LDKAcceptChannelV2 *NONNULL_PTR obj);
+void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Read a AcceptChannelV2 from a byte array, created by AcceptChannelV2_write
+ * The position within the commitment transactions' outputs. This may be None if the value is
+ * below the dust limit (in which case no output appears in the commitment transaction and the
+ * value is spent to additional transaction fees).
  */
-struct LDKCResult_AcceptChannelV2DecodeErrorZ AcceptChannelV2_read(struct LDKu8slice ser);
+struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the Stfu object into a byte array which can be read by Stfu_read
+ * The position within the commitment transactions' outputs. This may be None if the value is
+ * below the dust limit (in which case no output appears in the commitment transaction and the
+ * value is spent to additional transaction fees).
  */
-struct LDKCVec_u8Z Stfu_write(const struct LDKStfu *NONNULL_PTR obj);
+void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
 
 /**
- * Read a Stfu from a byte array, created by Stfu_write
+ * Constructs a new HTLCOutputInCommitment given each field
  */
-struct LDKCResult_StfuDecodeErrorZ Stfu_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_new(bool offered_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u32Z transaction_output_index_arg);
 
 /**
- * Serialize the Splice object into a byte array which can be read by Splice_read
+ * Creates a copy of the HTLCOutputInCommitment
  */
-struct LDKCVec_u8Z Splice_write(const struct LDKSplice *NONNULL_PTR obj);
+struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
 
 /**
- * Read a Splice from a byte array, created by Splice_write
+ * Checks if two HTLCOutputInCommitments 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 LDKCResult_SpliceDecodeErrorZ Splice_read(struct LDKu8slice ser);
+bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
 
 /**
- * Serialize the SpliceAck object into a byte array which can be read by SpliceAck_read
+ * Converts HTLC's value with millisatoshi precision into [bitcoin::Amount] with satoshi precision.
+ * Typically this conversion is needed when transitioning from LN into base-layer Bitcoin,
+ * e. g. in commitment transactions.
  */
-struct LDKCVec_u8Z SpliceAck_write(const struct LDKSpliceAck *NONNULL_PTR obj);
+MUST_USE_RES uint64_t HTLCOutputInCommitment_to_bitcoin_amount(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_arg);
 
 /**
- * Read a SpliceAck from a byte array, created by SpliceAck_write
+ * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
  */
-struct LDKCResult_SpliceAckDecodeErrorZ SpliceAck_read(struct LDKu8slice ser);
+struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
 
 /**
- * Serialize the SpliceLocked object into a byte array which can be read by SpliceLocked_read
+ * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
  */
-struct LDKCVec_u8Z SpliceLocked_write(const struct LDKSpliceLocked *NONNULL_PTR obj);
+struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
 
 /**
- * Read a SpliceLocked from a byte array, created by SpliceLocked_write
+ * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
+ * does not need to have its previous_output_index filled.
  */
-struct LDKCResult_SpliceLockedDecodeErrorZ SpliceLocked_read(struct LDKu8slice ser);
+struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, const struct LDKTxCreationKeys *NONNULL_PTR keys);
 
 /**
- * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
+ * Gets the redeemscript for a funding output from the two funding public keys.
+ * Note that the order of funding public keys does not matter.
  */
-struct LDKCVec_u8Z TxAddInput_write(const struct LDKTxAddInput *NONNULL_PTR obj);
+struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
 
 /**
- * Read a TxAddInput from a byte array, created by TxAddInput_write
+ * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
+ * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
+ * transaction which needs signing, and can be used to construct an HTLC transaction which is
+ * broadcastable given a counterparty HTLC signature.
+ *
+ * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
+ * commitment transaction).
  */
-struct LDKCResult_TxAddInputDecodeErrorZ TxAddInput_read(struct LDKu8slice ser);
+struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, const struct LDKDelayedPaymentKey *NONNULL_PTR broadcaster_delayed_payment_key, const struct LDKRevocationKey *NONNULL_PTR revocation_key);
 
 /**
- * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read
+ * Returns the witness required to satisfy and spend a HTLC input.
  */
-struct LDKCVec_u8Z TxAddOutput_write(const struct LDKTxAddOutput *NONNULL_PTR obj);
+struct LDKWitness build_htlc_input_witness(struct LDKECDSASignature local_sig, struct LDKECDSASignature remote_sig, struct LDKCOption_ThirtyTwoBytesZ preimage, struct LDKu8slice redeem_script, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
 
 /**
- * Read a TxAddOutput from a byte array, created by TxAddOutput_write
+ * Gets the witnessScript for the to_remote output when anchors are enabled.
  */
-struct LDKCResult_TxAddOutputDecodeErrorZ TxAddOutput_read(struct LDKu8slice ser);
+struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
 
 /**
- * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
+ * Gets the witnessScript for an anchor output from the funding public key.
+ * The witness in the spending input must be:
+ * <BIP 143 funding_signature>
+ * After 16 blocks of confirmation, an alternative satisfying witness could be:
+ * <>
+ * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
  */
-struct LDKCVec_u8Z TxRemoveInput_write(const struct LDKTxRemoveInput *NONNULL_PTR obj);
+struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
 
 /**
- * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
+ * Returns the witness required to satisfy and spend an anchor input.
  */
-struct LDKCResult_TxRemoveInputDecodeErrorZ TxRemoveInput_read(struct LDKu8slice ser);
+struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKECDSASignature funding_sig);
 
 /**
- * Serialize the TxRemoveOutput object into a byte array which can be read by TxRemoveOutput_read
+ * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
  */
-struct LDKCVec_u8Z TxRemoveOutput_write(const struct LDKTxRemoveOutput *NONNULL_PTR obj);
+void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
 
 /**
- * Read a TxRemoveOutput from a byte array, created by TxRemoveOutput_write
+ * Holder public keys
  */
-struct LDKCResult_TxRemoveOutputDecodeErrorZ TxRemoveOutput_read(struct LDKu8slice ser);
+struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
+ * Holder public keys
  */
-struct LDKCVec_u8Z TxComplete_write(const struct LDKTxComplete *NONNULL_PTR obj);
+void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
 
 /**
- * Read a TxComplete from a byte array, created by TxComplete_write
+ * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
  */
-struct LDKCResult_TxCompleteDecodeErrorZ TxComplete_read(struct LDKu8slice ser);
+uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
+ * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
  */
-struct LDKCVec_u8Z TxSignatures_write(const struct LDKTxSignatures *NONNULL_PTR obj);
+void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
- * Read a TxSignatures from a byte array, created by TxSignatures_write
+ * Whether the holder is the initiator of this channel.
+ * This is an input to the commitment number obscure factor computation.
  */
-struct LDKCResult_TxSignaturesDecodeErrorZ TxSignatures_read(struct LDKu8slice ser);
+bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
+ * Whether the holder is the initiator of this channel.
+ * This is an input to the commitment number obscure factor computation.
  */
-struct LDKCVec_u8Z TxInitRbf_write(const struct LDKTxInitRbf *NONNULL_PTR obj);
+void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
 
 /**
- * Read a TxInitRbf from a byte array, created by TxInitRbf_write
+ * 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 LDKCResult_TxInitRbfDecodeErrorZ TxInitRbf_read(struct LDKu8slice ser);
+struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
+ * 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
  */
-struct LDKCVec_u8Z TxAckRbf_write(const struct LDKTxAckRbf *NONNULL_PTR obj);
+void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
 
 /**
- * Read a TxAckRbf from a byte array, created by TxAckRbf_write
+ * 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 LDKCResult_TxAckRbfDecodeErrorZ TxAckRbf_read(struct LDKu8slice ser);
+struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the TxAbort object into a byte array which can be read by TxAbort_read
+ * The late-bound funding outpoint
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKCVec_u8Z TxAbort_write(const struct LDKTxAbort *NONNULL_PTR obj);
+void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
 
 /**
- * Read a TxAbort from a byte array, created by TxAbort_write
+ * This channel's type, as negotiated during channel open. For old objects where this field
+ * wasn't serialized, it will default to static_remote_key at deserialization.
  */
-struct LDKCResult_TxAbortDecodeErrorZ TxAbort_read(struct LDKu8slice ser);
+struct LDKChannelTypeFeatures ChannelTransactionParameters_get_channel_type_features(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
+ * This channel's type, as negotiated during channel open. For old objects where this field
+ * wasn't serialized, it will default to static_remote_key at deserialization.
  */
-struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
+void ChannelTransactionParameters_set_channel_type_features(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
 
 /**
- * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
+ * Constructs a new ChannelTransactionParameters given each field
+ *
+ * Note that counterparty_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that funding_outpoint_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg, struct LDKChannelTypeFeatures channel_type_features_arg);
 
 /**
- * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
+ * Creates a copy of the ChannelTransactionParameters
  */
-struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
+struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
 
 /**
- * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
+ * Generates a non-cryptographic 64-bit hash of the ChannelTransactionParameters.
  */
-struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
+uint64_t ChannelTransactionParameters_hash(const struct LDKChannelTransactionParameters *NONNULL_PTR o);
 
 /**
- * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
+ * Checks if two ChannelTransactionParameterss 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 LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
+bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b);
 
 /**
- * Read a ClosingSigned from a byte array, created by ClosingSigned_write
+ * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
  */
-struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
+void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
 
 /**
- * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
+ * Counter-party public keys
  */
-struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
+struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
 
 /**
- * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
+ * Counter-party public keys
  */
-struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
+void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
 
 /**
- * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
+ * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
  */
-struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
+uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
 
 /**
- * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
+ * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
  */
-struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
+void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
- * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
+ * Constructs a new CounterpartyChannelTransactionParameters given each field
  */
-struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
+MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
 
 /**
- * Read a FundingCreated from a byte array, created by FundingCreated_write
+ * Creates a copy of the CounterpartyChannelTransactionParameters
  */
-struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
+struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
 
 /**
- * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
+ * Generates a non-cryptographic 64-bit hash of the CounterpartyChannelTransactionParameters.
  */
-struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
+uint64_t CounterpartyChannelTransactionParameters_hash(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR o);
 
 /**
- * Read a FundingSigned from a byte array, created by FundingSigned_write
+ * Checks if two CounterpartyChannelTransactionParameterss 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 LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
+bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b);
 
 /**
- * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
+ * Whether the late bound parameters are populated.
  */
-struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
+MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
 
 /**
- * Read a ChannelReady from a byte array, created by ChannelReady_write
+ * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
+ * given that the holder is the broadcaster.
+ *
+ * self.is_populated() must be true before calling this function.
  */
-struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
 
 /**
- * Serialize the Init object into a byte array which can be read by Init_read
+ * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
+ * given that the counterparty is the broadcaster.
+ *
+ * self.is_populated() must be true before calling this function.
  */
-struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
+MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
 
 /**
- * Read a Init from a byte array, created by Init_write
+ * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
  */
-struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
+struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
 
 /**
- * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
+ * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
  */
-struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
+struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
 
 /**
- * Read a OpenChannel from a byte array, created by OpenChannel_write
+ * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
  */
-struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
+struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
 
 /**
- * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
+ * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
  */
-struct LDKCVec_u8Z OpenChannelV2_write(const struct LDKOpenChannelV2 *NONNULL_PTR obj);
+struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
 
 /**
- * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
+ * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
  */
-struct LDKCResult_OpenChannelV2DecodeErrorZ OpenChannelV2_read(struct LDKu8slice ser);
+void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
 
 /**
- * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
+ * Get the channel pubkeys for the broadcaster
  */
-struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
+MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
 
 /**
- * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
+ * Get the channel pubkeys for the countersignatory
  */
-struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
 
 /**
- * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
+ * Get the contest delay applicable to the transactions.
+ * Note that the contest delay was selected by the countersignatory.
  */
-struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
+MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
 
 /**
- * Read a Shutdown from a byte array, created by Shutdown_write
+ * Whether the channel is outbound from the broadcaster.
+ *
+ * The boolean representing the side that initiated the channel is
+ * an input to the commitment number obscure factor computation.
  */
-struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
+MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
 
 /**
- * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
+ * The funding outpoint
  */
-struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
+MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
 
 /**
- * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
+ * Whether to use anchors for this channel
  */
-struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKChannelTypeFeatures DirectedChannelTransactionParameters_channel_type_features(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
 
 /**
- * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
+ * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
  */
-struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
+void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
 
 /**
- * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
+ * Our counterparty's signature for the transaction
  */
-struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
+struct LDKECDSASignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
+ * Our counterparty's signature for the transaction
  */
-struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
+void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
 
 /**
- * Read a UpdateFee from a byte array, created by UpdateFee_write
+ * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
+ *
+ * Returns a copy of the field.
  */
-struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
+struct LDKCVec_ECDSASignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
+ * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
  */
-struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
+void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
 
 /**
- * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
+ * Creates a copy of the HolderCommitmentTransaction
  */
-struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
+struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
 
 /**
- * Serialize the OnionPacket object into a byte array which can be read by OnionPacket_read
+ * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
  */
-struct LDKCVec_u8Z OnionPacket_write(const struct LDKOnionPacket *NONNULL_PTR obj);
+struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
 
 /**
- * Read a OnionPacket from a byte array, created by OnionPacket_write
+ * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
  */
-struct LDKCResult_OnionPacketDecodeErrorZ OnionPacket_read(struct LDKu8slice ser);
+struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
 
 /**
- * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
+ * Create a new holder transaction with the given counterparty signatures.
+ * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
  */
-struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
+MUST_USE_RES struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_new(struct LDKCommitmentTransaction commitment_tx, struct LDKECDSASignature counterparty_sig, struct LDKCVec_ECDSASignatureZ counterparty_htlc_sigs, struct LDKPublicKey holder_funding_key, struct LDKPublicKey counterparty_funding_key);
 
 /**
- * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
+ * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
  */
-struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
+void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
 
 /**
- * Read a OnionMessage from a byte array, created by OnionMessage_write
+ * The commitment transaction
  */
-struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
+struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
+ * The commitment transaction
  */
-struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
+void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
 
 /**
- * Serialize the FinalOnionHopData object into a byte array which can be read by FinalOnionHopData_read
+ * The txid for the commitment transaction.
+ *
+ * This is provided as a performance optimization, instead of calling transaction.txid()
+ * multiple times.
  */
-struct LDKCVec_u8Z FinalOnionHopData_write(const struct LDKFinalOnionHopData *NONNULL_PTR obj);
+const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
 
 /**
- * Read a FinalOnionHopData from a byte array, created by FinalOnionHopData_write
+ * The txid for the commitment transaction.
+ *
+ * This is provided as a performance optimization, instead of calling transaction.txid()
+ * multiple times.
  */
-struct LDKCResult_FinalOnionHopDataDecodeErrorZ FinalOnionHopData_read(struct LDKu8slice ser);
+void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Serialize the Ping object into a byte array which can be read by Ping_read
+ * Constructs a new BuiltCommitmentTransaction given each field
  */
-struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
+MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
 
 /**
- * Read a Ping from a byte array, created by Ping_write
+ * Creates a copy of the BuiltCommitmentTransaction
  */
-struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
+struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
 
 /**
- * Serialize the Pong object into a byte array which can be read by Pong_read
+ * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
  */
-struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
+struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
 
 /**
- * Read a Pong from a byte array, created by Pong_write
+ * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
  */
-struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
+struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
 
 /**
- * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
+ * Get the SIGHASH_ALL sighash value of the transaction.
+ *
+ * This can be used to verify a signature.
  */
-struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
+MUST_USE_RES struct LDKThirtyTwoBytes BuiltCommitmentTransaction_get_sighash_all(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
 
 /**
- * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
+ * Signs the counterparty's commitment transaction.
  */
-struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKECDSASignature BuiltCommitmentTransaction_sign_counterparty_commitment(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
 
 /**
- * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
+ * Signs the holder commitment transaction because we are about to broadcast it.
  */
-struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
+MUST_USE_RES struct LDKECDSASignature BuiltCommitmentTransaction_sign_holder_commitment(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis, const struct LDKEntropySource *NONNULL_PTR entropy_source);
 
 /**
- * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
+ * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
  */
-struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
+void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
 
 /**
- * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
+ * Creates a copy of the ClosingTransaction
  */
-struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
+struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
 
 /**
- * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
+ * Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
  */
-struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
+uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
 
 /**
- * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
+ * Checks if two ClosingTransactions 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 LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
+bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
 
 /**
- * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
+ * Construct an object of the class
  */
-struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
+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);
 
 /**
- * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
+ * 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.
  */
-struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
+MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
 
 /**
- * Read a ErrorMessage from a byte array, created by ErrorMessage_write
+ * 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.
  */
-struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
 
 /**
- * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
+ * The value to be sent to the holder, or zero if the output will be omitted
  */
-struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
+MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
 
 /**
- * Read a WarningMessage from a byte array, created by WarningMessage_write
+ * The value to be sent to the counterparty, or zero if the output will be omitted
  */
-struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
+MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
 
 /**
- * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
+ * The destination of the holder's output
  */
-struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
+MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
 
 /**
- * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
+ * The destination of the counterparty's output
  */
-struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
 
 /**
- * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
+ * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
  */
-struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
+void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
 
 /**
- * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
+ * The pre-built Bitcoin commitment transaction
  */
-struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
 
 /**
- * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
+ * Get the SIGHASH_ALL sighash value of the transaction.
+ *
+ * This can be used to verify a signature.
  */
-struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
+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);
 
 /**
- * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
+ * Sign a transaction, either because we are counter-signing the counterparty's transaction or
+ * because we are about to broadcast a holder transaction.
  */
-struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
+MUST_USE_RES struct LDKECDSASignature TrustedClosingTransaction_sign(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
 
 /**
- * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
+ * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
  */
-struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
+void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
 
 /**
- * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
+ * Creates a copy of the CommitmentTransaction
  */
-struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
+struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
 
 /**
- * Calculates the overflow safe ending block height for the query.
- *
- * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
+ * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
  */
-MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
 
 /**
- * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
+ * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
  */
-struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
+struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
 
 /**
- * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
+ * The backwards-counting commitment number
  */
-struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
+MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
 
 /**
- * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
+ * The per commitment point used by the broadcaster.
  */
-struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKPublicKey CommitmentTransaction_per_commitment_point(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
 
 /**
- * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
+ * The value to be sent to the broadcaster
  */
-struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
+MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
 
 /**
- * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
+ * The value to be sent to the counterparty
  */
-struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
+MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
 
 /**
- * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
+ * The feerate paid per 1000-weight-unit in this commitment transaction.
  */
-struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
+MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
 
 /**
- * Calls the free function if one is set
+ * Trust our pre-built transaction and derived transaction creation public keys.
+ *
+ * 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
+ * be used by an external signer - instead use the verify function.
  */
-void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
+MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
+ * Verify our pre-built transaction and derived transaction creation public keys.
+ *
+ * Applies a wrapper which allows access to these fields.
+ *
+ * An external validating signer must call this method before signing
+ * or using the built transaction.
  */
-void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
+MUST_USE_RES struct LDKCResult_TrustedCommitmentTransactionNoneZ CommitmentTransaction_verify(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg, const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys);
 
 /**
- * Constructs a new IgnoringMessageHandler given each field
+ * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
+void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
 
 /**
- * Constructs a new EventsProvider which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
+ * The transaction ID of the built Bitcoin transaction
  */
-struct LDKEventsProvider IgnoringMessageHandler_as_EventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
+ * The pre-built Bitcoin commitment transaction
  */
-struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
+ * The pre-calculated transaction creation public keys.
  */
-struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
+ * Should anchors be used.
  */
-struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKChannelTypeFeatures TrustedCommitmentTransaction_channel_type_features(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
+ * Get a signature for each HTLC which was included in the commitment transaction (ie for
+ * which HTLCOutputInCommitment::transaction_output_index.is_some()).
+ *
+ * The returned Vec has one entry for each HTLC, and in the same order.
+ *
+ * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
  */
-struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_CVec_ECDSASignatureZNoneZ TrustedCommitmentTransaction_get_htlc_sigs(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*htlc_base_key)[32], const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters, const struct LDKEntropySource *NONNULL_PTR entropy_source);
 
 /**
- * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
+ * Returns the index of the revokeable output, i.e. the `to_local` output sending funds to
+ * the broadcaster, in the built transaction, if any exists.
+ *
+ * There are two cases where this may return `None`:
+ * - The balance of the revokeable output is below the dust limit (only found on commitments
+ * early in the channel's lifetime, i.e. before the channel reserve is met).
+ * - This commitment was created before LDK 0.0.117. In this case, the
+ * commitment transaction previously didn't contain enough information to locate the
+ * revokeable output.
  */
-struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_usizeZ TrustedCommitmentTransaction_revokeable_output_index(const struct LDKTrustedCommitmentTransaction *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
+ * Helper method to build an unsigned justice transaction spending the revokeable
+ * `to_local` output to a destination script. Fee estimation accounts for the expected
+ * revocation witness data that will be added when signed.
+ *
+ * This method will error if the given fee rate results in a fee greater than the value
+ * of the output being spent, or if there exists no revokeable `to_local` output on this
+ * commitment transaction. See [`Self::revokeable_output_index`] for more details.
+ *
+ * The built transaction will allow fee bumping with RBF, and this method takes
+ * `feerate_per_kw` as an input such that multiple copies of a justice transaction at different
+ * fee rates may be built.
  */
-struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_TransactionNoneZ TrustedCommitmentTransaction_build_to_local_justice_tx(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, uint64_t feerate_per_kw, struct LDKCVec_u8Z destination_script);
 
 /**
- * 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
+ * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
+ * shared secret first. This prevents on-chain observers from discovering how many commitment
+ * transactions occurred in a channel before it was closed.
+ *
+ * This function gets the shared secret from relevant channel public keys and can be used to
+ * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
  */
-struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
+uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
 
 /**
- * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
+ * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
  */
-void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
+struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
 
 /**
- * Constructs a new ErroringMessageHandler
+ * Read a InitFeatures from a byte array, created by InitFeatures_write
  */
-MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
+struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
 
 /**
- * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
+ * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
  */
-struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
 
 /**
- * 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
+ * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
  */
-struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
+struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
 
 /**
- * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
+ * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
  */
-void MessageHandler_free(struct LDKMessageHandler this_obj);
+struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
 
 /**
- * A message handler which handles messages specific to channels. Usually this is just a
- * [`ChannelManager`] object or an [`ErroringMessageHandler`].
- *
- * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * Read a NodeFeatures from a byte array, created by NodeFeatures_write
  */
-const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
+struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
 
 /**
- * A message handler which handles messages specific to channels. Usually this is just a
- * [`ChannelManager`] object or an [`ErroringMessageHandler`].
- *
- * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
  */
-void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
+struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj);
 
 /**
- * A message handler which handles messages updating our knowledge of the network channel
- * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
- *
- * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
+ * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
  */
-const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
+struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser);
 
 /**
- * A message handler which handles messages updating our knowledge of the network channel
- * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
- *
- * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
+ * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
  */
-void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
+struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj);
 
 /**
- * A message handler which handles onion messages. This should generally be an
- * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
- *
- * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
+ * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
  */
-const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
+struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser);
 
 /**
- * A message handler which handles onion messages. This should generally be an
- * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
- *
- * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
+ * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
  */
-void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
+struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
 
 /**
- * A message handler which handles custom messages. The only LDK-provided implementation is
- * [`IgnoringMessageHandler`].
+ * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
  */
-const struct LDKCustomMessageHandler *MessageHandler_get_custom_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
+struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
 
 /**
- * A message handler which handles custom messages. The only LDK-provided implementation is
- * [`IgnoringMessageHandler`].
+ * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
  */
-void MessageHandler_set_custom_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKCustomMessageHandler val);
+struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
 
 /**
- * Constructs a new MessageHandler given each field
+ * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
  */
-MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg, struct LDKOnionMessageHandler onion_message_handler_arg, struct LDKCustomMessageHandler custom_message_handler_arg);
+struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
 
 /**
- * Creates a copy of a SocketDescriptor
+ * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
  */
-struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
+void ShutdownScript_free(struct LDKShutdownScript this_obj);
 
 /**
- * Calls the free function if one is set
+ * Creates a copy of the ShutdownScript
  */
-void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
+struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the PeerDetails, if is_owned is set and inner is non-NULL.
+ * Checks if two ShutdownScripts 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 PeerDetails_free(struct LDKPeerDetails this_obj);
+bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
 
 /**
- * The node id of the peer.
- *
- * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter
- * passed in to [`PeerManager::new_outbound_connection`].
+ * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
  */
-struct LDKPublicKey PeerDetails_get_counterparty_node_id(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
+void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
 
 /**
- * The node id of the peer.
+ * The script that did not meet the requirements from [BOLT #2].
  *
- * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter
- * passed in to [`PeerManager::new_outbound_connection`].
+ * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
  */
-void PeerDetails_set_counterparty_node_id(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+struct LDKCVec_u8Z InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
 
 /**
- * The socket address the peer provided in the initial handshake.
- *
- * Will only be `Some` if an address had been previously provided to
- * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`].
+ * The script that did not meet the requirements from [BOLT #2].
  *
- * Returns a copy of the field.
+ * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
  */
-struct LDKCOption_SocketAddressZ PeerDetails_get_socket_address(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
+void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
 
 /**
- * The socket address the peer provided in the initial handshake.
- *
- * Will only be `Some` if an address had been previously provided to
- * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`].
+ * Constructs a new InvalidShutdownScript given each field
  */
-void PeerDetails_set_socket_address(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
+MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
 
 /**
- * The features the peer provided in the initial handshake.
+ * Creates a copy of the InvalidShutdownScript
  */
-struct LDKInitFeatures PeerDetails_get_init_features(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
+struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
 
 /**
- * The features the peer provided in the initial handshake.
+ * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
  */
-void PeerDetails_set_init_features(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
+struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
 
 /**
- * Indicates the direction of the peer connection.
- *
- * Will be `true` for inbound connections, and `false` for outbound connections.
+ * Read a ShutdownScript from a byte array, created by ShutdownScript_write
  */
-bool PeerDetails_get_is_inbound_connection(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
+struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
 
 /**
- * Indicates the direction of the peer connection.
- *
- * Will be `true` for inbound connections, and `false` for outbound connections.
+ * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
  */
-void PeerDetails_set_is_inbound_connection(struct LDKPeerDetails *NONNULL_PTR this_ptr, bool val);
+MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
 
 /**
- * Constructs a new PeerDetails given each field
+ * Generates a P2WSH script pubkey from the given [`WScriptHash`].
  */
-MUST_USE_RES struct LDKPeerDetails PeerDetails_new(struct LDKPublicKey counterparty_node_id_arg, struct LDKCOption_SocketAddressZ socket_address_arg, struct LDKInitFeatures init_features_arg, bool is_inbound_connection_arg);
+MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
 
 /**
- * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
+ * 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 PeerHandleError_free(struct LDKPeerHandleError this_obj);
+MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessProgram witness_program);
 
 /**
- * Constructs a new PeerHandleError given each field
+ * Converts the shutdown script into the underlying [`ScriptBuf`].
  */
-MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
+MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
 
 /**
- * Creates a copy of the PeerHandleError
+ * 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
  */
-struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
+MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
+ * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
+ *
+ * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
  */
-void PeerManager_free(struct LDKPeerManager this_obj);
+MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
 
 /**
- * Constructs a new `PeerManager` with the given message handlers.
- *
- * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
- * cryptographically secure random bytes.
- *
- * `current_time` is used as an always-increasing counter that survives across restarts and is
- * incremented irregularly internally. In general it is best to simply use the current UNIX
- * timestamp, however if it is not available a persistent counter that increases once per
- * minute should suffice.
+ * Get the string representation of a ShutdownScript object
  */
-MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, uint32_t current_time, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKNodeSigner node_signer);
+struct LDKStr ShutdownScript_to_str(const struct LDKShutdownScript *NONNULL_PTR o);
 
 /**
- * Returns a list of [`PeerDetails`] for connected peers that have completed the initial
- * handshake.
+ * Frees any resources used by the ChannelId, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKCVec_PeerDetailsZ PeerManager_list_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
+void ChannelId_free(struct LDKChannelId this_obj);
+
+const uint8_t (*ChannelId_get_a(const struct LDKChannelId *NONNULL_PTR this_ptr))[32];
+
+void ChannelId_set_a(struct LDKChannelId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Returns the [`PeerDetails`] of a connected peer that has completed the initial handshake.
- *
- * Will return `None` if the peer is unknown or it hasn't completed the initial handshake.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Constructs a new ChannelId given each field
  */
-MUST_USE_RES struct LDKPeerDetails PeerManager_peer_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id);
+MUST_USE_RES struct LDKChannelId ChannelId_new(struct LDKThirtyTwoBytes a_arg);
 
 /**
- * Indicates a new outbound connection has been established to a node with the given `node_id`
- * and an optional remote network address.
- *
- * The remote network address adds the option to report a remote IP address back to a connecting
- * peer using the init message.
- * The user should pass the remote network address of the host they are connected to.
- *
- * If an `Err` is returned here you must disconnect the connection immediately.
- *
- * 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 been
- * [`socket_disconnected`].
- *
- * [`socket_disconnected`]: PeerManager::socket_disconnected
+ * Creates a copy of the ChannelId
  */
-MUST_USE_RES struct LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKSocketDescriptor descriptor, struct LDKCOption_SocketAddressZ remote_network_address);
+struct LDKChannelId ChannelId_clone(const struct LDKChannelId *NONNULL_PTR orig);
 
 /**
- * Indicates a new inbound connection has been established to a node with an optional remote
- * network address.
- *
- * The remote network address adds the option to report a remote IP address back to a connecting
- * peer using the init message.
- * The user should pass the remote network address of the host they are connected to.
- *
- * May refuse the connection by returning an Err, but will never write bytes to the remote end
- * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
- * the connection immediately.
- *
- * Panics if descriptor is duplicative with some other descriptor which has not yet been
- * [`socket_disconnected`].
- *
- * [`socket_disconnected`]: PeerManager::socket_disconnected
+ * Checks if two ChannelIds 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.
  */
-MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor, struct LDKCOption_SocketAddressZ remote_network_address);
+bool ChannelId_eq(const struct LDKChannelId *NONNULL_PTR a, const struct LDKChannelId *NONNULL_PTR b);
 
 /**
- * Indicates that there is room to write data to the given socket descriptor.
- *
- * May return an Err to indicate that the connection should be closed.
- *
- * 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
+ * Generates a non-cryptographic 64-bit hash of the ChannelId.
  */
-MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
+uint64_t ChannelId_hash(const struct LDKChannelId *NONNULL_PTR o);
 
 /**
- * Indicates that data was read from the given socket descriptor.
- *
- * 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 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 descriptor has `resume_read` set (preventing DoS issues in the
- * send buffer).
- *
- * In order to avoid processing too many messages at once per peer, `data` should be on the
- * order of 4KiB.
- *
- * [`send_data`]: SocketDescriptor::send_data
- * [`process_events`]: PeerManager::process_events
+ * Create _v1_ channel ID based on a funding TX ID and output index
  */
-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);
+MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_txid(const uint8_t (*txid)[32], uint16_t output_index);
 
 /**
- * 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_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.
- *
- * Note that if there are any other calls to this function waiting on lock(s) this may return
- * without doing any work. All available events that need handling will be handled before the
- * other calls return.
- *
- * [`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
+ * Create _v1_ channel ID from a funding tx outpoint
  */
-void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_outpoint(struct LDKOutPoint outpoint);
 
 /**
- * Indicates that the given socket descriptor's connection is now closed.
+ * Create a _temporary_ channel ID randomly, based on an entropy source.
  */
-void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
+MUST_USE_RES struct LDKChannelId ChannelId_temporary_from_entropy_source(const struct LDKEntropySource *NONNULL_PTR entropy_source);
 
 /**
- * Disconnect a peer given its node id.
- *
- * 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
+ * Generic constructor; create a new channel ID from the provided data.
+ * Use a more specific `*_from_*` constructor when possible.
  */
-void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
+MUST_USE_RES struct LDKChannelId ChannelId_from_bytes(struct LDKThirtyTwoBytes data);
 
 /**
- * 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.
+ * Create a channel ID consisting of all-zeros data (e.g. when uninitialized or a placeholder).
  */
-void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKChannelId ChannelId_new_zero(void);
 
 /**
- * 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 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
+ * Check whether ID is consisting of all zeros (uninitialized)
  */
-void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
+MUST_USE_RES bool ChannelId_is_zero(const struct LDKChannelId *NONNULL_PTR this_arg);
 
 /**
- * Generates a signed node_announcement from the given arguments, sending it to all connected
- * peers. Note that peers will likely ignore this message unless we have at least one public
- * channel which has at least six confirmations on-chain.
- *
- * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
- * node to humans. They carry no in-protocol meaning.
- *
- * `addresses` represent the set (possibly empty) of socket addresses on which this node
- * accepts incoming connections. These will be included in the node_announcement, publicly
- * tying these addresses together and to this node. If you wish to preserve user privacy,
- * addresses should likely contain only Tor Onion addresses.
- *
- * Panics if `addresses` is absurdly large (more than 100).
- *
- * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
+ * Create _v2_ channel ID by concatenating the holder revocation basepoint with the counterparty
+ * revocation basepoint and hashing the result. The basepoints will be concatenated in increasing
+ * sorted order.
  */
-void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_SocketAddressZ addresses);
+MUST_USE_RES struct LDKChannelId ChannelId_v2_from_revocation_basepoints(const struct LDKRevocationBasepoint *NONNULL_PTR ours, const struct LDKRevocationBasepoint *NONNULL_PTR theirs);
 
 /**
- * Gets the weight for an HTLC-Success transaction.
+ * Create temporary _v2_ channel ID by concatenating a zeroed out basepoint with the holder
+ * revocation basepoint and hashing the result.
  */
-uint64_t htlc_success_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
+MUST_USE_RES struct LDKChannelId ChannelId_temporary_v2_from_revocation_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR our_revocation_basepoint);
 
 /**
- * Gets the weight for an HTLC-Timeout transaction.
+ * Serialize the ChannelId object into a byte array which can be read by ChannelId_read
  */
-uint64_t htlc_timeout_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
+struct LDKCVec_u8Z ChannelId_write(const struct LDKChannelId *NONNULL_PTR obj);
 
 /**
- * Creates a copy of the HTLCClaim
+ * Read a ChannelId from a byte array, created by ChannelId_write
  */
-enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
+struct LDKCResult_ChannelIdDecodeErrorZ ChannelId_read(struct LDKu8slice ser);
 
 /**
- * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
+ * Get the string representation of a ChannelId object
  */
-enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
+struct LDKStr ChannelId_to_str(const struct LDKChannelId *NONNULL_PTR o);
 
 /**
- * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
+ * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
+ * See [`PhantomKeysManager`] for more information on phantom node payments.
+ *
+ * `phantom_route_hints` parameter:
+ * * Contains channel info for all nodes participating in the phantom invoice
+ * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
+ *   participating node
+ * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
+ *   updated when a channel becomes disabled or closes
+ * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
+ *   may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
+ *   down
+ *
+ * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
+ * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
+ * If `None` is provided for `payment_hash`, then one will be created.
+ *
+ * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
+ * in excess of the current time.
+ *
+ * `duration_since_epoch` is the current time since epoch in seconds.
+ *
+ * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
+ * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
+ * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
+ * confirmations during routing.
+ *
+ * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
+ * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
+ * requirement).
+ *
+ * [`PhantomKeysManager`]: crate::sign::PhantomKeysManager
+ * [`ChannelManager::get_phantom_route_hints`]: crate::ln::channelmanager::ChannelManager::get_phantom_route_hints
+ * [`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
+ * [`PhantomRouteHints::channels`]: crate::ln::channelmanager::PhantomRouteHints::channels
+ * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: crate::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
+ *
+ * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
+ * available and the current time is supplied by the caller.
  */
-enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
+struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch);
 
 /**
- * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
+ * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
+ * See [`PhantomKeysManager`] for more information on phantom node payments.
+ *
+ * `phantom_route_hints` parameter:
+ * * Contains channel info for all nodes participating in the phantom invoice
+ * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
+ *   participating node
+ * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
+ *   updated when a channel becomes disabled or closes
+ * * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum
+ *   of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected
+ *   in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node
+ *   until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as
+ *   desired, but note that some nodes will be trimmed if more than 3 nodes are provided.
+ *
+ * `description_hash` is a SHA-256 hash of the description text
+ *
+ * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
+ * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
+ * If `None` is provided for `payment_hash`, then one will be created.
+ *
+ * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
+ * in excess of the current time.
+ *
+ * `duration_since_epoch` is the current time since epoch in seconds.
+ *
+ * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
+ * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
+ * requirement).
+ *
+ * [`PhantomKeysManager`]: crate::sign::PhantomKeysManager
+ * [`ChannelManager::get_phantom_route_hints`]: crate::ln::channelmanager::ChannelManager::get_phantom_route_hints
+ * [`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
+ * [`PhantomRouteHints::channels`]: crate::ln::channelmanager::PhantomRouteHints::channels
+ *
+ * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
+ * available and the current time is supplied by the caller.
  */
-enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
+struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKCOption_ThirtyTwoBytesZ payment_hash, uint32_t invoice_expiry_delta_secs, struct LDKSha256 description_hash, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch);
 
 /**
- * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
+ * 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
+ * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
+ * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
+ * that the payment secret is valid when the invoice is paid.
+ *
+ * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
+ * in excess of the current time.
+ *
+ * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
+ * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
+ * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
+ * confirmations during routing.
+ *
+ * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: crate::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
  */
-enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
+struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
 
 /**
- * Utility method to constructs a new Revocation-variant HTLCClaim
+ * 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
+ * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
+ * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
+ * that the payment secret is valid when the invoice is paid.
+ * Use this variant if you want to pass the `description_hash` to the invoice.
+ *
+ * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
+ * in excess of the current time.
+ *
+ * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
+ * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
+ * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
+ * confirmations during routing.
+ *
+ * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: crate::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
  */
-enum LDKHTLCClaim HTLCClaim_revocation(void);
+struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
 
 /**
- * Checks if two HTLCClaims contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * See [`create_invoice_from_channelmanager_with_description_hash`]
+ * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
+ * available and the current time is supplied by the caller.
  */
-bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
+struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
 
 /**
- * Check if a given input witness attempts to claim a HTLC.
+ * See [`create_invoice_from_channelmanager`]
+ * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
+ * available and the current time is supplied by the caller.
  */
-MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
+struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
 
 /**
- * Build the commitment secret from the seed and the commitment number
+ * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
+ * This version allows for providing a custom [`PaymentHash`] for the invoice.
+ * This may be useful if you're building an on-chain swap or involving another protocol where
+ * the payment hash is also involved outside the scope of lightning.
  */
-struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
+struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
 
 /**
- * Build a closing transaction
+ * Builds the necessary parameters to pay or pre-flight probe the given zero-amount
+ * [`Bolt11Invoice`] using [`ChannelManager::send_payment`] or
+ * [`ChannelManager::send_preflight_probes`].
+ *
+ * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
+ * same [`PaymentHash`] has never been paid before.
+ *
+ * Will always succeed unless the invoice has an amount specified, in which case
+ * [`payment_parameters_from_invoice`] should be used.
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ * [`ChannelManager::send_preflight_probes`]: crate::ln::channelmanager::ChannelManager::send_preflight_probes
  */
-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);
+struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_zero_amount_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat);
 
 /**
- * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
+ * Builds the necessary parameters to pay or pre-flight probe the given [`Bolt11Invoice`] using
+ * [`ChannelManager::send_payment`] or [`ChannelManager::send_preflight_probes`].
+ *
+ * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
+ * same [`PaymentHash`] has never been paid before.
+ *
+ * Will always succeed unless the invoice has no amount specified, in which case
+ * [`payment_parameters_from_zero_amount_invoice`] should be used.
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ * [`ChannelManager::send_preflight_probes`]: crate::ln::channelmanager::ChannelManager::send_preflight_probes
  */
-void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
+struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice);
 
 /**
- * Creates a copy of the CounterpartyCommitmentSecrets
+ * Frees any resources used by the Retry
  */
-struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
+void Retry_free(struct LDKRetry this_ptr);
 
 /**
- * Creates a new empty `CounterpartyCommitmentSecrets` structure.
+ * Creates a copy of the Retry
  */
-MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
+struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
 
 /**
- * Returns the minimum index of all stored secrets. Note that indexes start
- * at 1 << 48 and get decremented by one for each new secret.
+ * Utility method to constructs a new Attempts-variant Retry
  */
-MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
+struct LDKRetry Retry_attempts(uint32_t a);
 
 /**
- * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
- * was generated in accordance with BOLT 3 and is consistent with previous secrets.
+ * Utility method to constructs a new Timeout-variant Retry
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
+struct LDKRetry Retry_timeout(uint64_t a);
 
 /**
- * Returns the secret at `idx`.
- * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Checks if two Retrys contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
+bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
 
 /**
- * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
+ * Generates a non-cryptographic 64-bit hash of the Retry.
  */
-struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
+uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
 
 /**
- * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
+ * Serialize the Retry object into a byte array which can be read by Retry_read
  */
-struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
+struct LDKCVec_u8Z Retry_write(const struct LDKRetry *NONNULL_PTR obj);
 
 /**
- * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
- * from the base secret and the per_commitment_point.
+ * Read a Retry from a byte array, created by Retry_write
  */
-struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
+struct LDKCResult_RetryDecodeErrorZ Retry_read(struct LDKu8slice ser);
 
 /**
- * Derives a per-commitment-transaction revocation key from its constituent parts.
- *
- * Only the cheating participant owns a valid witness to propagate a revoked
- * commitment transaction, thus per_commitment_secret always come from cheater
- * and revocation_base_secret always come from punisher, which is the broadcaster
- * of the transaction spending with this key knowledge.
+ * Creates a copy of the RetryableSendFailure
  */
-struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
+enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
+ * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
  */
-void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
+enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
 
 /**
- * The broadcaster's per-commitment public key which was used to derive the other keys.
+ * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
  */
-struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
+enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
 
 /**
- * The broadcaster's per-commitment public key which was used to derive the other keys.
+ * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
  */
-void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
 
 /**
- * The revocation key which is used to allow the broadcaster of the commitment
- * transaction to provide their counterparty the ability to punish them if they broadcast
- * an old state.
+ * Utility method to constructs a new OnionPacketSizeExceeded-variant RetryableSendFailure
  */
-struct LDKRevocationKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
+enum LDKRetryableSendFailure RetryableSendFailure_onion_packet_size_exceeded(void);
 
 /**
- * The revocation key which is used to allow the broadcaster of the commitment
- * transaction to provide their counterparty the ability to punish them if they broadcast
- * an old state.
+ * Checks if two RetryableSendFailures contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
+bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b);
 
 /**
- * Broadcaster's HTLC Key
+ * Frees any resources used by the PaymentSendFailure
  */
-struct LDKHtlcKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
+void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
 
 /**
- * Broadcaster's HTLC Key
+ * Creates a copy of the PaymentSendFailure
  */
-void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
+struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
 
 /**
- * Countersignatory's HTLC Key
+ * Utility method to constructs a new ParameterError-variant PaymentSendFailure
  */
-struct LDKHtlcKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
+struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
 
 /**
- * Countersignatory's HTLC Key
+ * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
  */
-void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
+struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
 
 /**
- * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
+ * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
  */
-struct LDKDelayedPaymentKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
+struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
 
 /**
- * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
+ * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
  */
-void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentKey val);
+struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
 
 /**
- * Constructs a new TxCreationKeys given each field
+ * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
  */
-MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKRevocationKey revocation_key_arg, struct LDKHtlcKey broadcaster_htlc_key_arg, struct LDKHtlcKey countersignatory_htlc_key_arg, struct LDKDelayedPaymentKey broadcaster_delayed_payment_key_arg);
+struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
 
 /**
- * Checks if two TxCreationKeyss contain equal inner contents.
+ * Checks if two PaymentSendFailures 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 TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
+bool PaymentSendFailure_eq(const struct LDKPaymentSendFailure *NONNULL_PTR a, const struct LDKPaymentSendFailure *NONNULL_PTR b);
 
 /**
- * Creates a copy of the TxCreationKeys
+ * Frees any resources used by the Bolt12PaymentError
  */
-struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
+void Bolt12PaymentError_free(struct LDKBolt12PaymentError this_ptr);
 
 /**
- * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
+ * Creates a copy of the Bolt12PaymentError
  */
-struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
+struct LDKBolt12PaymentError Bolt12PaymentError_clone(const struct LDKBolt12PaymentError *NONNULL_PTR orig);
 
 /**
- * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
+ * Utility method to constructs a new UnexpectedInvoice-variant Bolt12PaymentError
  */
-struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
+struct LDKBolt12PaymentError Bolt12PaymentError_unexpected_invoice(void);
 
 /**
- * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
+ * Utility method to constructs a new DuplicateInvoice-variant Bolt12PaymentError
  */
-void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
+struct LDKBolt12PaymentError Bolt12PaymentError_duplicate_invoice(void);
 
 /**
- * The public key which is used to sign all commitment transactions, as it appears in the
- * on-chain channel lock-in 2-of-2 multisig output.
+ * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12PaymentError
  */
-struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
+struct LDKBolt12PaymentError Bolt12PaymentError_unknown_required_features(void);
 
 /**
- * The public key which is used to sign all commitment transactions, as it appears in the
- * on-chain channel lock-in 2-of-2 multisig output.
+ * Utility method to constructs a new SendingFailed-variant Bolt12PaymentError
  */
-void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+struct LDKBolt12PaymentError Bolt12PaymentError_sending_failed(enum LDKRetryableSendFailure a);
 
 /**
- * The base point which is used (with derive_public_revocation_key) to derive per-commitment
- * revocation keys. This is combined with the per-commitment-secret generated by the
- * counterparty to create a secret which the counterparty can reveal to revoke previous
- * states.
+ * Checks if two Bolt12PaymentErrors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-struct LDKRevocationBasepoint ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
+bool Bolt12PaymentError_eq(const struct LDKBolt12PaymentError *NONNULL_PTR a, const struct LDKBolt12PaymentError *NONNULL_PTR b);
 
 /**
- * The base point which is used (with derive_public_revocation_key) to derive per-commitment
- * revocation keys. This is combined with the per-commitment-secret generated by the
- * counterparty to create a secret which the counterparty can reveal to revoke previous
- * states.
+ * Frees any resources used by the ProbeSendFailure
  */
-void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKRevocationBasepoint val);
+void ProbeSendFailure_free(struct LDKProbeSendFailure this_ptr);
 
 /**
- * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
- * spendable primary channel balance on the broadcaster's commitment transaction. This key is
- * static across every commitment transaction.
+ * Creates a copy of the ProbeSendFailure
  */
-struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
+struct LDKProbeSendFailure ProbeSendFailure_clone(const struct LDKProbeSendFailure *NONNULL_PTR orig);
 
 /**
- * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
- * spendable primary channel balance on the broadcaster's commitment transaction. This key is
- * static across every commitment transaction.
+ * Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
  */
-void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+struct LDKProbeSendFailure ProbeSendFailure_route_not_found(void);
 
 /**
- * The base point which is used (with derive_public_key) to derive a per-commitment payment
- * public key which receives non-HTLC-encumbered funds which are only available for spending
- * after some delay (or can be claimed via the revocation path).
+ * Utility method to constructs a new SendingFailed-variant ProbeSendFailure
  */
-struct LDKDelayedPaymentBasepoint ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
+struct LDKProbeSendFailure ProbeSendFailure_sending_failed(struct LDKPaymentSendFailure a);
 
 /**
- * The base point which is used (with derive_public_key) to derive a per-commitment payment
- * public key which receives non-HTLC-encumbered funds which are only available for spending
- * after some delay (or can be claimed via the revocation path).
+ * Checks if two ProbeSendFailures contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentBasepoint val);
+bool ProbeSendFailure_eq(const struct LDKProbeSendFailure *NONNULL_PTR a, const struct LDKProbeSendFailure *NONNULL_PTR b);
 
 /**
- * The base point which is used (with derive_public_key) to derive a per-commitment public key
- * which is used to encumber HTLC-in-flight outputs.
+ * Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
  */
-struct LDKHtlcBasepoint ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
+void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj);
 
 /**
- * The base point which is used (with derive_public_key) to derive a per-commitment public key
- * which is used to encumber HTLC-in-flight outputs.
+ * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
+ * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
+ * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
+ * attacks.
+ *
+ * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
+ * multi-path payments require a recipient-provided secret.
+ *
+ * Some implementations may reject spontaneous payments with payment secrets, so you may only
+ * want to provide a secret for a spontaneous payment if MPP is needed and you know your
+ * recipient will not reject it.
  */
-void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKHtlcBasepoint val);
+struct LDKCOption_ThirtyTwoBytesZ RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new ChannelPublicKeys given each field
+ * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
+ * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
+ * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
+ * attacks.
+ *
+ * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
+ * multi-path payments require a recipient-provided secret.
+ *
+ * Some implementations may reject spontaneous payments with payment secrets, so you may only
+ * want to provide a secret for a spontaneous payment if MPP is needed and you know your
+ * recipient will not reject it.
  */
-MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKRevocationBasepoint revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKDelayedPaymentBasepoint delayed_payment_basepoint_arg, struct LDKHtlcBasepoint htlc_basepoint_arg);
+void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
 
 /**
- * Creates a copy of the ChannelPublicKeys
+ * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
+ * arbitrary length. This gives recipients substantially more flexibility to receive
+ * additional data.
+ *
+ * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
+ * scheme to authenticate received payments against expected payments and invoices, this field
+ * is not used in LDK for received payments, and can be used to store arbitrary data in
+ * invoices which will be received with the payment.
+ *
+ * Note that this field was added to the lightning specification more recently than
+ * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
+ * may not be supported as universally.
+ *
+ * Returns a copy of the field.
  */
-struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
+struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ChannelPublicKeys.
+ * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
+ * arbitrary length. This gives recipients substantially more flexibility to receive
+ * additional data.
+ *
+ * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
+ * scheme to authenticate received payments against expected payments and invoices, this field
+ * is not used in LDK for received payments, and can be used to store arbitrary data in
+ * invoices which will be received with the payment.
+ *
+ * Note that this field was added to the lightning specification more recently than
+ * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
+ * may not be supported as universally.
  */
-uint64_t ChannelPublicKeys_hash(const struct LDKChannelPublicKeys *NONNULL_PTR o);
+void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
 
 /**
- * Checks if two ChannelPublicKeyss contain equal inner contents.
+ * Creates a copy of the RecipientOnionFields
+ */
+struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig);
+
+/**
+ * Checks if two RecipientOnionFieldss 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 ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
+bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b);
 
 /**
- * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
+ * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
  */
-struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
+struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj);
 
 /**
- * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
+ * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
  */
-struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
+struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser);
 
 /**
- * Create per-state keys from channel base points and the per-commitment point.
- * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
+ * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
+ * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
+ * but do not require or provide any further data.
  */
-MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR broadcaster_delayed_payment_base, const struct LDKHtlcBasepoint *NONNULL_PTR broadcaster_htlc_base, const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_revocation_base, const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_htlc_base);
+MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret);
 
 /**
- * Generate per-state keys from channel static keys.
- * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
+ * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
+ * payable HTLCs except for single-path spontaneous payments, i.e. this should generally
+ * only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending
+ * a spontaneous MPP this will not work as all MPP require payment secrets; you may
+ * instead want to use [`RecipientOnionFields::secret_only`].
+ *
+ * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
+ * [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only
  */
-MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys);
+MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void);
 
 /**
- * A script either spendable by the revocation
- * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
- * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
+ * Creates a new [`RecipientOnionFields`] from an existing one, adding custom TLVs. Each
+ * TLV is provided as a `(u64, Vec<u8>)` for the type number and serialized value
+ * respectively. TLV type numbers must be unique and within the range
+ * reserved for custom types, i.e. >= 2^16, otherwise this method will return `Err(())`.
+ *
+ * This method will also error for types in the experimental range which have been
+ * standardized within the protocol, which only includes 5482373484 (keysend) for now.
+ *
+ * See [`Self::custom_tlvs`] for more info.
  */
-struct LDKCVec_u8Z get_revokeable_redeemscript(const struct LDKRevocationKey *NONNULL_PTR revocation_key, uint16_t contest_delay, const struct LDKDelayedPaymentKey *NONNULL_PTR broadcaster_delayed_payment_key);
+MUST_USE_RES struct LDKCResult_RecipientOnionFieldsNoneZ RecipientOnionFields_with_custom_tlvs(struct LDKRecipientOnionFields this_arg, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs);
 
 /**
- * Returns the script for the counterparty's output on a holder's commitment transaction based on
- * the channel type.
+ * Gets the custom TLVs that will be sent or have been received.
+ *
+ * Custom TLVs allow sending extra application-specific data with a payment. They provide
+ * additional flexibility on top of payment metadata, as while other implementations may
+ * require `payment_metadata` to reflect metadata provided in an invoice, custom TLVs
+ * do not have this restriction.
+ *
+ * Note that if this field is non-empty, it will contain strictly increasing TLVs, each
+ * represented by a `(u64, Vec<u8>)` for its type number and serialized value respectively.
+ * This is validated when setting this field using [`Self::with_custom_tlvs`].
  */
-struct LDKCVec_u8Z get_counterparty_payment_script(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey payment_key);
+MUST_USE_RES struct LDKCVec_C2Tuple_u64CVec_u8ZZZ RecipientOnionFields_custom_tlvs(const struct LDKRecipientOnionFields *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
+ * Calls the free function if one is set
  */
-void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
+void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
 
 /**
- * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
- * Note that this is not the same as whether it is ountbound *from us*. To determine that you
- * need to compare this value to whether the commitment transaction in question is that of
- * the counterparty or our own.
+ * Creates a copy of a Type
  */
-bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
+struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig);
 
 /**
- * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
- * Note that this is not the same as whether it is ountbound *from us*. To determine that you
- * need to compare this value to whether the commitment transaction in question is that of
- * the counterparty or our own.
+ * Calls the free function if one is set
  */
-void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
+void Type_free(struct LDKType this_ptr);
 
 /**
- * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
- * this divided by 1000.
+ * Frees any resources used by the OfferId, if is_owned is set and inner is non-NULL.
  */
-uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
+void OfferId_free(struct LDKOfferId this_obj);
+
+const uint8_t (*OfferId_get_a(const struct LDKOfferId *NONNULL_PTR this_ptr))[32];
+
+void OfferId_set_a(struct LDKOfferId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
- * this divided by 1000.
+ * Constructs a new OfferId given each field
  */
-void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
+MUST_USE_RES struct LDKOfferId OfferId_new(struct LDKThirtyTwoBytes a_arg);
 
 /**
- * The CLTV lock-time at which this HTLC expires.
+ * Creates a copy of the OfferId
  */
-uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
+struct LDKOfferId OfferId_clone(const struct LDKOfferId *NONNULL_PTR orig);
 
 /**
- * The CLTV lock-time at which this HTLC expires.
+ * Checks if two OfferIds 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 HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
+bool OfferId_eq(const struct LDKOfferId *NONNULL_PTR a, const struct LDKOfferId *NONNULL_PTR b);
 
 /**
- * The hash of the preimage which unlocks this HTLC.
+ * Serialize the OfferId object into a byte array which can be read by OfferId_read
  */
-const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
+struct LDKCVec_u8Z OfferId_write(const struct LDKOfferId *NONNULL_PTR obj);
 
 /**
- * The hash of the preimage which unlocks this HTLC.
+ * Read a OfferId from a byte array, created by OfferId_write
  */
-void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKCResult_OfferIdDecodeErrorZ OfferId_read(struct LDKu8slice ser);
 
 /**
- * The position within the commitment transactions' outputs. This may be None if the value is
- * below the dust limit (in which case no output appears in the commitment transaction and the
- * value is spent to additional transaction fees).
+ * Frees any resources used by the OfferWithExplicitMetadataBuilder, if is_owned is set and inner is non-NULL.
  */
-struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
+void OfferWithExplicitMetadataBuilder_free(struct LDKOfferWithExplicitMetadataBuilder this_obj);
 
 /**
- * The position within the commitment transactions' outputs. This may be None if the value is
- * below the dust limit (in which case no output appears in the commitment transaction and the
- * value is spent to additional transaction fees).
+ * Creates a copy of the OfferWithExplicitMetadataBuilder
  */
-void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
+struct LDKOfferWithExplicitMetadataBuilder OfferWithExplicitMetadataBuilder_clone(const struct LDKOfferWithExplicitMetadataBuilder *NONNULL_PTR orig);
 
 /**
- * Constructs a new HTLCOutputInCommitment given each field
+ * Frees any resources used by the OfferWithDerivedMetadataBuilder, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_new(bool offered_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u32Z transaction_output_index_arg);
+void OfferWithDerivedMetadataBuilder_free(struct LDKOfferWithDerivedMetadataBuilder this_obj);
 
 /**
- * Creates a copy of the HTLCOutputInCommitment
+ * Creates a copy of the OfferWithDerivedMetadataBuilder
  */
-struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
+struct LDKOfferWithDerivedMetadataBuilder OfferWithDerivedMetadataBuilder_clone(const struct LDKOfferWithDerivedMetadataBuilder *NONNULL_PTR orig);
 
 /**
- * Checks if two HTLCOutputInCommitments 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 builder for an offer using the [`Offer::signing_pubkey`] for signing invoices.
+ * The associated secret key must be remembered while the offer is valid.
+ *
+ * Use a different pubkey per offer to avoid correlating offers.
+ *
+ * # Note
+ *
+ * If constructing an [`Offer`] for use with a [`ChannelManager`], use
+ * [`ChannelManager::create_offer_builder`] instead of [`OfferBuilder::new`].
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [`ChannelManager::create_offer_builder`]: crate::ln::channelmanager::ChannelManager::create_offer_builder
  */
-bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
+MUST_USE_RES struct LDKOfferWithExplicitMetadataBuilder OfferWithExplicitMetadataBuilder_new(struct LDKPublicKey signing_pubkey);
 
 /**
- * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
+ * Sets the [`Offer::metadata`] to the given bytes.
+ *
+ * Successive calls to this method will override the previous setting.
  */
-struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
+MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ OfferWithExplicitMetadataBuilder_metadata(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKCVec_u8Z metadata);
 
 /**
- * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
+ * Adds the chain hash of the given [`Network`] to [`Offer::chains`]. If not called,
+ * the chain hash of [`Network::Bitcoin`] is assumed to be the only one supported.
+ *
+ * See [`Offer::chains`] on how this relates to the payment currency.
+ *
+ * Successive calls to this method will add another chain hash.
  */
-struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
+MUST_USE_RES void OfferWithExplicitMetadataBuilder_chain(struct LDKOfferWithExplicitMetadataBuilder this_arg, enum LDKNetwork network);
 
 /**
- * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
- * does not need to have its previous_output_index filled.
+ * Sets the [`Offer::amount`] as an [`Amount::Bitcoin`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, const struct LDKTxCreationKeys *NONNULL_PTR keys);
+MUST_USE_RES void OfferWithExplicitMetadataBuilder_amount_msats(struct LDKOfferWithExplicitMetadataBuilder this_arg, uint64_t amount_msats);
 
 /**
- * Gets the redeemscript for a funding output from the two funding public keys.
- * Note that the order of funding public keys does not matter.
+ * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
+ * already passed is valid and can be checked for using [`Offer::is_expired`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
+MUST_USE_RES void OfferWithExplicitMetadataBuilder_absolute_expiry(struct LDKOfferWithExplicitMetadataBuilder this_arg, uint64_t absolute_expiry);
 
 /**
- * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
- * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
- * transaction which needs signing, and can be used to construct an HTLC transaction which is
- * broadcastable given a counterparty HTLC signature.
+ * Sets the [`Offer::description`].
  *
- * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
- * commitment transaction).
+ * Successive calls to this method will override the previous setting.
  */
-struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, const struct LDKDelayedPaymentKey *NONNULL_PTR broadcaster_delayed_payment_key, const struct LDKRevocationKey *NONNULL_PTR revocation_key);
+MUST_USE_RES void OfferWithExplicitMetadataBuilder_description(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKStr description);
 
 /**
- * Returns the witness required to satisfy and spend a HTLC input.
+ * Sets the [`Offer::issuer`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-struct LDKWitness build_htlc_input_witness(struct LDKECDSASignature local_sig, struct LDKECDSASignature remote_sig, struct LDKCOption_ThirtyTwoBytesZ preimage, struct LDKu8slice redeem_script, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
+MUST_USE_RES void OfferWithExplicitMetadataBuilder_issuer(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKStr issuer);
 
 /**
- * Gets the witnessScript for the to_remote output when anchors are enabled.
+ * Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by
+ * private channels or if [`Offer::signing_pubkey`] is not a public node id.
+ *
+ * Successive calls to this method will add another blinded path. Caller is responsible for not
+ * adding duplicate paths.
  */
-struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
+MUST_USE_RES void OfferWithExplicitMetadataBuilder_path(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKBlindedMessagePath path);
 
 /**
- * Gets the witnessScript for an anchor output from the funding public key.
- * The witness in the spending input must be:
- * <BIP 143 funding_signature>
- * After 16 blocks of confirmation, an alternative satisfying witness could be:
- * <>
- * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
+ * Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to
+ * [`Quantity::One`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
+MUST_USE_RES void OfferWithExplicitMetadataBuilder_supported_quantity(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKQuantity quantity);
 
 /**
- * Returns the witness required to satisfy and spend an anchor input.
+ * Builds an [`Offer`] from the builder's settings.
  */
-struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKECDSASignature funding_sig);
+MUST_USE_RES struct LDKCResult_OfferBolt12SemanticErrorZ OfferWithExplicitMetadataBuilder_build(struct LDKOfferWithExplicitMetadataBuilder this_arg);
 
 /**
- * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
+ * Similar to [`OfferBuilder::new`] except, if [`OfferBuilder::path`] is called, the signing
+ * pubkey is derived from the given [`ExpandedKey`] and [`Nonce`]. This provides recipient
+ * privacy by using a different signing pubkey for each offer. Otherwise, the provided
+ * `node_id` is used for the signing pubkey.
+ *
+ * Also, sets the metadata when [`OfferBuilder::build`] is called such that it can be used by
+ * [`InvoiceRequest::verify_using_metadata`] to determine if the request was produced for the
+ * offer given an [`ExpandedKey`]. However, if [`OfferBuilder::path`] is called, then the
+ * metadata will not be set and must be included in each [`BlindedMessagePath`] instead. In this case,
+ * use [`InvoiceRequest::verify_using_recipient_data`].
+ *
+ * [`InvoiceRequest::verify_using_metadata`]: crate::offers::invoice_request::InvoiceRequest::verify_using_metadata
+ * [`InvoiceRequest::verify_using_recipient_data`]: crate::offers::invoice_request::InvoiceRequest::verify_using_recipient_data
+ * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
  */
-void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
+MUST_USE_RES struct LDKOfferWithDerivedMetadataBuilder OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKNonce nonce);
 
 /**
- * Holder public keys
+ * Adds the chain hash of the given [`Network`] to [`Offer::chains`]. If not called,
+ * the chain hash of [`Network::Bitcoin`] is assumed to be the only one supported.
+ *
+ * See [`Offer::chains`] on how this relates to the payment currency.
+ *
+ * Successive calls to this method will add another chain hash.
  */
-struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
+MUST_USE_RES void OfferWithDerivedMetadataBuilder_chain(struct LDKOfferWithDerivedMetadataBuilder this_arg, enum LDKNetwork network);
 
 /**
- * Holder public keys
+ * Sets the [`Offer::amount`] as an [`Amount::Bitcoin`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
+MUST_USE_RES void OfferWithDerivedMetadataBuilder_amount_msats(struct LDKOfferWithDerivedMetadataBuilder this_arg, uint64_t amount_msats);
 
 /**
- * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
+ * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
+ * already passed is valid and can be checked for using [`Offer::is_expired`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
+MUST_USE_RES void OfferWithDerivedMetadataBuilder_absolute_expiry(struct LDKOfferWithDerivedMetadataBuilder this_arg, uint64_t absolute_expiry);
 
 /**
- * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
+ * Sets the [`Offer::description`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
+MUST_USE_RES void OfferWithDerivedMetadataBuilder_description(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKStr description);
 
 /**
- * Whether the holder is the initiator of this channel.
- * This is an input to the commitment number obscure factor computation.
+ * Sets the [`Offer::issuer`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
+MUST_USE_RES void OfferWithDerivedMetadataBuilder_issuer(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKStr issuer);
 
 /**
- * Whether the holder is the initiator of this channel.
- * This is an input to the commitment number obscure factor computation.
+ * Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by
+ * private channels or if [`Offer::signing_pubkey`] is not a public node id.
+ *
+ * Successive calls to this method will add another blinded path. Caller is responsible for not
+ * adding duplicate paths.
  */
-void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
+MUST_USE_RES void OfferWithDerivedMetadataBuilder_path(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKBlindedMessagePath path);
 
 /**
- * The late-bound counterparty channel transaction parameters.
- * These parameters are populated at the point in the protocol where the counterparty provides them.
+ * Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to
+ * [`Quantity::One`].
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Successive calls to this method will override the previous setting.
  */
-struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
+MUST_USE_RES void OfferWithDerivedMetadataBuilder_supported_quantity(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKQuantity quantity);
 
 /**
- * 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
+ * Builds an [`Offer`] from the builder's settings.
  */
-void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
+MUST_USE_RES struct LDKCResult_OfferBolt12SemanticErrorZ OfferWithDerivedMetadataBuilder_build(struct LDKOfferWithDerivedMetadataBuilder this_arg);
 
 /**
- * The late-bound funding outpoint
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Frees any resources used by the Offer, if is_owned is set and inner is non-NULL.
  */
-struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
+void Offer_free(struct LDKOffer this_obj);
 
 /**
- * The late-bound funding outpoint
- *
- * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Creates a copy of the Offer
  */
-void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig);
 
 /**
- * This channel's type, as negotiated during channel open. For old objects where this field
- * wasn't serialized, it will default to static_remote_key at deserialization.
+ * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
+ * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
+ * for the selected chain.
  */
-struct LDKChannelTypeFeatures ChannelTransactionParameters_get_channel_type_features(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg);
 
 /**
- * This channel's type, as negotiated during channel open. For old objects where this field
- * wasn't serialized, it will default to static_remote_key at deserialization.
+ * Opaque bytes set by the originator. Useful for authentication and validating fields since it
+ * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
  */
-void ChannelTransactionParameters_set_channel_type_features(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
+MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new ChannelTransactionParameters given each field
+ * The minimum amount required for a successful payment of a single item.
+ */
+MUST_USE_RES struct LDKCOption_AmountZ Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg);
+
+/**
+ * A complete description of the purpose of the payment. Intended to be displayed to the user
+ * but with the caveat that it has not been verified in any way.
  *
- * Note that counterparty_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
- * Note that funding_outpoint_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg, struct LDKChannelTypeFeatures channel_type_features_arg);
+MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the ChannelTransactionParameters
+ * Features pertaining to the offer.
  */
-struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
+MUST_USE_RES struct LDKOfferFeatures Offer_offer_features(const struct LDKOffer *NONNULL_PTR this_arg);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ChannelTransactionParameters.
+ * Duration since the Unix epoch when an invoice should no longer be requested.
+ *
+ * If `None`, the offer does not expire.
  */
-uint64_t ChannelTransactionParameters_hash(const struct LDKChannelTransactionParameters *NONNULL_PTR o);
+MUST_USE_RES struct LDKCOption_u64Z Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg);
 
 /**
- * Checks if two ChannelTransactionParameterss 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 issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
+ * displayed to the user but with the caveat that it has not been verified in any way.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b);
+MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
+ * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
+ * recipient privacy by obfuscating its node id.
  */
-void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
+MUST_USE_RES struct LDKCVec_BlindedMessagePathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg);
 
 /**
- * Counter-party public keys
+ * The quantity of items supported.
  */
-struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
 
 /**
- * Counter-party public keys
+ * The public key used by the recipient to sign invoices.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
+MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg);
 
 /**
- * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
+ * Returns the id of the offer.
  */
-uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKOfferId Offer_id(const struct LDKOffer *NONNULL_PTR this_arg);
 
 /**
- * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
+ * Returns whether the given chain is supported by the offer.
  */
-void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
+MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain);
 
 /**
- * Constructs a new CounterpartyChannelTransactionParameters given each field
+ * Whether the offer has expired.
  */
-MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
+MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the CounterpartyChannelTransactionParameters
+ * Whether the offer has expired given the duration since the Unix epoch.
  */
-struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
+MUST_USE_RES bool Offer_is_expired_no_std(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the CounterpartyChannelTransactionParameters.
+ * Returns whether the given quantity is valid for the offer.
  */
-uint64_t CounterpartyChannelTransactionParameters_hash(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR o);
+MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity);
 
 /**
- * Checks if two CounterpartyChannelTransactionParameterss 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.
+ * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer.
+ *
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
  */
-bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b);
+MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
 
 /**
- * Whether the late bound parameters are populated.
+ * Similar to [`Offer::request_invoice`] except it:
+ * - derives the [`InvoiceRequest::payer_id`] such that a different key can be used for each
+ *   request,
+ * - sets [`InvoiceRequest::payer_metadata`] when [`InvoiceRequestBuilder::build`] is called
+ *   such that it can be used by [`Bolt12Invoice::verify_using_metadata`] to determine if the
+ *   invoice was requested using a base [`ExpandedKey`] from which the payer id was derived,
+ *   and
+ * - includes the [`PaymentId`] encrypted in [`InvoiceRequest::payer_metadata`] so that it can
+ *   be used when sending the payment for the requested invoice.
+ *
+ * Useful to protect the sender's privacy.
+ *
+ * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id
+ * [`InvoiceRequest::payer_metadata`]: crate::offers::invoice_request::InvoiceRequest::payer_metadata
+ * [`Bolt12Invoice::verify_using_metadata`]: crate::offers::invoice::Bolt12Invoice::verify_using_metadata
+ * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
  */
-MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice_deriving_payer_id(const struct LDKOffer *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKNonce nonce, struct LDKThirtyTwoBytes payment_id);
 
 /**
- * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
- * given that the holder is the broadcaster.
+ * Similar to [`Offer::request_invoice_deriving_payer_id`] except uses `payer_id` for the
+ * [`InvoiceRequest::payer_id`] instead of deriving a different key for each request.
  *
- * self.is_populated() must be true before calling this function.
+ * Useful for recurring payments using the same `payer_id` with different invoices.
+ *
+ * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id
  */
-MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice_deriving_metadata(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKPublicKey payer_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKNonce nonce, struct LDKThirtyTwoBytes payment_id);
 
 /**
- * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
- * given that the counterparty is the broadcaster.
+ * Creates an [`InvoiceRequestBuilder`] for the offer with the given `metadata` and `payer_id`,
+ * which will be reflected in the `Bolt12Invoice` response.
  *
- * self.is_populated() must be true before calling this function.
+ * The `metadata` is useful for including information about the derivation of `payer_id` such
+ * that invoice response handling can be stateless. Also serves as payer-provided entropy while
+ * hashing in the signature calculation.
+ *
+ * This should not leak any information such as by using a simple BIP-32 derivation path.
+ * Otherwise, payments may be correlated.
+ *
+ * Errors if the offer contains unknown required features.
+ *
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
  */
-MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id);
 
 /**
- * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
+ * Generates a non-cryptographic 64-bit hash of the Offer.
  */
-struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
+uint64_t Offer_hash(const struct LDKOffer *NONNULL_PTR o);
 
 /**
- * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
+ * Read a Offer from a byte array, created by Offer_write
  */
-struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
+struct LDKCResult_OfferDecodeErrorZ Offer_read(struct LDKu8slice ser);
 
 /**
- * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
+ * Serialize the Offer object into a byte array which can be read by Offer_read
  */
-struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
+struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj);
 
 /**
- * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
+ * Frees any resources used by the Amount
  */
-struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
+void Amount_free(struct LDKAmount this_ptr);
 
 /**
- * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the Amount
  */
-void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
+struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig);
 
 /**
- * Get the channel pubkeys for the broadcaster
+ * Utility method to constructs a new Bitcoin-variant Amount
  */
-MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
+struct LDKAmount Amount_bitcoin(uint64_t amount_msats);
 
 /**
- * Get the channel pubkeys for the countersignatory
+ * Utility method to constructs a new Currency-variant Amount
  */
-MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
+struct LDKAmount Amount_currency(struct LDKThreeBytes iso4217_code, uint64_t amount);
 
 /**
- * Get the contest delay applicable to the transactions.
- * Note that the contest delay was selected by the countersignatory.
+ * Frees any resources used by the Quantity
  */
-MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
+void Quantity_free(struct LDKQuantity this_ptr);
 
 /**
- * Whether the channel is outbound from the broadcaster.
- *
- * The boolean representing the side that initiated the channel is
- * an input to the commitment number obscure factor computation.
+ * Creates a copy of the Quantity
  */
-MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
+struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig);
 
 /**
- * The funding outpoint
+ * Utility method to constructs a new Bounded-variant Quantity
  */
-MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
+struct LDKQuantity Quantity_bounded(uint64_t a);
 
 /**
- * Whether to use anchors for this channel
+ * Utility method to constructs a new Unbounded-variant Quantity
  */
-MUST_USE_RES struct LDKChannelTypeFeatures DirectedChannelTransactionParameters_channel_type_features(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
+struct LDKQuantity Quantity_unbounded(void);
 
 /**
- * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
+ * Utility method to constructs a new One-variant Quantity
  */
-void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
+struct LDKQuantity Quantity_one(void);
 
 /**
- * Our counterparty's signature for the transaction
+ * Read a Offer object from a string
  */
-struct LDKECDSASignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
+struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s);
 
 /**
- * Our counterparty's signature for the transaction
+ * Get the string representation of a Offer object
  */
-void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+struct LDKStr Offer_to_str(const struct LDKOffer *NONNULL_PTR o);
 
 /**
- * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
- *
- * Returns a copy of the field.
+ * Frees any resources used by the InvoiceWithExplicitSigningPubkeyBuilder, if is_owned is set and inner is non-NULL.
  */
-struct LDKCVec_ECDSASignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
+void InvoiceWithExplicitSigningPubkeyBuilder_free(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj);
 
 /**
- * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
+ * Frees any resources used by the InvoiceWithDerivedSigningPubkeyBuilder, if is_owned is set and inner is non-NULL.
  */
-void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
+void InvoiceWithDerivedSigningPubkeyBuilder_free(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_obj);
 
 /**
- * Creates a copy of the HolderCommitmentTransaction
+ * Builds an unsigned [`Bolt12Invoice`] after checking for valid semantics. It can be signed by
+ * [`UnsignedBolt12Invoice::sign`].
  */
-struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
+MUST_USE_RES struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ InvoiceWithExplicitSigningPubkeyBuilder_build(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg);
 
 /**
- * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
+ *Sets the [`Bolt12Invoice::relative_expiry`]
+ *as seconds since [`Bolt12Invoice::created_at`].
+ *Any expiry that has already passed is valid and can be checked for using
+ *[`Bolt12Invoice::is_expired`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
+MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs);
 
 /**
- * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
+ *Adds a P2WSH address to [`Bolt12Invoice::fallbacks`].
+ *
+ * Successive calls to this method will add another address. Caller is responsible for not
+ * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
  */
-struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
+MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]);
 
 /**
- * Create a new holder transaction with the given counterparty signatures.
- * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
+ *Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`].
+ *
+ * Successive calls to this method will add another address. Caller is responsible for not
+ * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
  */
-MUST_USE_RES struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_new(struct LDKCommitmentTransaction commitment_tx, struct LDKECDSASignature counterparty_sig, struct LDKCVec_ECDSASignatureZ counterparty_htlc_sigs, struct LDKPublicKey holder_funding_key, struct LDKPublicKey counterparty_funding_key);
+MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]);
+
+/**
+ *Adds a P2TR address to [`Bolt12Invoice::fallbacks`].
+ *
+ * Successive calls to this method will add another address. Caller is responsible for not
+ * adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
+ */
+MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key);
 
 /**
- * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
+ *Sets [`Bolt12Invoice::invoice_features`]
+ *to indicate MPP may be used. Otherwise, MPP is disallowed.
  */
-void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
+MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg);
 
 /**
- * The commitment transaction
+ * Builds a signed [`Bolt12Invoice`] after checking for valid semantics.
  */
-struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg);
 
 /**
- * The commitment transaction
+ *Sets the [`Bolt12Invoice::relative_expiry`]
+ *as seconds since [`Bolt12Invoice::created_at`].
+ *Any expiry that has already passed is valid and can be checked for using
+ *[`Bolt12Invoice::is_expired`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
+MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs);
 
 /**
- * The txid for the commitment transaction.
+ *Adds a P2WSH address to [`Bolt12Invoice::fallbacks`].
  *
- * This is provided as a performance optimization, instead of calling transaction.txid()
- * multiple times.
+ * Successive calls to this method will add another address. Caller is responsible for not
+ * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
  */
-const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
+MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]);
 
 /**
- * The txid for the commitment transaction.
+ *Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`].
  *
- * This is provided as a performance optimization, instead of calling transaction.txid()
- * multiple times.
+ * Successive calls to this method will add another address. Caller is responsible for not
+ * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
  */
-void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]);
 
 /**
- * Constructs a new BuiltCommitmentTransaction given each field
+ *Adds a P2TR address to [`Bolt12Invoice::fallbacks`].
+ *
+ * Successive calls to this method will add another address. Caller is responsible for not
+ * adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
  */
-MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
+MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key);
 
 /**
- * Creates a copy of the BuiltCommitmentTransaction
+ *Sets [`Bolt12Invoice::invoice_features`]
+ *to indicate MPP may be used. Otherwise, MPP is disallowed.
  */
-struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
+MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg);
 
 /**
- * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
+ * Frees any resources used by the UnsignedBolt12Invoice, if is_owned is set and inner is non-NULL.
  */
-struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
+void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj);
 
 /**
- * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
+ * Creates a copy of the UnsignedBolt12Invoice
  */
-struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
+struct LDKUnsignedBolt12Invoice UnsignedBolt12Invoice_clone(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR orig);
 
 /**
- * Get the SIGHASH_ALL sighash value of the transaction.
- *
- * This can be used to verify a signature.
+ * Calls the free function if one is set
  */
-MUST_USE_RES struct LDKThirtyTwoBytes BuiltCommitmentTransaction_get_sighash_all(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
+void SignBolt12InvoiceFn_free(struct LDKSignBolt12InvoiceFn this_ptr);
 
 /**
- * Signs the counterparty's commitment transaction.
+ * Returns the [`TaggedHash`] of the invoice to sign.
  */
-MUST_USE_RES struct LDKECDSASignature BuiltCommitmentTransaction_sign_counterparty_commitment(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
+MUST_USE_RES struct LDKTaggedHash UnsignedBolt12Invoice_tagged_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Signs the holder commitment transaction because we are about to broadcast it.
+ * Frees any resources used by the Bolt12Invoice, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKECDSASignature BuiltCommitmentTransaction_sign_holder_commitment(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis, const struct LDKEntropySource *NONNULL_PTR entropy_source);
+void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj);
 
 /**
- * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the Bolt12Invoice
  */
-void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
+struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig);
 
 /**
- * Creates a copy of the ClosingTransaction
+ * Duration since the Unix epoch when the invoice was created.
  */
-struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
+MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
+ * Duration since
+ *[`Bolt12Invoice::created_at`]
+ * when the invoice has expired and therefore should no longer be paid.
  */
-uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
+MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Checks if two ClosingTransactions 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.
+ * Whether the invoice has expired.
  */
-bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
+MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Construct an object of the class
+ * Fallback addresses for paying the invoice on-chain, in order of most-preferred to
+ * least-preferred.
  */
-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);
+MUST_USE_RES struct LDKCVec_StrZ UnsignedBolt12Invoice_fallbacks(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * 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.
+ * Features pertaining to paying an invoice.
  */
-MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *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.
+ * The public key corresponding to the key used to sign the invoice.
  */
-MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
+MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * The value to be sent to the holder, or zero if the output will be omitted
+ * The chains that may be used when paying a requested invoice.
+ *
+ * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
+ *
+ * [`Offer::chains`]: crate::offers::offer::Offer::chains
  */
-MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ UnsignedBolt12Invoice_offer_chains(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * The value to be sent to the counterparty, or zero if the output will be omitted
+ * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
+ * invoice originated from an offer.
+ *
+ * From [`InvoiceRequest::chain`] or [`Refund::chain`].
+ *
+ * [`offer_chains`]: Self::offer_chains
+ * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
  */
-MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_chain(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * The destination of the holder's output
+ * Opaque bytes set by the originating [`Offer`].
+ *
+ * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
+ * if the [`Offer`] did not set it.
+ *
+ * [`Offer`]: crate::offers::offer::Offer
+ * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
  */
-MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedBolt12Invoice_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * The destination of the counterparty's output
+ * The minimum amount required for a successful payment of a single item.
+ *
+ * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
+ * the [`Offer`] did not set it.
+ *
+ * [`Offer`]: crate::offers::offer::Offer
+ * [`Offer::amount`]: crate::offers::offer::Offer::amount
  */
-MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_AmountZ UnsignedBolt12Invoice_amount(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
+ * Features pertaining to the originating [`Offer`].
+ *
+ * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
+ * [`Refund`].
+ *
+ * [`Offer`]: crate::offers::offer::Offer
+ * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
+MUST_USE_RES struct LDKOfferFeatures UnsignedBolt12Invoice_offer_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * The pre-built Bitcoin commitment transaction
+ * A complete description of the purpose of the originating offer or refund.
+ *
+ * From [`Offer::description`] or [`Refund::description`].
+ *
+ * [`Offer::description`]: crate::offers::offer::Offer::description
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_description(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Get the SIGHASH_ALL sighash value of the transaction.
+ * Duration since the Unix epoch when an invoice should no longer be requested.
  *
- * This can be used to verify a signature.
+ * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
+ *
+ * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
  */
-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);
+MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_absolute_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Sign a transaction, either because we are counter-signing the counterparty's transaction or
- * because we are about to broadcast a holder transaction.
+ * The issuer of the offer or refund.
+ *
+ * From [`Offer::issuer`] or [`Refund::issuer`].
+ *
+ * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKECDSASignature TrustedClosingTransaction_sign(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
+MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_issuer(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
+ * Paths to the recipient originating from publicly reachable nodes.
+ *
+ * From [`Offer::paths`] or [`Refund::paths`].
+ *
+ * [`Offer::paths`]: crate::offers::offer::Offer::paths
  */
-void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
+MUST_USE_RES struct LDKCVec_BlindedMessagePathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the CommitmentTransaction
+ * The quantity of items supported.
+ *
+ * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
+ * [`Refund`].
+ *
+ * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
  */
-struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
+MUST_USE_RES struct LDKCOption_QuantityZ UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
+ * An unpredictable series of bytes from the payer.
+ *
+ * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
  */
-struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
+MUST_USE_RES struct LDKu8slice UnsignedBolt12Invoice_payer_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
+ * Features pertaining to requesting an invoice.
+ *
+ * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
  */
-struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedBolt12Invoice_invoice_request_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * The backwards-counting commitment number
+ * The quantity of items requested or refunded for.
+ *
+ * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
  */
-MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * The per commitment point used by the broadcaster.
+ * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
+ * refund in case there are no [`message_paths`].
+ *
+ * [`message_paths`]: Self::message_paths
  */
-MUST_USE_RES struct LDKPublicKey CommitmentTransaction_per_commitment_point(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_payer_id(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * The value to be sent to the broadcaster
+ * A payer-provided note reflected back in the invoice.
+ *
+ * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_payer_note(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * The value to be sent to the counterparty
+ * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
  */
-MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_payment_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * The feerate paid per 1000-weight-unit in this commitment transaction.
+ * The minimum amount required for a successful payment of the invoice.
  */
-MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES uint64_t UnsignedBolt12Invoice_amount_msats(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Trust our pre-built transaction and derived transaction creation public keys.
- *
- * 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
- * be used by an external signer - instead use the verify function.
+ * Duration since the Unix epoch when the invoice was created.
  */
-MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Verify our pre-built transaction and derived transaction creation public keys.
- *
- * Applies a wrapper which allows access to these fields.
- *
- * An external validating signer must call this method before signing
- * or using the built transaction.
+ * Duration since
+ *[`Bolt12Invoice::created_at`]
+ * when the invoice has expired and therefore should no longer be paid.
  */
-MUST_USE_RES struct LDKCResult_TrustedCommitmentTransactionNoneZ CommitmentTransaction_verify(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg, const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys);
+MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
+ * Whether the invoice has expired.
  */
-void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
+MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * The transaction ID of the built Bitcoin transaction
+ * Fallback addresses for paying the invoice on-chain, in order of most-preferred to
+ * least-preferred.
  */
-MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCVec_StrZ Bolt12Invoice_fallbacks(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * The pre-built Bitcoin commitment transaction
+ * Features pertaining to paying an invoice.
  */
-MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * The pre-calculated transaction creation public keys.
+ * The public key corresponding to the key used to sign the invoice.
  */
-MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Should anchors be used.
+ * The chains that may be used when paying a requested invoice.
+ *
+ * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
+ *
+ * [`Offer::chains`]: crate::offers::offer::Offer::chains
  */
-MUST_USE_RES struct LDKChannelTypeFeatures TrustedCommitmentTransaction_channel_type_features(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ Bolt12Invoice_offer_chains(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Get a signature for each HTLC which was included in the commitment transaction (ie for
- * which HTLCOutputInCommitment::transaction_output_index.is_some()).
+ * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
+ * invoice originated from an offer.
  *
- * The returned Vec has one entry for each HTLC, and in the same order.
+ * From [`InvoiceRequest::chain`] or [`Refund::chain`].
  *
- * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
+ * [`offer_chains`]: Self::offer_chains
+ * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
  */
-MUST_USE_RES struct LDKCResult_CVec_ECDSASignatureZNoneZ TrustedCommitmentTransaction_get_htlc_sigs(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*htlc_base_key)[32], const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters, const struct LDKEntropySource *NONNULL_PTR entropy_source);
+MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_chain(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Returns the index of the revokeable output, i.e. the `to_local` output sending funds to
- * the broadcaster, in the built transaction, if any exists.
+ * Opaque bytes set by the originating [`Offer`].
  *
- * There are two cases where this may return `None`:
- * - The balance of the revokeable output is below the dust limit (only found on commitments
- * early in the channel's lifetime, i.e. before the channel reserve is met).
- * - This commitment was created before LDK 0.0.117. In this case, the
- * commitment transaction previously didn't contain enough information to locate the
- * revokeable output.
+ * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
+ * if the [`Offer`] did not set it.
+ *
+ * [`Offer`]: crate::offers::offer::Offer
+ * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
  */
-MUST_USE_RES struct LDKCOption_usizeZ TrustedCommitmentTransaction_revokeable_output_index(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt12Invoice_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Helper method to build an unsigned justice transaction spending the revokeable
- * `to_local` output to a destination script. Fee estimation accounts for the expected
- * revocation witness data that will be added when signed.
+ * The minimum amount required for a successful payment of a single item.
  *
- * This method will error if the given fee rate results in a fee greater than the value
- * of the output being spent, or if there exists no revokeable `to_local` output on this
- * commitment transaction. See [`Self::revokeable_output_index`] for more details.
+ * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
+ * the [`Offer`] did not set it.
  *
- * The built transaction will allow fee bumping with RBF, and this method takes
- * `feerate_per_kw` as an input such that multiple copies of a justice transaction at different
- * fee rates may be built.
+ * [`Offer`]: crate::offers::offer::Offer
+ * [`Offer::amount`]: crate::offers::offer::Offer::amount
  */
-MUST_USE_RES struct LDKCResult_TransactionNoneZ TrustedCommitmentTransaction_build_to_local_justice_tx(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, uint64_t feerate_per_kw, struct LDKCVec_u8Z destination_script);
+MUST_USE_RES struct LDKCOption_AmountZ Bolt12Invoice_amount(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
- * shared secret first. This prevents on-chain observers from discovering how many commitment
- * transactions occurred in a channel before it was closed.
+ * Features pertaining to the originating [`Offer`].
  *
- * This function gets the shared secret from relevant channel public keys and can be used to
- * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
+ * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
+ * [`Refund`].
+ *
+ * [`Offer`]: crate::offers::offer::Offer
+ * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
+MUST_USE_RES struct LDKOfferFeatures Bolt12Invoice_offer_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Checks if two InitFeaturess 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.
+ * A complete description of the purpose of the originating offer or refund.
+ *
+ * From [`Offer::description`] or [`Refund::description`].
+ *
+ * [`Offer::description`]: crate::offers::offer::Offer::description
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
+MUST_USE_RES struct LDKPrintableString Bolt12Invoice_description(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Checks if two NodeFeaturess 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.
+ * Duration since the Unix epoch when an invoice should no longer be requested.
+ *
+ * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
+ *
+ * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
  */
-bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
+MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_absolute_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Checks if two ChannelFeaturess 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 issuer of the offer or refund.
+ *
+ * From [`Offer::issuer`] or [`Refund::issuer`].
+ *
+ * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
+MUST_USE_RES struct LDKPrintableString Bolt12Invoice_issuer(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Checks if two Bolt11InvoiceFeaturess 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.
+ * Paths to the recipient originating from publicly reachable nodes.
+ *
+ * From [`Offer::paths`] or [`Refund::paths`].
+ *
+ * [`Offer::paths`]: crate::offers::offer::Offer::paths
  */
-bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b);
+MUST_USE_RES struct LDKCVec_BlindedMessagePathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Checks if two OfferFeaturess 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 quantity of items supported.
+ *
+ * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
+ * [`Refund`].
+ *
+ * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
  */
-bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
+MUST_USE_RES struct LDKCOption_QuantityZ Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Checks if two InvoiceRequestFeaturess 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.
+ * An unpredictable series of bytes from the payer.
+ *
+ * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
  */
-bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
+MUST_USE_RES struct LDKu8slice Bolt12Invoice_payer_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Checks if two Bolt12InvoiceFeaturess 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.
+ * Features pertaining to requesting an invoice.
+ *
+ * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
  */
-bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
+MUST_USE_RES struct LDKInvoiceRequestFeatures Bolt12Invoice_invoice_request_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Checks if two BlindedHopFeaturess 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 quantity of items requested or refunded for.
+ *
+ * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
  */
-bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
+MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Checks if two ChannelTypeFeaturess 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.
+ * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
+ * refund in case there are no [`message_paths`].
+ *
+ * [`message_paths`]: Self::message_paths
  */
-bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
+MUST_USE_RES struct LDKPublicKey Bolt12Invoice_payer_id(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the InitFeatures
+ * A payer-provided note reflected back in the invoice.
+ *
+ * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
+MUST_USE_RES struct LDKPrintableString Bolt12Invoice_payer_note(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the NodeFeatures
+ * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
  */
-struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
+MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the ChannelFeatures
+ * The minimum amount required for a successful payment of the invoice.
  */
-struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
+MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the Bolt11InvoiceFeatures
+ * Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`].
  */
-struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig);
+MUST_USE_RES struct LDKSchnorrSignature Bolt12Invoice_signature(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the OfferFeatures
+ * Hash that was used for signing the invoice.
  */
-struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
+MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the InvoiceRequestFeatures
+ * Verifies that the invoice was for a request or refund created using the given key by
+ * checking the payer metadata from the invoice request.
+ *
+ * Returns the associated [`PaymentId`] to use when sending the payment.
  */
-struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
+MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify_using_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
 
 /**
- * Creates a copy of the Bolt12InvoiceFeatures
+ * Verifies that the invoice was for a request or refund created using the given key by
+ * checking a payment id and nonce included with the [`BlindedMessagePath`] for which the invoice was
+ * sent through.
  */
-struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
+MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify_using_payer_data(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id, struct LDKNonce nonce, const struct LDKExpandedKey *NONNULL_PTR key);
 
 /**
- * Creates a copy of the BlindedHopFeatures
+ * Generates a non-cryptographic 64-bit hash of the Bolt12Invoice.
  */
-struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
+uint64_t Bolt12Invoice_hash(const struct LDKBolt12Invoice *NONNULL_PTR o);
 
 /**
- * Creates a copy of the ChannelTypeFeatures
+ * Serialize the UnsignedBolt12Invoice object into a byte array which can be read by UnsignedBolt12Invoice_read
  */
-struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
+struct LDKCVec_u8Z UnsignedBolt12Invoice_write(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR obj);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the InitFeatures.
+ * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read
  */
-uint64_t InitFeatures_hash(const struct LDKInitFeatures *NONNULL_PTR o);
+struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the NodeFeatures.
+ * Read a Bolt12Invoice from a byte array, created by Bolt12Invoice_write
  */
-uint64_t NodeFeatures_hash(const struct LDKNodeFeatures *NONNULL_PTR o);
+struct LDKCResult_Bolt12InvoiceDecodeErrorZ Bolt12Invoice_read(struct LDKu8slice ser);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ChannelFeatures.
+ * Frees any resources used by the InvoiceError, if is_owned is set and inner is non-NULL.
  */
-uint64_t ChannelFeatures_hash(const struct LDKChannelFeatures *NONNULL_PTR o);
+void InvoiceError_free(struct LDKInvoiceError this_obj);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceFeatures.
+ * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
+ *
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-uint64_t Bolt11InvoiceFeatures_hash(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR o);
+struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the OfferFeatures.
+ * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
+ *
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-uint64_t OfferFeatures_hash(const struct LDKOfferFeatures *NONNULL_PTR o);
+void InvoiceError_set_erroneous_field(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKErroneousField val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the InvoiceRequestFeatures.
+ * An explanation of the error.
  */
-uint64_t InvoiceRequestFeatures_hash(const struct LDKInvoiceRequestFeatures *NONNULL_PTR o);
+struct LDKUntrustedString InvoiceError_get_message(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Bolt12InvoiceFeatures.
+ * An explanation of the error.
  */
-uint64_t Bolt12InvoiceFeatures_hash(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR o);
+void InvoiceError_set_message(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the BlindedHopFeatures.
+ * Constructs a new InvoiceError given each field
+ *
+ * Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-uint64_t BlindedHopFeatures_hash(const struct LDKBlindedHopFeatures *NONNULL_PTR o);
+MUST_USE_RES struct LDKInvoiceError InvoiceError_new(struct LDKErroneousField erroneous_field_arg, struct LDKUntrustedString message_arg);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ChannelTypeFeatures.
+ * Creates a copy of the InvoiceError
  */
-uint64_t ChannelTypeFeatures_hash(const struct LDKChannelTypeFeatures *NONNULL_PTR o);
+struct LDKInvoiceError InvoiceError_clone(const struct LDKInvoiceError *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the ErroneousField, if is_owned is set and inner is non-NULL.
  */
-void InitFeatures_free(struct LDKInitFeatures this_obj);
+void ErroneousField_free(struct LDKErroneousField this_obj);
 
 /**
- * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
+ * The type number of the TLV field containing the error.
  */
-void NodeFeatures_free(struct LDKNodeFeatures this_obj);
+uint64_t ErroneousField_get_tlv_fieldnum(const struct LDKErroneousField *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
+ * The type number of the TLV field containing the error.
  */
-void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
+void ErroneousField_set_tlv_fieldnum(struct LDKErroneousField *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
+ * A value to use for the TLV field to avoid the error.
+ *
+ * Returns a copy of the field.
  */
-void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj);
+struct LDKCOption_CVec_u8ZZ ErroneousField_get_suggested_value(const struct LDKErroneousField *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
+ * A value to use for the TLV field to avoid the error.
  */
-void OfferFeatures_free(struct LDKOfferFeatures this_obj);
+void ErroneousField_set_suggested_value(struct LDKErroneousField *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
 
 /**
- * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
+ * Constructs a new ErroneousField given each field
  */
-void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
+MUST_USE_RES struct LDKErroneousField ErroneousField_new(uint64_t tlv_fieldnum_arg, struct LDKCOption_CVec_u8ZZ suggested_value_arg);
 
 /**
- * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the ErroneousField
  */
-void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
+struct LDKErroneousField ErroneousField_clone(const struct LDKErroneousField *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
+ * Creates an [`InvoiceError`] with the given message.
  */
-void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
+MUST_USE_RES struct LDKInvoiceError InvoiceError_from_string(struct LDKStr s);
 
 /**
- * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
+ * Get the string representation of a InvoiceError object
  */
-void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
+struct LDKStr InvoiceError_to_str(const struct LDKInvoiceError *NONNULL_PTR o);
 
 /**
- * Create a blank Features with no features set
+ * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
  */
-MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
+struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj);
 
 /**
- * Returns true if this `Features` object contains required features unknown by `other`.
+ * Read a InvoiceError from a byte array, created by InvoiceError_write
  */
-MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other);
+struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser);
 
 /**
- * Returns true if this `Features` object contains unknown feature flags which are set as
- * \"required\".
+ * Frees any resources used by the InvoiceRequestWithExplicitPayerIdBuilder, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+void InvoiceRequestWithExplicitPayerIdBuilder_free(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_obj);
 
 /**
- * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
- *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * Frees any resources used by the InvoiceRequestWithDerivedPayerIdBuilder, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+void InvoiceRequestWithDerivedPayerIdBuilder_free(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_obj);
 
 /**
- * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
- *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * Builds an unsigned [`InvoiceRequest`] after checking for valid semantics. It can be signed
+ * by [`UnsignedInvoiceRequest::sign`].
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_build(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg);
 
 /**
- * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
+ * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not
+ * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported
+ * by the offer.
  *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * Successive calls to this method will override the previous setting.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_chain(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, enum LDKNetwork network);
 
 /**
- * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
+ * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is
+ * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]).
  *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
+ * Successive calls to this method will override the previous setting.
  *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * [`quantity`]: Self::quantity
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t amount_msats);
 
 /**
- * Create a blank Features with no features set
+ * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity`
+ * does not conform to [`Offer::is_valid_quantity`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
+MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_quantity(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t quantity);
 
 /**
- * Returns true if this `Features` object contains required features unknown by `other`.
+ * Sets the [`InvoiceRequest::payer_note`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other);
+MUST_USE_RES void InvoiceRequestWithExplicitPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, struct LDKStr payer_note);
 
 /**
- * Returns true if this `Features` object contains unknown feature flags which are set as
- * \"required\".
+ * Builds a signed [`InvoiceRequest`] after checking for valid semantics.
  */
-MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg);
 
 /**
- * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
+ * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not
+ * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported
+ * by the offer.
  *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * Successive calls to this method will override the previous setting.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_chain(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, enum LDKNetwork network);
 
 /**
- * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
+ * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is
+ * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]).
  *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
+ * Successive calls to this method will override the previous setting.
  *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * [`quantity`]: Self::quantity
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t amount_msats);
 
 /**
- * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
+ * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity`
+ * does not conform to [`Offer::is_valid_quantity`].
  *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * Successive calls to this method will override the previous setting.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_quantity(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t quantity);
 
 /**
- * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
- *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
+ * Sets the [`InvoiceRequest::payer_note`].
  *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * Successive calls to this method will override the previous setting.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES void InvoiceRequestWithDerivedPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, struct LDKStr payer_note);
 
 /**
- * Create a blank Features with no features set
+ * Frees any resources used by the UnsignedInvoiceRequest, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
+void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj);
 
 /**
- * Returns true if this `Features` object contains required features unknown by `other`.
+ * Creates a copy of the UnsignedInvoiceRequest
  */
-MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other);
+struct LDKUnsignedInvoiceRequest UnsignedInvoiceRequest_clone(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR orig);
 
 /**
- * Returns true if this `Features` object contains unknown feature flags which are set as
- * \"required\".
+ * Calls the free function if one is set
  */
-MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
+void SignInvoiceRequestFn_free(struct LDKSignInvoiceRequestFn this_ptr);
 
 /**
- * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
- *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * Returns the [`TaggedHash`] of the invoice to sign.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKTaggedHash UnsignedInvoiceRequest_tagged_hash(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
- *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * Frees any resources used by the InvoiceRequest, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+void InvoiceRequest_free(struct LDKInvoiceRequest this_obj);
 
 /**
- * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
- *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * Creates a copy of the InvoiceRequest
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig);
 
 /**
- * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
- *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
- *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * Frees any resources used by the VerifiedInvoiceRequest, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+void VerifiedInvoiceRequest_free(struct LDKVerifiedInvoiceRequest this_obj);
 
 /**
- * Create a blank Features with no features set
+ * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made.
  */
-MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void);
+struct LDKOfferId VerifiedInvoiceRequest_get_offer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
 
 /**
- * Returns true if this `Features` object contains required features unknown by `other`.
+ * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made.
  */
-MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other);
+void VerifiedInvoiceRequest_set_offer_id(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKOfferId val);
 
 /**
- * Returns true if this `Features` object contains unknown feature flags which are set as
- * \"required\".
+ * Creates a copy of the VerifiedInvoiceRequest
  */
-MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+struct LDKVerifiedInvoiceRequest VerifiedInvoiceRequest_clone(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR orig);
 
 /**
- * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
- *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
+ * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
+ * for the selected chain.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ UnsignedInvoiceRequest_chains(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
- *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * Opaque bytes set by the originator. Useful for authentication and validating fields since it
+ * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedInvoiceRequest_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
- *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * The minimum amount required for a successful payment of a single item.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCOption_AmountZ UnsignedInvoiceRequest_amount(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
- *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
+ * A complete description of the purpose of the payment. Intended to be displayed to the user
+ * but with the caveat that it has not been verified in any way.
  *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
- */
-MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
-
-/**
- * Create a blank Features with no features set
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
+MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_description(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Returns true if this `Features` object contains required features unknown by `other`.
+ * Features pertaining to the offer.
  */
-MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other);
+MUST_USE_RES struct LDKOfferFeatures UnsignedInvoiceRequest_offer_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Returns true if this `Features` object contains unknown feature flags which are set as
- * \"required\".
+ * Duration since the Unix epoch when an invoice should no longer be requested.
+ *
+ * If `None`, the offer does not expire.
  */
-MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_absolute_expiry(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
+ * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
+ * displayed to the user but with the caveat that it has not been verified in any way.
  *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_issuer(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
- *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
+ * recipient privacy by obfuscating its node id.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCVec_BlindedMessagePathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
- *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * The quantity of items supported.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKQuantity UnsignedInvoiceRequest_supported_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
- *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
+ * The public key used by the recipient to sign invoices.
  *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Create a blank Features with no features set
+ * An unpredictable series of bytes, typically containing information about the derivation of
+ * [`payer_id`].
+ *
+ * [`payer_id`]: Self::payer_id
  */
-MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
+MUST_USE_RES struct LDKu8slice UnsignedInvoiceRequest_payer_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Returns true if this `Features` object contains required features unknown by `other`.
+ * A chain from [`Offer::chains`] that the offer is valid for.
  */
-MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other);
+MUST_USE_RES struct LDKThirtyTwoBytes UnsignedInvoiceRequest_chain(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Returns true if this `Features` object contains unknown feature flags which are set as
- * \"required\".
+ * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
+ * must be greater than or equal to [`Offer::amount`], converted if necessary.
+ *
+ * [`chain`]: Self::chain
  */
-MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_amount_msats(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
- *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * Features pertaining to requesting an invoice.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedInvoiceRequest_invoice_request_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
- *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
- *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * A possibly transient pubkey used to sign the invoice request.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_payer_id(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
- *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
+ * A payer-provided note which will be seen by the recipient and reflected back in the invoice
+ * response.
  *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_payer_note(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Create a blank Features with no features set
+ * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
+ * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
+ * for the selected chain.
  */
-MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
+MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ InvoiceRequest_chains(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Returns true if this `Features` object contains required features unknown by `other`.
+ * Opaque bytes set by the originator. Useful for authentication and validating fields since it
+ * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
  */
-MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other);
+MUST_USE_RES struct LDKCOption_CVec_u8ZZ InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Returns true if this `Features` object contains unknown feature flags which are set as
- * \"required\".
+ * The minimum amount required for a successful payment of a single item.
  */
-MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_AmountZ InvoiceRequest_amount(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
+ * A complete description of the purpose of the payment. Intended to be displayed to the user
+ * but with the caveat that it has not been verified in any way.
  *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKPrintableString InvoiceRequest_description(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
- *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * Features pertaining to the offer.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKOfferFeatures InvoiceRequest_offer_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
+ * Duration since the Unix epoch when an invoice should no longer be requested.
  *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * If `None`, the offer does not expire.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_absolute_expiry(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
- *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
+ * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
+ * displayed to the user but with the caveat that it has not been verified in any way.
  *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
- */
-MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
-
-/**
- * Create a blank Features with no features set
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
+MUST_USE_RES struct LDKPrintableString InvoiceRequest_issuer(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Returns true if this `Features` object contains required features unknown by `other`.
+ * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
+ * recipient privacy by obfuscating its node id.
  */
-MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other);
+MUST_USE_RES struct LDKCVec_BlindedMessagePathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Returns true if this `Features` object contains unknown feature flags which are set as
- * \"required\".
+ * The quantity of items supported.
  */
-MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKQuantity InvoiceRequest_supported_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
+ * The public key used by the recipient to sign invoices.
  *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKPublicKey InvoiceRequest_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
+ * An unpredictable series of bytes, typically containing information about the derivation of
+ * [`payer_id`].
  *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * [`payer_id`]: Self::payer_id
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKu8slice InvoiceRequest_payer_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
- *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * A chain from [`Offer::chains`] that the offer is valid for.
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
- *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
+ * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
+ * must be greater than or equal to [`Offer::amount`], converted if necessary.
  *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * [`chain`]: Self::chain
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Create a blank Features with no features set
+ * Features pertaining to requesting an invoice.
  */
-MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
+MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_invoice_request_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Returns true if this `Features` object contains required features unknown by `other`.
+ * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
  */
-MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other);
+MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Returns true if this `Features` object contains unknown feature flags which are set as
- * \"required\".
+ * A possibly transient pubkey used to sign the invoice request.
  */
-MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
- *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
+ * A payer-provided note which will be seen by the recipient and reflected back in the invoice
+ * response.
  *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
- * by [BOLT 9].
+ * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the
+ * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time.
  *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
+ * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned
+ * creation time is used for the `created_at` parameter.
  *
- * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+ * [`Duration`]: core::time::Duration
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash);
 
 /**
- * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
+ * Creates an [`InvoiceBuilder`] for the request with the given required fields.
  *
- * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
- * be set instead (i.e., `bit - 1`).
+ * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after
+ * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds
+ * where [`std::time::SystemTime`] is not available.
  *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment
+ * for the invoice.
+ *
+ * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It
+ * must contain one or more elements ordered from most-preferred to least-preferred, if there's
+ * a preference. Note, however, that any privacy is lost if a public node id was used for
+ * [`Offer::signing_pubkey`].
+ *
+ * Errors if the request contains unknown required features.
+ *
+ * # Note
+ *
+ * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`],
+ * then first use [`InvoiceRequest::verify_using_metadata`] or
+ * [`InvoiceRequest::verify_using_recipient_data`] and then [`VerifiedInvoiceRequest`] methods
+ * instead.
+ *
+ * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at
+ * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with_no_std(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
 
 /**
- * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
- * by [bLIP 2] or if it is a known `T` feature.
+ * Verifies that the request was for an offer created using the given key by checking the
+ * metadata from the offer.
  *
- * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
- * set instead (i.e., `bit + 1`).
+ * Returns the verified request which contains the derived keys needed to sign a
+ * [`Bolt12Invoice`] for the request if they could be extracted from the metadata.
  *
- * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
  */
-MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
+MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify_using_metadata(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
 
 /**
- * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
+ * Verifies that the request was for an offer created using the given key by checking a nonce
+ * included with the [`BlindedMessagePath`] for which the request was sent through.
+ *
+ * Returns the verified request which contains the derived keys needed to sign a
+ * [`Bolt12Invoice`] for the request if they could be extracted from the metadata.
+ *
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
  */
-struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
+MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify_using_recipient_data(struct LDKInvoiceRequest this_arg, struct LDKNonce nonce, const struct LDKExpandedKey *NONNULL_PTR key);
 
 /**
- * Read a InitFeatures from a byte array, created by InitFeatures_write
+ * Signature of the invoice request using [`payer_id`].
+ *
+ * [`payer_id`]: Self::payer_id
  */
-struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
+ * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
+ * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
+ * for the selected chain.
  */
-struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
+MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ VerifiedInvoiceRequest_chains(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
+ * Opaque bytes set by the originator. Useful for authentication and validating fields since it
+ * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
  */
-struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKCOption_CVec_u8ZZ VerifiedInvoiceRequest_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
+ * The minimum amount required for a successful payment of a single item.
  */
-struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
+MUST_USE_RES struct LDKCOption_AmountZ VerifiedInvoiceRequest_amount(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Read a NodeFeatures from a byte array, created by NodeFeatures_write
+ * A complete description of the purpose of the payment. Intended to be displayed to the user
+ * but with the caveat that it has not been verified in any way.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_description(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
+ * Features pertaining to the offer.
  */
-struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj);
+MUST_USE_RES struct LDKOfferFeatures VerifiedInvoiceRequest_offer_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
+ * Duration since the Unix epoch when an invoice should no longer be requested.
+ *
+ * If `None`, the offer does not expire.
  */
-struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_absolute_expiry(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
+ * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
+ * displayed to the user but with the caveat that it has not been verified in any way.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj);
+MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_issuer(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
+ * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
+ * recipient privacy by obfuscating its node id.
  */
-struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKCVec_BlindedMessagePathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
+ * The quantity of items supported.
  */
-struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
+MUST_USE_RES struct LDKQuantity VerifiedInvoiceRequest_supported_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
+ * The public key used by the recipient to sign invoices.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
+ * An unpredictable series of bytes, typically containing information about the derivation of
+ * [`payer_id`].
+ *
+ * [`payer_id`]: Self::payer_id
  */
-struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
+MUST_USE_RES struct LDKu8slice VerifiedInvoiceRequest_payer_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
+ * A chain from [`Offer::chains`] that the offer is valid for.
  */
-struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKThirtyTwoBytes VerifiedInvoiceRequest_chain(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as optional.
+ * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
+ * must be greater than or equal to [`Offer::amount`], converted if necessary.
+ *
+ * [`chain`]: Self::chain
  */
-void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_amount_msats(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as required.
+ * Features pertaining to requesting an invoice.
  */
-void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKInvoiceRequestFeatures VerifiedInvoiceRequest_invoice_request_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Checks if this feature is supported.
+ * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
  */
-MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as optional.
+ * A possibly transient pubkey used to sign the invoice request.
  */
-void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_payer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as required.
+ * A payer-provided note which will be seen by the recipient and reflected back in the invoice
+ * response.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_payer_note(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
 
 /**
- * Checks if this feature is supported.
+ * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the
+ * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time.
+ *
+ * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned
+ * creation time is used for the `created_at` parameter.
+ *
+ * [`Duration`]: core::time::Duration
  */
-MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash);
 
 /**
- * Checks if this feature is required.
+ * Creates an [`InvoiceBuilder`] for the request with the given required fields.
+ *
+ * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after
+ * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds
+ * where [`std::time::SystemTime`] is not available.
+ *
+ * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment
+ * for the invoice.
+ *
+ * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It
+ * must contain one or more elements ordered from most-preferred to least-preferred, if there's
+ * a preference. Note, however, that any privacy is lost if a public node id was used for
+ * [`Offer::signing_pubkey`].
+ *
+ * Errors if the request contains unknown required features.
+ *
+ * # Note
+ *
+ * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`],
+ * then first use [`InvoiceRequest::verify_using_metadata`] or
+ * [`InvoiceRequest::verify_using_recipient_data`] and then [`VerifiedInvoiceRequest`] methods
+ * instead.
+ *
+ * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at
+ * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey
  */
-MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
 
 /**
- * Checks if this feature is required.
+ * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses
+ * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use
+ * the same [`ExpandedKey`] as the one used to create the offer.
+ *
+ * See [`InvoiceRequest::respond_with`] for further details.
+ *
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
  */
-MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash);
 
 /**
- * Set this feature as optional.
+ * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses
+ * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use
+ * the same [`ExpandedKey`] as the one used to create the offer.
+ *
+ * See [`InvoiceRequest::respond_with_no_std`] for further details.
+ *
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
  */
-void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
 
 /**
- * Set this feature as required.
+ * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
  */
-void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj);
 
 /**
- * Checks if this feature is supported.
+ * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read
  */
-MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);
 
 /**
- * Set this feature as optional.
+ * Frees any resources used by the InvoiceRequestFields, if is_owned is set and inner is non-NULL.
  */
-void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+void InvoiceRequestFields_free(struct LDKInvoiceRequestFields this_obj);
 
 /**
- * Set this feature as required.
+ * A possibly transient pubkey used to sign the invoice request.
  */
-void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKPublicKey InvoiceRequestFields_get_payer_id(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
 
 /**
- * Checks if this feature is supported.
+ * A possibly transient pubkey used to sign the invoice request.
  */
-MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+void InvoiceRequestFields_set_payer_id(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Set this feature as optional.
+ * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
  */
-void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKCOption_u64Z InvoiceRequestFields_get_quantity(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
 
 /**
- * Set this feature as required.
+ * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
  */
-void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void InvoiceRequestFields_set_quantity(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
 
 /**
- * Checks if this feature is supported.
+ * A payer-provided note which will be seen by the recipient and reflected back in the invoice
+ * response. Truncated to [`PAYER_NOTE_LIMIT`] characters.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKUntrustedString InvoiceRequestFields_get_payer_note_truncated(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
 
 /**
- * Checks if this feature is required.
+ * A payer-provided note which will be seen by the recipient and reflected back in the invoice
+ * response. Truncated to [`PAYER_NOTE_LIMIT`] characters.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+void InvoiceRequestFields_set_payer_note_truncated(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
 
 /**
- * Checks if this feature is required.
+ * Constructs a new InvoiceRequestFields given each field
+ *
+ * Note that payer_note_truncated_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKInvoiceRequestFields InvoiceRequestFields_new(struct LDKPublicKey payer_id_arg, struct LDKCOption_u64Z quantity_arg, struct LDKUntrustedString payer_note_truncated_arg);
 
 /**
- * Set this feature as optional.
+ * Creates a copy of the InvoiceRequestFields
  */
-void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKInvoiceRequestFields InvoiceRequestFields_clone(const struct LDKInvoiceRequestFields *NONNULL_PTR orig);
 
 /**
- * Set this feature as required.
+ * Checks if two InvoiceRequestFieldss 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 InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+bool InvoiceRequestFields_eq(const struct LDKInvoiceRequestFields *NONNULL_PTR a, const struct LDKInvoiceRequestFields *NONNULL_PTR b);
 
 /**
- * Checks if this feature is supported.
+ * Serialize the InvoiceRequestFields object into a byte array which can be read by InvoiceRequestFields_read
  */
-MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z InvoiceRequestFields_write(const struct LDKInvoiceRequestFields *NONNULL_PTR obj);
 
 /**
- * Set this feature as optional.
+ * Read a InvoiceRequestFields from a byte array, created by InvoiceRequestFields_write
  */
-void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ InvoiceRequestFields_read(struct LDKu8slice ser);
 
 /**
- * Set this feature as required.
+ * Frees any resources used by the TaggedHash, if is_owned is set and inner is non-NULL.
  */
-void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void TaggedHash_free(struct LDKTaggedHash this_obj);
 
 /**
- * Checks if this feature is supported.
+ * Creates a copy of the TaggedHash
  */
-MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKTaggedHash TaggedHash_clone(const struct LDKTaggedHash *NONNULL_PTR orig);
 
 /**
- * Checks if this feature is required.
+ * Returns the digest to sign.
  */
-MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES const uint8_t (*TaggedHash_as_digest(const struct LDKTaggedHash *NONNULL_PTR this_arg))[32];
 
 /**
- * Checks if this feature is required.
+ * Returns the tag used in the tagged hash.
  */
-MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKStr TaggedHash_tag(const struct LDKTaggedHash *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as optional.
+ * Returns the merkle root used in the tagged hash.
  */
-void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKThirtyTwoBytes TaggedHash_merkle_root(const struct LDKTaggedHash *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as required.
+ * Frees any resources used by the SignError
  */
-void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+void SignError_free(struct LDKSignError this_ptr);
 
 /**
- * Checks if this feature is supported.
+ * Creates a copy of the SignError
  */
-MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKSignError SignError_clone(const struct LDKSignError *NONNULL_PTR orig);
 
 /**
- * Set this feature as optional.
+ * Utility method to constructs a new Signing-variant SignError
  */
-void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKSignError SignError_signing(void);
 
 /**
- * Set this feature as required.
+ * Utility method to constructs a new Verification-variant SignError
  */
-void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKSignError SignError_verification(enum LDKSecp256k1Error a);
 
 /**
- * Checks if this feature is supported.
+ * Frees any resources used by the Nonce, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void Nonce_free(struct LDKNonce this_obj);
 
 /**
- * Set this feature as optional.
+ * Creates a copy of the Nonce
  */
-void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+struct LDKNonce Nonce_clone(const struct LDKNonce *NONNULL_PTR orig);
 
 /**
- * Set this feature as required.
+ * Checks if two Nonces 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 Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+bool Nonce_eq(const struct LDKNonce *NONNULL_PTR a, const struct LDKNonce *NONNULL_PTR b);
 
 /**
- * Checks if this feature is supported.
+ * Creates a `Nonce` from the given [`EntropySource`].
  */
-MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKNonce Nonce_from_entropy_source(struct LDKEntropySource entropy_source);
 
 /**
- * Checks if this feature is required.
+ * Returns a slice of the underlying bytes of size [`Nonce::LENGTH`].
  */
-MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKu8slice Nonce_as_slice(const struct LDKNonce *NONNULL_PTR this_arg);
 
 /**
- * Checks if this feature is required.
+ * Serialize the Nonce object into a byte array which can be read by Nonce_read
  */
-MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z Nonce_write(const struct LDKNonce *NONNULL_PTR obj);
 
 /**
- * Checks if this feature is required.
+ * Read a Nonce from a byte array, created by Nonce_write
  */
-MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+struct LDKCResult_NonceDecodeErrorZ Nonce_read(struct LDKu8slice ser);
 
 /**
- * Set this feature as optional.
+ * Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
  */
-void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj);
 
 /**
- * Set this feature as required.
+ * Creates a copy of the Bolt12ParseError
  */
-void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKBolt12ParseError Bolt12ParseError_clone(const struct LDKBolt12ParseError *NONNULL_PTR orig);
 
 /**
- * Checks if this feature is supported.
+ * Creates a copy of the Bolt12SemanticError
  */
-MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_clone(const enum LDKBolt12SemanticError *NONNULL_PTR orig);
 
 /**
- * Set this feature as optional.
+ * Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
  */
-void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_already_expired(void);
 
 /**
- * Set this feature as required.
+ * Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
  */
-void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_chain(void);
 
 /**
- * Checks if this feature is supported.
+ * Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
  */
-MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_chain(void);
 
 /**
- * Set this feature as optional.
+ * Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
  */
-void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_missing_amount(void);
 
 /**
- * Set this feature as required.
+ * Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
  */
-void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_invalid_amount(void);
 
 /**
- * Checks if this feature is supported.
+ * Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
  */
-MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_insufficient_amount(void);
 
 /**
- * Checks if this feature is required.
+ * Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
  */
-MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_amount(void);
 
 /**
- * Checks if this feature is required.
+ * Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
  */
-MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_currency(void);
 
 /**
- * Checks if this feature is required.
+ * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
  */
-MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_unknown_required_features(void);
 
 /**
- * Set this feature as optional.
+ * Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
  */
-void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_features(void);
 
 /**
- * Set this feature as required.
+ * Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
  */
-void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void);
 
 /**
- * Checks if this feature is supported.
+ * Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
  */
-MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void);
 
 /**
- * Set this feature as optional.
+ * Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
  */
-void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void);
 
 /**
- * Set this feature as required.
+ * Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
  */
-void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void);
 
 /**
- * Checks if this feature is supported.
+ * Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
  */
-MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void);
 
 /**
- * Set this feature as optional.
+ * Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
  */
-void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void);
 
 /**
- * Set this feature as required.
+ * Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
  */
-void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_quantity(void);
 
 /**
- * Checks if this feature is supported.
+ * Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
  */
-MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_invalid_metadata(void);
 
 /**
- * Checks if this feature is required.
+ * Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
  */
-MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_metadata(void);
 
 /**
- * Checks if this feature is required.
+ * Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
  */
-MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void);
 
 /**
- * Checks if this feature is required.
+ * Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
  */
-MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void);
 
 /**
- * Set this feature as optional.
+ * Utility method to constructs a new DuplicatePaymentId-variant Bolt12SemanticError
  */
-void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_duplicate_payment_id(void);
 
 /**
- * Set this feature as required.
+ * Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
  */
-void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void);
 
 /**
- * Checks if this feature is supported.
+ * Utility method to constructs a new UnexpectedPaths-variant Bolt12SemanticError
  */
-MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_paths(void);
 
 /**
- * Set this feature as optional.
+ * Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
  */
-void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void);
 
 /**
- * Set this feature as required.
+ * Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
  */
-void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void);
 
 /**
- * Checks if this feature is supported.
+ * Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
  */
-MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void);
 
 /**
- * Set this feature as optional.
+ * Utility method to constructs a new UnexpectedPaymentHash-variant Bolt12SemanticError
  */
-void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_payment_hash(void);
 
 /**
- * Set this feature as required.
+ * Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
  */
-void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void);
 
 /**
- * Checks if this feature is supported.
+ * Frees any resources used by the RefundMaybeWithDerivedMetadataBuilder, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+void RefundMaybeWithDerivedMetadataBuilder_free(struct LDKRefundMaybeWithDerivedMetadataBuilder this_obj);
 
 /**
- * Set this feature as optional.
+ * Creates a copy of the RefundMaybeWithDerivedMetadataBuilder
  */
-void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
+struct LDKRefundMaybeWithDerivedMetadataBuilder RefundMaybeWithDerivedMetadataBuilder_clone(const struct LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR orig);
 
 /**
- * Set this feature as required.
+ * Creates a new builder for a refund using the [`Refund::payer_id`] for the public node id to
+ * send to if no [`Refund::paths`] are set. Otherwise, it may be a transient pubkey.
+ *
+ * Additionally, sets the required (empty) [`Refund::description`], [`Refund::payer_metadata`],
+ * and [`Refund::amount_msats`].
+ *
+ * # Note
+ *
+ * If constructing a [`Refund`] for use with a [`ChannelManager`], use
+ * [`ChannelManager::create_refund_builder`] instead of [`RefundBuilder::new`].
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [`ChannelManager::create_refund_builder`]: crate::ln::channelmanager::ChannelManager::create_refund_builder
  */
-void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_new(struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id, uint64_t amount_msats);
 
 /**
- * Checks if this feature is supported.
+ * Similar to [`RefundBuilder::new`] except, if [`RefundBuilder::path`] is called, the payer id
+ * is derived from the given [`ExpandedKey`] and nonce. This provides sender privacy by using a
+ * different payer id for each refund, assuming a different nonce is used.  Otherwise, the
+ * provided `node_id` is used for the payer id.
+ *
+ * Also, sets the metadata when [`RefundBuilder::build`] is called such that it can be used by
+ * [`Bolt12Invoice::verify_using_metadata`] to determine if the invoice was produced for the
+ * refund given an [`ExpandedKey`]. However, if [`RefundBuilder::path`] is called, then the
+ * metadata must be included in each [`BlindedMessagePath`] instead. In this case, use
+ * [`Bolt12Invoice::verify_using_payer_data`].
+ *
+ * The `payment_id` is encrypted in the metadata and should be unique. This ensures that only
+ * one invoice will be paid for the refund and that payments can be uniquely identified.
+ *
+ * [`Bolt12Invoice::verify_using_metadata`]: crate::offers::invoice::Bolt12Invoice::verify_using_metadata
+ * [`Bolt12Invoice::verify_using_payer_data`]: crate::offers::invoice::Bolt12Invoice::verify_using_payer_data
+ * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
  */
-MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKNonce nonce, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id);
 
 /**
- * Checks if this feature is required.
+ * Sets the [`Refund::description`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_description(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr description);
 
 /**
- * Checks if this feature is required.
+ * Sets the [`Refund::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
+ * already passed is valid and can be checked for using [`Refund::is_expired`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t absolute_expiry);
 
 /**
- * Checks if this feature is required.
+ * Sets the [`Refund::issuer`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_issuer(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr issuer);
 
 /**
- * Checks if this feature is required.
+ * Adds a blinded path to [`Refund::paths`]. Must include at least one path if only connected
+ * by private channels or if [`Refund::payer_id`] is not a public node id.
+ *
+ * Successive calls to this method will add another blinded path. Caller is responsible for not
+ * adding duplicate paths.
  */
-MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_path(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKBlindedMessagePath path);
 
 /**
- * Set this feature as optional.
+ * Sets the [`Refund::chain`] of the given [`Network`] for paying an invoice. If not
+ * called, [`Network::Bitcoin`] is assumed.
+ *
+ * Successive calls to this method will override the previous setting.
  */
-void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_chain(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, enum LDKNetwork network);
 
 /**
- * Set this feature as required.
+ * Sets [`Refund::quantity`] of items. This is purely for informational purposes. It is useful
+ * when the refund pertains to a [`Bolt12Invoice`] that paid for more than one item from an
+ * [`Offer`] as specified by [`InvoiceRequest::quantity`].
+ *
+ * Successive calls to this method will override the previous setting.
+ *
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
+ * [`Offer`]: crate::offers::offer::Offer
  */
-void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_quantity(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t quantity);
 
 /**
- * Checks if this feature is supported.
+ * Sets the [`Refund::payer_note`].
+ *
+ * Successive calls to this method will override the previous setting.
  */
-MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_payer_note(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr payer_note);
 
 /**
- * Set this feature as optional.
+ * Builds a [`Refund`] after checking for valid semantics.
  */
-void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_RefundBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_build(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg);
 
 /**
- * Set this feature as required.
+ * Frees any resources used by the Refund, if is_owned is set and inner is non-NULL.
  */
-void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void Refund_free(struct LDKRefund this_obj);
 
 /**
- * Checks if this feature is supported.
+ * Creates a copy of the Refund
  */
-MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig);
 
 /**
- * Checks if this feature is required.
+ * A complete description of the purpose of the refund. Intended to be displayed to the user
+ * but with the caveat that it has not been verified in any way.
  */
-MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg);
 
 /**
- * Checks if this feature is required.
+ * Duration since the Unix epoch when an invoice should no longer be sent.
+ *
+ * If `None`, the refund does not expire.
  */
-MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_u64Z Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as optional.
+ * Whether the refund has expired.
  */
-void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as required.
+ * Whether the refund has expired given the duration since the Unix epoch.
  */
-void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES bool Refund_is_expired_no_std(const struct LDKRefund *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
 
 /**
- * Checks if this feature is supported.
+ * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
+ * displayed to the user but with the caveat that it has not been verified in any way.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as optional.
+ * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender
+ * privacy by obfuscating its node id.
  */
-void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCVec_BlindedMessagePathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as required.
+ * An unpredictable series of bytes, typically containing information about the derivation of
+ * [`payer_id`].
+ *
+ * [`payer_id`]: Self::payer_id
  */
-void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKu8slice Refund_payer_metadata(const struct LDKRefund *NONNULL_PTR this_arg);
 
 /**
- * Checks if this feature is supported.
+ * A chain that the refund is valid for.
  */
-MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as optional.
+ * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]).
+ *
+ * [`chain`]: Self::chain
  */
-void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as required.
+ * Features pertaining to requesting an invoice.
  */
-void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg);
 
 /**
- * Checks if this feature is supported.
+ * The quantity of an item that refund is for.
  */
-MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg);
 
 /**
- * Checks if this feature is required.
+ * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly
+ * transient pubkey.
+ *
+ * [`paths`]: Self::paths
  */
-MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg);
 
 /**
- * Checks if this feature is required.
+ * Payer provided note to include 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 bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg);
 
 /**
- * Checks if this feature is required.
+ * Generates a non-cryptographic 64-bit hash of the Refund.
  */
-MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+uint64_t Refund_hash(const struct LDKRefund *NONNULL_PTR o);
 
 /**
- * Set this feature as optional.
+ * Read a Refund from a byte array, created by Refund_write
  */
-void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKCResult_RefundDecodeErrorZ Refund_read(struct LDKu8slice ser);
 
 /**
- * Set this feature as required.
+ * Serialize the Refund object into a byte array which can be read by Refund_read
  */
-void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj);
 
 /**
- * Checks if this feature is supported.
+ * Read a Refund object from a string
  */
-MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s);
 
 /**
- * Set this feature as optional.
+ * Get the string representation of a Refund object
  */
-void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKStr Refund_to_str(const struct LDKRefund *NONNULL_PTR o);
 
 /**
- * Set this feature as required.
+ * Creates a copy of the UtxoLookupError
  */
-void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
 
 /**
- * Checks if this feature is supported.
+ * Utility method to constructs a new UnknownChain-variant UtxoLookupError
  */
-MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
 
 /**
- * Set this feature as optional.
+ * Utility method to constructs a new UnknownTx-variant UtxoLookupError
  */
-void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
 
 /**
- * Set this feature as required.
+ * Frees any resources used by the UtxoResult
  */
-void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+void UtxoResult_free(struct LDKUtxoResult this_ptr);
 
 /**
- * Checks if this feature is supported.
+ * Creates a copy of the UtxoResult
  */
-MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
 
 /**
- * Checks if this feature is required.
+ * Utility method to constructs a new Sync-variant UtxoResult
  */
-MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
 
 /**
- * Checks if this feature is required.
+ * Utility method to constructs a new Async-variant UtxoResult
  */
-MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
 
 /**
- * Checks if this feature is required.
+ * Calls the free function if one is set
  */
-MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
 
 /**
- * Set this feature as optional.
+ * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
  */
-void InitFeatures_set_route_blinding_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+void UtxoFuture_free(struct LDKUtxoFuture this_obj);
 
 /**
- * Set this feature as required.
+ * Creates a copy of the UtxoFuture
  */
-void InitFeatures_set_route_blinding_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
 
 /**
- * Checks if this feature is supported.
+ * Builds a new future for later resolution.
  */
-MUST_USE_RES bool InitFeatures_supports_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
 
 /**
- * Set this feature as optional.
+ * Resolves this future against the given `graph` and with the given `result`.
+ *
+ * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
+ * forwarding the validated gossip message onwards to peers.
+ *
+ * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
+ * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
+ * after this.
+ *
+ * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
+ * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
  */
-void NodeFeatures_set_route_blinding_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
 
 /**
- * Set this feature as required.
+ * Resolves this future against the given `graph` and with the given `result`.
+ *
+ * The given `gossip` is used to broadcast any validated messages onwards to all peers which
+ * have available buffer space.
+ *
+ * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
+ * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
+ * after this.
+ *
+ * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
+ * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
  */
-void NodeFeatures_set_route_blinding_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void UtxoFuture_resolve(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, const struct LDKP2PGossipSync *NONNULL_PTR gossip, struct LDKCResult_TxOutUtxoLookupErrorZ result);
 
 /**
- * Checks if this feature is supported.
+ * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES bool NodeFeatures_supports_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void NodeId_free(struct LDKNodeId this_obj);
 
 /**
- * Checks if this feature is required.
+ * Creates a copy of the NodeId
  */
-MUST_USE_RES bool InitFeatures_requires_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
 
 /**
- * Checks if this feature is required.
+ * Checks if two NodeIds 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.
  */
-MUST_USE_RES bool NodeFeatures_requires_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+bool NodeId_eq(const struct LDKNodeId *NONNULL_PTR a, const struct LDKNodeId *NONNULL_PTR b);
 
 /**
- * Set this feature as optional.
+ * Create a new NodeId from a public key
  */
-void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
 
 /**
- * Set this feature as required.
+ * Create a new NodeId from a slice of bytes
  */
-void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_NodeIdDecodeErrorZ NodeId_from_slice(struct LDKu8slice bytes);
 
 /**
- * Checks if this feature is supported.
+ * Get the public key slice from this NodeId
  */
-MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as optional.
+ * Get the public key as an array from this NodeId
  */
-void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES const uint8_t (*NodeId_as_array(const struct LDKNodeId *NONNULL_PTR this_arg))[33];
 
 /**
- * Set this feature as required.
+ * Get the public key from this NodeId
  */
-void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_PublicKeySecp256k1ErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg);
 
 /**
- * Checks if this feature is supported.
+ * Get the string representation of a NodeId object
  */
-MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKStr NodeId_to_str(const struct LDKNodeId *NONNULL_PTR o);
 
 /**
- * Checks if this feature is required.
+ * Generates a non-cryptographic 64-bit hash of the NodeId.
  */
-MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
 
 /**
- * Checks if this feature is required.
+ * Serialize the NodeId object into a byte array which can be read by NodeId_read
  */
-MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
 
 /**
- * Set this feature as optional.
+ * Read a NodeId from a byte array, created by NodeId_write
  */
-void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
 
 /**
- * Set this feature as required.
+ * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
  */
-void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+void NetworkGraph_free(struct LDKNetworkGraph this_obj);
 
 /**
- * Checks if this feature is supported.
+ * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
 
 /**
- * Set this feature as optional.
+ * Frees any resources used by the NetworkUpdate
  */
-void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
 
 /**
- * Set this feature as required.
+ * Creates a copy of the NetworkUpdate
  */
-void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
 
 /**
- * Checks if this feature is supported.
+ * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
  */
-MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
 
 /**
- * Set this feature as optional.
+ * Utility method to constructs a new NodeFailure-variant NetworkUpdate
  */
-void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
 
 /**
- * Set this feature as required.
+ * Checks if two NetworkUpdates contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
 
 /**
- * Checks if this feature is supported.
+ * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
  */
-MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
 
 /**
- * Checks if this feature is required.
+ * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
  */
-MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
 
 /**
- * Checks if this feature is required.
+ * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
 
 /**
- * Checks if this feature is required.
+ * Creates a new tracker of the actual state of the network of channels and nodes,
+ * assuming an existing [`NetworkGraph`].
+ * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
+ * correct, and the announcement is signed with channel owners' keys.
  */
-MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
 
 /**
- * Set this feature as optional.
+ * 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 InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+void P2PGossipSync_add_utxo_lookup(const struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
 
 /**
- * Set this feature as required.
+ * Handles any network updates originating from [`Event`]s.
+ *
+ * [`Event`]: crate::events::Event
  */
-void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
 
 /**
- * Checks if this feature is supported.
+ * Gets the chain hash for this network graph.
  */
-MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKThirtyTwoBytes NetworkGraph_get_chain_hash(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as optional.
+ * Verifies the signature of a [`NodeAnnouncement`].
+ *
+ * Returns an error if it is invalid.
  */
-void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKCResult_NoneLightningErrorZ verify_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg);
 
 /**
- * Set this feature as required.
+ * Verifies all signatures included in a [`ChannelAnnouncement`].
+ *
+ * Returns an error if one of the signatures is invalid.
  */
-void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKCResult_NoneLightningErrorZ verify_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg);
 
 /**
- * Checks if this feature is supported.
+ * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
  */
-MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
 
 /**
- * Checks if this feature is required.
+ * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
  */
-MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
 
 /**
- * Checks if this feature is required.
+ * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
 
 /**
- * Set this feature as optional.
+ * The minimum value, which must be relayed to the next hop via the channel
  */
-void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
 
 /**
- * Set this feature as required.
+ * The minimum value, which must be relayed to the next hop via the channel
  */
-void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Checks if this feature is supported.
+ * The maximum value which may be relayed to the next hop via the channel.
  */
-MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
 
 /**
- * Set this feature as optional.
+ * The maximum value which may be relayed to the next hop via the channel.
  */
-void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Set this feature as required.
+ * Fees charged when the channel is used for routing
  */
-void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
 
 /**
- * Checks if this feature is supported.
+ * Fees charged when the channel is used for routing
  */
-MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
 
 /**
- * Checks if this feature is required.
+ * When the last update to the channel direction was issued.
+ * Value is opaque, as set in the announcement.
  */
-MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
 
 /**
- * Checks if this feature is required.
+ * When the last update to the channel direction was issued.
+ * Value is opaque, as set in the announcement.
  */
-MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Set this feature as optional.
+ * The difference in CLTV values that you must have when routing through this channel.
  */
-void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
 
 /**
- * Set this feature as required.
+ * The difference in CLTV values that you must have when routing through this channel.
  */
-void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
- * Checks if this feature is supported.
+ * Whether the channel can be currently used for payments (in this one direction).
  */
-MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
 
 /**
- * Set this feature as optional.
+ * Whether the channel can be currently used for payments (in this one direction).
  */
-void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
 
 /**
- * Set this feature as required.
+ * Most recent update for the channel received from the network
+ * 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
  */
-void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
 
 /**
- * Checks if this feature is supported.
+ * Most recent update for the channel received from the network
+ * 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
  */
-MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
 
 /**
- * Set this feature as optional.
+ * Constructs a new ChannelUpdateInfo given each field
+ *
+ * Note that last_update_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKChannelUpdateInfo ChannelUpdateInfo_new(uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, uint32_t last_update_arg, uint16_t cltv_expiry_delta_arg, bool enabled_arg, struct LDKChannelUpdate last_update_message_arg);
 
 /**
- * Set this feature as required.
+ * Creates a copy of the ChannelUpdateInfo
  */
-void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
 
 /**
- * Checks if this feature is supported.
+ * Checks if two ChannelUpdateInfos 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.
  */
-MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
 
 /**
- * Checks if this feature is required.
+ * Get the string representation of a ChannelUpdateInfo object
  */
-MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKStr ChannelUpdateInfo_to_str(const struct LDKChannelUpdateInfo *NONNULL_PTR o);
 
 /**
- * Checks if this feature is required.
+ * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
  */
-MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
 
 /**
- * Checks if this feature is required.
+ * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
  */
-MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
 
 /**
- * Set this feature as optional.
+ * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
  */
-void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+void ChannelInfo_free(struct LDKChannelInfo this_obj);
 
 /**
- * Set this feature as required.
+ * Protocol features of a channel communicated during its announcement
  */
-void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
 
 /**
- * Checks if this feature is supported.
+ * Protocol features of a channel communicated during its announcement
  */
-MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
 
 /**
- * Checks if this feature is required.
+ * Source node of the first direction of a channel
  */
-MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
 
 /**
- * Set this feature as optional.
+ * Source node of the first direction of a channel
  */
-void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
 
 /**
- * Set this feature as required.
+ * Source node of the second direction of a channel
  */
-void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
 
 /**
- * Checks if this feature is supported.
+ * Source node of the second direction of a channel
  */
-MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
 
 /**
- * Set this feature as optional.
+ * The channel capacity as seen on-chain, if chain lookup is available.
  */
-void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
 
 /**
- * Set this feature as required.
+ * The channel capacity as seen on-chain, if chain lookup is available.
  */
-void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
 
 /**
- * Checks if this feature is supported.
+ * 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
  */
-MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
 
 /**
- * Set this feature as optional.
+ * 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 ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
 
 /**
- * Set this feature as required.
+ * 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
  */
-void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
 
 /**
- * Checks if this feature is supported.
+ * 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
  */
-MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
 
 /**
- * Checks if this feature is required.
+ * An initial announcement of the channel
+ * 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
  */
-MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
 
 /**
- * Checks if this feature is required.
+ * An initial announcement of the channel
+ * 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
  */
-MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
 
 /**
- * Checks if this feature is required.
+ * Creates a copy of the ChannelInfo
  */
-MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
 
 /**
- * Set this feature as optional.
+ * Checks if two ChannelInfos 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 NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
 
 /**
- * Set this feature as required.
+ * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
 
 /**
- * Checks if this feature is supported.
+ * Get the string representation of a ChannelInfo object
  */
-MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKStr ChannelInfo_to_str(const struct LDKChannelInfo *NONNULL_PTR o);
 
 /**
- * Checks if this feature is required.
+ * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
  */
-MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
 
 /**
- * Set this feature as optional.
+ * Read a ChannelInfo from a byte array, created by ChannelInfo_write
  */
-void InitFeatures_set_trampoline_routing_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
 
 /**
- * Set this feature as required.
+ * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
  */
-void InitFeatures_set_trampoline_routing_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
+void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
 
 /**
- * Checks if this feature is supported.
+ * Creates a copy of the DirectedChannelInfo
  */
-MUST_USE_RES bool InitFeatures_supports_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
 
 /**
- * Set this feature as optional.
+ * Returns information for the channel.
  */
-void NodeFeatures_set_trampoline_routing_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as required.
+ * Returns the [`EffectiveCapacity`] of the channel in the direction.
+ *
+ * This is either the total capacity from the funding transaction, if known, or the
+ * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
+ * otherwise.
  */
-void NodeFeatures_set_trampoline_routing_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
 
 /**
- * Checks if this feature is supported.
+ * Returns the `node_id` of the source hop.
+ *
+ * Refers to the `node_id` forwarding the payment to the next hop.
  */
-MUST_USE_RES bool NodeFeatures_supports_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKNodeId DirectedChannelInfo_source(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as optional.
+ * Returns the `node_id` of the target hop.
+ *
+ * Refers to the `node_id` receiving the payment from the previous hop.
  */
-void Bolt11InvoiceFeatures_set_trampoline_routing_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKNodeId DirectedChannelInfo_target(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
 
 /**
- * Set this feature as required.
+ * Frees any resources used by the EffectiveCapacity
  */
-void Bolt11InvoiceFeatures_set_trampoline_routing_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
 
 /**
- * Checks if this feature is supported.
+ * Creates a copy of the EffectiveCapacity
  */
-MUST_USE_RES bool Bolt11InvoiceFeatures_supports_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
 
 /**
- * Checks if this feature is required.
+ * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
  */
-MUST_USE_RES bool InitFeatures_requires_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
 
 /**
- * Checks if this feature is required.
+ * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity
  */
-MUST_USE_RES bool NodeFeatures_requires_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+struct LDKEffectiveCapacity EffectiveCapacity_advertised_max_htlc(uint64_t amount_msat);
 
 /**
- * Checks if this feature is required.
+ * Utility method to constructs a new Total-variant EffectiveCapacity
  */
-MUST_USE_RES bool Bolt11InvoiceFeatures_requires_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
+struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
 
 /**
- * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
+ * Utility method to constructs a new Infinite-variant EffectiveCapacity
  */
-void ShutdownScript_free(struct LDKShutdownScript this_obj);
+struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
 
 /**
- * Creates a copy of the ShutdownScript
+ * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity
  */
-struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
+struct LDKEffectiveCapacity EffectiveCapacity_hint_max_htlc(uint64_t amount_msat);
 
 /**
- * Checks if two ShutdownScripts 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.
+ * Utility method to constructs a new Unknown-variant EffectiveCapacity
  */
-bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
+struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
 
 /**
- * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
+ * Returns the effective capacity denominated in millisatoshi.
  */
-void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
+MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
 
 /**
- * The script that did not meet the requirements from [BOLT #2].
- *
- * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
+ * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
  */
-struct LDKCVec_u8Z InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
 
 /**
- * The script that did not meet the requirements from [BOLT #2].
- *
- * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
+ * Read a RoutingFees from a byte array, created by RoutingFees_write
  */
-void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
 
 /**
- * Constructs a new InvalidShutdownScript given each field
+ * Frees any resources used by the NodeAnnouncementDetails, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
+void NodeAnnouncementDetails_free(struct LDKNodeAnnouncementDetails this_obj);
 
 /**
- * Creates a copy of the InvalidShutdownScript
+ * Protocol features the node announced support for
  */
-struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
+struct LDKNodeFeatures NodeAnnouncementDetails_get_features(const struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
+ * Protocol features the node announced support for
  */
-struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
+void NodeAnnouncementDetails_set_features(struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
 
 /**
- * Read a ShutdownScript from a byte array, created by ShutdownScript_write
+ * When the last known update to the node state was issued.
+ * Value is opaque, as set in the announcement.
  */
-struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
+uint32_t NodeAnnouncementDetails_get_last_update(const struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr);
 
 /**
- * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
+ * When the last known update to the node state was issued.
+ * Value is opaque, as set in the announcement.
  */
-MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
+void NodeAnnouncementDetails_set_last_update(struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Generates a P2WSH script pubkey from the given [`WScriptHash`].
+ * Color assigned to the node
  */
-MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
+const uint8_t (*NodeAnnouncementDetails_get_rgb(const struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr))[3];
 
 /**
- * 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`.
+ * Color assigned to the node
  */
-MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessProgram witness_program);
+void NodeAnnouncementDetails_set_rgb(struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
 
 /**
- * Converts the shutdown script into the underlying [`ScriptBuf`].
+ * Moniker assigned to the node.
+ * May be invalid or malicious (eg control chars),
+ * should not be exposed to the user.
  */
-MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
+struct LDKNodeAlias NodeAnnouncementDetails_get_alias(const struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr);
 
 /**
- * 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
+ * Moniker assigned to the node.
+ * May be invalid or malicious (eg control chars),
+ * should not be exposed to the user.
  */
-MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
+void NodeAnnouncementDetails_set_alias(struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
 
 /**
- * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
+ * Internet-level addresses via which one can connect to the node
  *
- * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
+ * Returns a copy of the field.
  */
-MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
+struct LDKCVec_SocketAddressZ NodeAnnouncementDetails_get_addresses(const struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the ChannelId, if is_owned is set and inner is non-NULL.
+ * Internet-level addresses via which one can connect to the node
  */
-void ChannelId_free(struct LDKChannelId this_obj);
-
-const uint8_t (*ChannelId_get_a(const struct LDKChannelId *NONNULL_PTR this_ptr))[32];
-
-void ChannelId_set_a(struct LDKChannelId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+void NodeAnnouncementDetails_set_addresses(struct LDKNodeAnnouncementDetails *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val);
 
 /**
- * Constructs a new ChannelId given each field
+ * Constructs a new NodeAnnouncementDetails given each field
  */
-MUST_USE_RES struct LDKChannelId ChannelId_new(struct LDKThirtyTwoBytes a_arg);
+MUST_USE_RES struct LDKNodeAnnouncementDetails NodeAnnouncementDetails_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKCVec_SocketAddressZ addresses_arg);
 
 /**
- * Creates a copy of the ChannelId
+ * Creates a copy of the NodeAnnouncementDetails
  */
-struct LDKChannelId ChannelId_clone(const struct LDKChannelId *NONNULL_PTR orig);
+struct LDKNodeAnnouncementDetails NodeAnnouncementDetails_clone(const struct LDKNodeAnnouncementDetails *NONNULL_PTR orig);
 
 /**
- * Checks if two ChannelIds contain equal inner contents.
+ * Checks if two NodeAnnouncementDetailss 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 ChannelId_eq(const struct LDKChannelId *NONNULL_PTR a, const struct LDKChannelId *NONNULL_PTR b);
+bool NodeAnnouncementDetails_eq(const struct LDKNodeAnnouncementDetails *NONNULL_PTR a, const struct LDKNodeAnnouncementDetails *NONNULL_PTR b);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the ChannelId.
+ * Frees any resources used by the NodeAnnouncementInfo
  */
-uint64_t ChannelId_hash(const struct LDKChannelId *NONNULL_PTR o);
+void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_ptr);
 
 /**
- * Create _v1_ channel ID based on a funding TX ID and output index
+ * Creates a copy of the NodeAnnouncementInfo
  */
-MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_txid(const uint8_t (*txid)[32], uint16_t output_index);
+struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
 
 /**
- * Create _v1_ channel ID from a funding tx outpoint
+ * Utility method to constructs a new Relayed-variant NodeAnnouncementInfo
  */
-MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_outpoint(struct LDKOutPoint outpoint);
+struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_relayed(struct LDKNodeAnnouncement a);
 
 /**
- * Create a _temporary_ channel ID randomly, based on an entropy source.
+ * Utility method to constructs a new Local-variant NodeAnnouncementInfo
  */
-MUST_USE_RES struct LDKChannelId ChannelId_temporary_from_entropy_source(const struct LDKEntropySource *NONNULL_PTR entropy_source);
+struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_local(struct LDKNodeAnnouncementDetails a);
 
 /**
- * Generic constructor; create a new channel ID from the provided data.
- * Use a more specific `*_from_*` constructor when possible.
+ * Checks if two NodeAnnouncementInfos contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-MUST_USE_RES struct LDKChannelId ChannelId_from_bytes(struct LDKThirtyTwoBytes data);
+bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
 
 /**
- * Create a channel ID consisting of all-zeros data (e.g. when uninitialized or a placeholder).
+ * Protocol features the node announced support for
  */
-MUST_USE_RES struct LDKChannelId ChannelId_new_zero(void);
+MUST_USE_RES struct LDKNodeFeatures NodeAnnouncementInfo_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
 
 /**
- * Check whether ID is consisting of all zeros (uninitialized)
+ * When the last known update to the node state was issued.
+ *
+ * Value may or may not be a timestamp, depending on the policy of the origin node.
  */
-MUST_USE_RES bool ChannelId_is_zero(const struct LDKChannelId *NONNULL_PTR this_arg);
+MUST_USE_RES uint32_t NodeAnnouncementInfo_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
 
 /**
- * Create _v2_ channel ID by concatenating the holder revocation basepoint with the counterparty
- * revocation basepoint and hashing the result. The basepoints will be concatenated in increasing
- * sorted order.
+ * Color assigned to the node
  */
-MUST_USE_RES struct LDKChannelId ChannelId_v2_from_revocation_basepoints(const struct LDKRevocationBasepoint *NONNULL_PTR ours, const struct LDKRevocationBasepoint *NONNULL_PTR theirs);
+MUST_USE_RES struct LDKThreeBytes NodeAnnouncementInfo_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
 
 /**
- * Create temporary _v2_ channel ID by concatenating a zeroed out basepoint with the holder
- * revocation basepoint and hashing the result.
+ * Moniker assigned to the node.
+ *
+ * May be invalid or malicious (eg control chars), should not be exposed to the user.
  */
-MUST_USE_RES struct LDKChannelId ChannelId_temporary_v2_from_revocation_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR our_revocation_basepoint);
+MUST_USE_RES struct LDKNodeAlias NodeAnnouncementInfo_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
 
 /**
- * Serialize the ChannelId object into a byte array which can be read by ChannelId_read
+ * Internet-level addresses via which one can connect to the node
  */
-struct LDKCVec_u8Z ChannelId_write(const struct LDKChannelId *NONNULL_PTR obj);
+MUST_USE_RES struct LDKCVec_SocketAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
 
 /**
- * Read a ChannelId from a byte array, created by ChannelId_write
+ * An initial announcement of the node
+ *
+ * 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 LDKCResult_ChannelIdDecodeErrorZ ChannelId_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncementInfo_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the Retry
+ * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
  */
-void Retry_free(struct LDKRetry this_ptr);
+struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
 
 /**
- * Creates a copy of the Retry
+ * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
  */
-struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
+struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
 
 /**
- * Utility method to constructs a new Attempts-variant Retry
+ * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
  */
-struct LDKRetry Retry_attempts(uint32_t a);
+void NodeAlias_free(struct LDKNodeAlias this_obj);
+
+const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
+
+void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Utility method to constructs a new Timeout-variant Retry
+ * Constructs a new NodeAlias given each field
  */
-struct LDKRetry Retry_timeout(uint64_t a);
+MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
 
 /**
- * Checks if two Retrys contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Creates a copy of the NodeAlias
  */
-bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
+struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Retry.
+ * Generates a non-cryptographic 64-bit hash of the NodeAlias.
  */
-uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
+uint64_t NodeAlias_hash(const struct LDKNodeAlias *NONNULL_PTR o);
 
 /**
- * Serialize the Retry object into a byte array which can be read by Retry_read
+ * Checks if two NodeAliass 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 LDKCVec_u8Z Retry_write(const struct LDKRetry *NONNULL_PTR obj);
+bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
 
 /**
- * Read a Retry from a byte array, created by Retry_write
+ * Get the string representation of a NodeAlias object
  */
-struct LDKCResult_RetryDecodeErrorZ Retry_read(struct LDKu8slice ser);
+struct LDKStr NodeAlias_to_str(const struct LDKNodeAlias *NONNULL_PTR o);
 
 /**
- * Creates a copy of the RetryableSendFailure
+ * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
  */
-enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
+struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
 
 /**
- * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
+ * Read a NodeAlias from a byte array, created by NodeAlias_write
  */
-enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
+struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
 
 /**
- * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
+ * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
  */
-enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
+void NodeInfo_free(struct LDKNodeInfo this_obj);
 
 /**
- * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
+ * All valid channels a node has announced
+ *
+ * Returns a copy of the field.
  */
-enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
+struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two RetryableSendFailures contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * All valid channels a node has announced
  */
-bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b);
+void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
 
 /**
- * Frees any resources used by the PaymentSendFailure
+ * 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.
+ *
+ * Returns a copy of the field.
  */
-void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
+struct LDKCOption_NodeAnnouncementInfoZ NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the PaymentSendFailure
+ * 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.
  */
-struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
+void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCOption_NodeAnnouncementInfoZ val);
 
 /**
- * Utility method to constructs a new ParameterError-variant PaymentSendFailure
+ * Creates a copy of the NodeInfo
  */
-struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
+struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
 
 /**
- * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
+ * Checks if two NodeInfos 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 LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
+bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
 
 /**
- * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
+ * Returns whether the node has only announced Tor addresses.
  */
-struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
+MUST_USE_RES bool NodeInfo_is_tor_only(const struct LDKNodeInfo *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
+ * Get the string representation of a NodeInfo object
  */
-struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
+struct LDKStr NodeInfo_to_str(const struct LDKNodeInfo *NONNULL_PTR o);
 
 /**
- * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
+ * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
  */
-struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
+struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
 
 /**
- * Checks if two PaymentSendFailures contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Read a NodeInfo from a byte array, created by NodeInfo_write
  */
-bool PaymentSendFailure_eq(const struct LDKPaymentSendFailure *NONNULL_PTR a, const struct LDKPaymentSendFailure *NONNULL_PTR b);
+struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
 
 /**
- * Frees any resources used by the ProbeSendFailure
+ * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
  */
-void ProbeSendFailure_free(struct LDKProbeSendFailure this_ptr);
+struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
 
 /**
- * Creates a copy of the ProbeSendFailure
+ * Read a NetworkGraph from a byte array, created by NetworkGraph_write
  */
-struct LDKProbeSendFailure ProbeSendFailure_clone(const struct LDKProbeSendFailure *NONNULL_PTR orig);
+struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
 
 /**
- * Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
+ * Get the string representation of a NetworkGraph object
  */
-struct LDKProbeSendFailure ProbeSendFailure_route_not_found(void);
+struct LDKStr NetworkGraph_to_str(const struct LDKNetworkGraph *NONNULL_PTR o);
 
 /**
- * Utility method to constructs a new SendingFailed-variant ProbeSendFailure
+ * Creates a new, empty, network graph.
  */
-struct LDKProbeSendFailure ProbeSendFailure_sending_failed(struct LDKPaymentSendFailure a);
+MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
 
 /**
- * Checks if two ProbeSendFailures contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Returns a read-only view of the network graph.
  */
-bool ProbeSendFailure_eq(const struct LDKProbeSendFailure *NONNULL_PTR a, const struct LDKProbeSendFailure *NONNULL_PTR b);
+MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
+ * The unix timestamp provided by the most recent rapid gossip sync.
+ * It will be set by the rapid sync process after every sync completion.
  */
-void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj);
+MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
 
 /**
- * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
- * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
- * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
- * attacks.
- *
- * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
- * multi-path payments require a recipient-provided secret.
- *
- * Some implementations may reject spontaneous payments with payment secrets, so you may only
- * want to provide a secret for a spontaneous payment if MPP is needed and you know your
- * recipient will not reject it.
+ * Update the unix timestamp provided by the most recent rapid gossip sync.
+ * This should be done automatically by the rapid sync process after every sync completion.
  */
-struct LDKCOption_ThirtyTwoBytesZ RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
+void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
 
 /**
- * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
- * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
- * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
- * attacks.
- *
- * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
- * multi-path payments require a recipient-provided secret.
+ * For an already known node (from channel announcements), update its stored properties from a
+ * given node announcement.
  *
- * Some implementations may reject spontaneous payments with payment secrets, so you may only
- * want to provide a secret for a spontaneous payment if MPP is needed and you know your
- * recipient will not reject it.
+ * You probably don't want to call this directly, instead relying on a P2PGossipSync's
+ * 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.
  */
-void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
+MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
 
 /**
- * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
- * arbitrary length. This gives recipients substantially more flexibility to receive
- * additional data.
- *
- * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
- * scheme to authenticate received payments against expected payments and invoices, this field
- * is not used in LDK for received payments, and can be used to store arbitrary data in
- * invoices which will be received with the payment.
- *
- * Note that this field was added to the lightning specification more recently than
- * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
- * may not be supported as universally.
- *
- * Returns a copy of the field.
+ * For an already known node (from channel announcements), update its stored properties from a
+ * given node announcement without verifying the associated signatures. Because we aren't
+ * given the associated signatures here we cannot relay the node announcement to any of our
+ * peers.
  */
-struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
+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);
 
 /**
- * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
- * arbitrary length. This gives recipients substantially more flexibility to receive
- * additional data.
+ * Store or update channel info from a channel announcement.
  *
- * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
- * scheme to authenticate received payments against expected payments and invoices, this field
- * is not used in LDK for received payments, and can be used to store arbitrary data in
- * invoices which will be received with the payment.
+ * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
+ * [`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.
  *
- * Note that this field was added to the lightning specification more recently than
- * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
- * may not be supported as universally.
+ * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
+ * the corresponding UTXO exists on chain and is correctly-formatted.
  */
-void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
+MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_UtxoLookupZ utxo_lookup);
 
 /**
- * Creates a copy of the RecipientOnionFields
+ * Store or update channel info from a channel announcement.
+ *
+ * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
+ * [`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.
+ *
+ * This will skip verification of if the channel is actually on-chain.
  */
-struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig);
+MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement_no_lookup(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
 
 /**
- * Checks if two RecipientOnionFieldss 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.
+ * Store or update channel info from a channel announcement without verifying the associated
+ * signatures. Because we aren't given the associated signatures here we cannot relay the
+ * channel announcement to any of our peers.
+ *
+ * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
+ * the corresponding UTXO exists on chain and is correctly-formatted.
  */
-bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b);
+MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_UtxoLookupZ utxo_lookup);
 
 /**
- * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
+ * Update channel from partial announcement data received via rapid gossip sync
+ *
+ * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
+ * rapid gossip sync server)
+ *
+ * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
  */
-struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj);
+MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_add_channel_from_partial_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, uint64_t timestamp, struct LDKChannelFeatures features, struct LDKPublicKey node_id_1, struct LDKPublicKey node_id_2);
 
 /**
- * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
+ * Marks a channel in the graph as failed permanently.
+ *
+ * The channel and any node for which this was their last channel are removed from the graph.
  */
-struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser);
+void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
 
 /**
- * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
- * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
- * but do not require or provide any further data.
+ * Marks a node in the graph as permanently failed, effectively removing it and its channels
+ * from local storage.
  */
-MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret);
+void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
 
 /**
- * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
- * payable HTLCs except for single-path spontaneous payments, i.e. this should generally
- * only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending
- * a spontaneous MPP this will not work as all MPP require payment secrets; you may
- * instead want to use [`RecipientOnionFields::secret_only`].
+ * Removes information about channels that we haven't heard any updates about in some time.
+ * This can be used regularly to prune the network graph of channels that likely no longer
+ * exist.
  *
- * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
- * [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only
- */
-MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void);
-
-/**
- * Creates a new [`RecipientOnionFields`] from an existing one, adding custom TLVs. Each
- * TLV is provided as a `(u64, Vec<u8>)` for the type number and serialized value
- * respectively. TLV type numbers must be unique and within the range
- * reserved for custom types, i.e. >= 2^16, otherwise this method will return `Err(())`.
+ * While there is no formal requirement that nodes regularly re-broadcast their channel
+ * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
+ * pruning occur for updates which are at least two weeks old, which we implement here.
  *
- * This method will also error for types in the experimental range which have been
- * standardized within the protocol, which only includes 5482373484 (keysend) for now.
+ * Note that for users of the `lightning-background-processor` crate this method may be
+ * automatically called regularly for you.
  *
- * See [`Self::custom_tlvs`] for more info.
+ * This method will also cause us to stop tracking removed nodes and channels if they have been
+ * in the map for a while so that these can be resynced from gossip in the future.
+ *
+ * This method is only available with the `std` feature. See
+ * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
  */
-MUST_USE_RES struct LDKCResult_RecipientOnionFieldsNoneZ RecipientOnionFields_with_custom_tlvs(struct LDKRecipientOnionFields this_arg, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs);
+void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
 
 /**
- * Gets the custom TLVs that will be sent or have been received.
+ * Removes information about channels that we haven't heard any updates about in some time.
+ * This can be used regularly to prune the network graph of channels that likely no longer
+ * exist.
  *
- * Custom TLVs allow sending extra application-specific data with a payment. They provide
- * additional flexibility on top of payment metadata, as while other implementations may
- * require `payment_metadata` to reflect metadata provided in an invoice, custom TLVs
- * do not have this restriction.
+ * While there is no formal requirement that nodes regularly re-broadcast their channel
+ * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
+ * pruning occur for updates which are at least two weeks old, which we implement here.
  *
- * Note that if this field is non-empty, it will contain strictly increasing TLVs, each
- * represented by a `(u64, Vec<u8>)` for its type number and serialized value respectively.
- * This is validated when setting this field using [`Self::with_custom_tlvs`].
- */
-MUST_USE_RES struct LDKCVec_C2Tuple_u64CVec_u8ZZZ RecipientOnionFields_custom_tlvs(const struct LDKRecipientOnionFields *NONNULL_PTR this_arg);
-
-/**
- * Calls the free function if one is set
- */
-void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
-
-/**
- * Creates a copy of a Type
+ * This method will also cause us to stop tracking removed nodes and channels if they have been
+ * in the map for a while so that these can be resynced from gossip in the future.
+ *
+ * This function takes the current unix time as an argument. For users with the `std` feature
+ * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
  */
-struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig);
+void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
 
 /**
- * Calls the free function if one is set
+ * For an already known (from announcement) channel, update info about one of the directions
+ * of the channel.
+ *
+ * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
+ * [`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.
+ *
+ * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
+ * materially in the future will be rejected.
  */
-void Type_free(struct LDKType this_ptr);
+MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
 
 /**
- * Frees any resources used by the OfferId, if is_owned is set and inner is non-NULL.
+ * 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.
+ *
+ * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
+ * materially in the future will be rejected.
  */
-void OfferId_free(struct LDKOfferId this_obj);
-
-const uint8_t (*OfferId_get_a(const struct LDKOfferId *NONNULL_PTR this_ptr))[32];
-
-void OfferId_set_a(struct LDKOfferId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
 
 /**
- * Constructs a new OfferId given each field
+ * For an already known (from announcement) channel, verify the given [`ChannelUpdate`].
+ *
+ * This checks whether the update currently is applicable by [`Self::update_channel`].
+ *
+ * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
+ * materially in the future will be rejected.
  */
-MUST_USE_RES struct LDKOfferId OfferId_new(struct LDKThirtyTwoBytes a_arg);
+MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_verify_channel_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
 
 /**
- * Creates a copy of the OfferId
+ * Returns information on a channel with the given id.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKOfferId OfferId_clone(const struct LDKOfferId *NONNULL_PTR orig);
+MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
 
 /**
- * Checks if two OfferIds 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.
+ * Returns the list of channels in the graph
  */
-bool OfferId_eq(const struct LDKOfferId *NONNULL_PTR a, const struct LDKOfferId *NONNULL_PTR b);
+MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
 
 /**
- * Serialize the OfferId object into a byte array which can be read by OfferId_read
+ * Returns information on a node with the given id.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKCVec_u8Z OfferId_write(const struct LDKOfferId *NONNULL_PTR obj);
+MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
 
 /**
- * Read a OfferId from a byte array, created by OfferId_write
+ * Returns the list of nodes in the graph
  */
-struct LDKCResult_OfferIdDecodeErrorZ OfferId_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the OfferWithExplicitMetadataBuilder, 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 OfferWithExplicitMetadataBuilder_free(struct LDKOfferWithExplicitMetadataBuilder this_obj);
+MUST_USE_RES struct LDKCOption_CVec_SocketAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
 
 /**
- * Creates a copy of the OfferWithExplicitMetadataBuilder
+ * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
  */
-struct LDKOfferWithExplicitMetadataBuilder OfferWithExplicitMetadataBuilder_clone(const struct LDKOfferWithExplicitMetadataBuilder *NONNULL_PTR orig);
+void DefaultRouter_free(struct LDKDefaultRouter this_obj);
 
 /**
- * Frees any resources used by the OfferWithDerivedMetadataBuilder, if is_owned is set and inner is non-NULL.
+ * Creates a new router.
  */
-void OfferWithDerivedMetadataBuilder_free(struct LDKOfferWithDerivedMetadataBuilder this_obj);
+MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKEntropySource entropy_source, struct LDKLockableScore scorer, struct LDKProbabilisticScoringFeeParameters score_params);
 
 /**
- * Creates a copy of the OfferWithDerivedMetadataBuilder
+ * 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 LDKOfferWithDerivedMetadataBuilder OfferWithDerivedMetadataBuilder_clone(const struct LDKOfferWithDerivedMetadataBuilder *NONNULL_PTR orig);
+struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
 
 /**
- * Creates a new builder for an offer using the [`Offer::signing_pubkey`] for signing invoices.
- * The associated secret key must be remembered while the offer is valid.
- *
- * Use a different pubkey per offer to avoid correlating offers.
- *
- * # Note
- *
- * If constructing an [`Offer`] for use with a [`ChannelManager`], use
- * [`ChannelManager::create_offer_builder`] instead of [`OfferBuilder::new`].
- *
- * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
- * [`ChannelManager::create_offer_builder`]: crate::ln::channelmanager::ChannelManager::create_offer_builder
+ * Constructs a new MessageRouter which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
  */
-MUST_USE_RES struct LDKOfferWithExplicitMetadataBuilder OfferWithExplicitMetadataBuilder_new(struct LDKPublicKey signing_pubkey);
+struct LDKMessageRouter DefaultRouter_as_MessageRouter(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
 
 /**
- * Sets the [`Offer::metadata`] to the given bytes.
- *
- * Successive calls to this method will override the previous setting.
+ * Calls the free function if one is set
  */
-MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ OfferWithExplicitMetadataBuilder_metadata(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKCVec_u8Z metadata);
+void Router_free(struct LDKRouter this_ptr);
 
 /**
- * Adds the chain hash of the given [`Network`] to [`Offer::chains`]. If not called,
- * the chain hash of [`Network::Bitcoin`] is assumed to be the only one supported.
- *
- * See [`Offer::chains`] on how this relates to the payment currency.
- *
- * Successive calls to this method will add another chain hash.
+ * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES void OfferWithExplicitMetadataBuilder_chain(struct LDKOfferWithExplicitMetadataBuilder this_arg, enum LDKNetwork network);
+void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
 
 /**
- * Sets the [`Offer::amount`] as an [`Amount::Bitcoin`].
- *
- * Successive calls to this method will override the previous setting.
+ * Initialize a new `ScorerAccountingForInFlightHtlcs`.
  */
-MUST_USE_RES void OfferWithExplicitMetadataBuilder_amount_msats(struct LDKOfferWithExplicitMetadataBuilder this_arg, uint64_t amount_msats);
+MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScoreLookUp scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
 
 /**
- * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
- * already passed is valid and can be checked for using [`Offer::is_expired`].
- *
- * Successive calls to this method will override the previous setting.
+ * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
  */
-MUST_USE_RES void OfferWithExplicitMetadataBuilder_absolute_expiry(struct LDKOfferWithExplicitMetadataBuilder this_arg, uint64_t absolute_expiry);
+struct LDKScoreLookUp ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
 
 /**
- * Sets the [`Offer::description`].
- *
- * Successive calls to this method will override the previous setting.
+ * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES void OfferWithExplicitMetadataBuilder_description(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKStr description);
+void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
 
 /**
- * Sets the [`Offer::issuer`].
- *
- * Successive calls to this method will override the previous setting.
+ * Creates a copy of the InFlightHtlcs
  */
-MUST_USE_RES void OfferWithExplicitMetadataBuilder_issuer(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKStr issuer);
+struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
 
 /**
- * Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by
- * private channels or if [`Offer::signing_pubkey`] is not a public node id.
- *
- * Successive calls to this method will add another blinded path. Caller is responsible for not
- * adding duplicate paths.
+ * Constructs an empty `InFlightHtlcs`.
  */
-MUST_USE_RES void OfferWithExplicitMetadataBuilder_path(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKBlindedPath path);
+MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
 
 /**
- * Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to
- * [`Quantity::One`].
- *
- * Successive calls to this method will override the previous setting.
+ * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`.
  */
-MUST_USE_RES void OfferWithExplicitMetadataBuilder_supported_quantity(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKQuantity quantity);
+void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id);
 
 /**
- * Builds an [`Offer`] from the builder's settings.
+ * Adds a known HTLC given the public key of the HTLC source, target, and short channel
+ * id.
  */
-MUST_USE_RES struct LDKCResult_OfferBolt12SemanticErrorZ OfferWithExplicitMetadataBuilder_build(struct LDKOfferWithExplicitMetadataBuilder this_arg);
+void InFlightHtlcs_add_inflight_htlc(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, uint64_t channel_scid, uint64_t used_msat);
 
 /**
- * Similar to [`OfferBuilder::new`] except, if [`OfferBuilder::path`] is called, the signing
- * pubkey is derived from the given [`ExpandedKey`] and [`EntropySource`]. This provides
- * recipient privacy by using a different signing pubkey for each offer. Otherwise, the
- * provided `node_id` is used for the signing pubkey.
- *
- * Also, sets the metadata when [`OfferBuilder::build`] is called such that it can be used by
- * [`InvoiceRequest::verify`] to determine if the request was produced for the offer given an
- * [`ExpandedKey`].
- *
- * [`InvoiceRequest::verify`]: crate::offers::invoice_request::InvoiceRequest::verify
- * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
+ * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
+ * id.
  */
-MUST_USE_RES struct LDKOfferWithDerivedMetadataBuilder OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source);
+MUST_USE_RES struct LDKCOption_u64Z InFlightHtlcs_used_liquidity_msat(const struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, uint64_t channel_scid);
 
 /**
- * Adds the chain hash of the given [`Network`] to [`Offer::chains`]. If not called,
- * the chain hash of [`Network::Bitcoin`] is assumed to be the only one supported.
- *
- * See [`Offer::chains`] on how this relates to the payment currency.
- *
- * Successive calls to this method will add another chain hash.
+ * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
  */
-MUST_USE_RES void OfferWithDerivedMetadataBuilder_chain(struct LDKOfferWithDerivedMetadataBuilder this_arg, enum LDKNetwork network);
+struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
 
 /**
- * Sets the [`Offer::amount`] as an [`Amount::Bitcoin`].
- *
- * Successive calls to this method will override the previous setting.
+ * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
  */
-MUST_USE_RES void OfferWithDerivedMetadataBuilder_amount_msats(struct LDKOfferWithDerivedMetadataBuilder this_arg, uint64_t amount_msats);
+struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
 
 /**
- * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
- * already passed is valid and can be checked for using [`Offer::is_expired`].
- *
- * Successive calls to this method will override the previous setting.
+ * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES void OfferWithDerivedMetadataBuilder_absolute_expiry(struct LDKOfferWithDerivedMetadataBuilder this_arg, uint64_t absolute_expiry);
+void RouteHop_free(struct LDKRouteHop this_obj);
 
 /**
- * Sets the [`Offer::description`].
- *
- * Successive calls to this method will override the previous setting.
+ * The node_id of the node at this hop.
  */
-MUST_USE_RES void OfferWithDerivedMetadataBuilder_description(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKStr description);
+struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
 
 /**
- * Sets the [`Offer::issuer`].
- *
- * Successive calls to this method will override the previous setting.
+ * The node_id of the node at this hop.
  */
-MUST_USE_RES void OfferWithDerivedMetadataBuilder_issuer(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKStr issuer);
+void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by
- * private channels or if [`Offer::signing_pubkey`] is not a public node id.
- *
- * Successive calls to this method will add another blinded path. Caller is responsible for not
- * adding duplicate paths.
+ * 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 void OfferWithDerivedMetadataBuilder_path(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKBlindedPath path);
+struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
 
 /**
- * Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to
- * [`Quantity::One`].
- *
- * Successive calls to this method will override the previous setting.
+ * 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 void OfferWithDerivedMetadataBuilder_supported_quantity(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKQuantity quantity);
+void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
 
 /**
- * Builds an [`Offer`] from the builder's settings.
+ * The channel that should be used from the previous hop to reach this node.
  */
-MUST_USE_RES struct LDKCResult_OfferBolt12SemanticErrorZ OfferWithDerivedMetadataBuilder_build(struct LDKOfferWithDerivedMetadataBuilder this_arg);
+uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the Offer, 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 Offer_free(struct LDKOffer this_obj);
+void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Creates a copy of the Offer
+ * The channel_announcement features of the channel that should be used from the previous hop
+ * to reach this node.
  */
-struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig);
+struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
 
 /**
- * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
- * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
- * for the selected chain.
+ * The channel_announcement features of the channel that should be used from the previous hop
+ * to reach this node.
  */
-MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg);
+void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
 
 /**
- * Opaque bytes set by the originator. Useful for authentication and validating fields since it
- * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
+ * The fee taken on this hop (for paying for the use of the *next* channel in the path).
+ * If this is the last hop in [`Path::hops`]:
+ * * if we're sending to a [`BlindedPaymentPath`], this is the fee paid for use of the entire
+ *   blinded path
+ * * otherwise, this is the full value of this [`Path`]'s part of the payment
  */
-MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg);
+uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
 
 /**
- * The minimum amount required for a successful payment of a single item.
+ * The fee taken on this hop (for paying for the use of the *next* channel in the path).
+ * If this is the last hop in [`Path::hops`]:
+ * * if we're sending to a [`BlindedPaymentPath`], this is the fee paid for use of the entire
+ *   blinded path
+ * * otherwise, this is the full value of this [`Path`]'s part of the payment
  */
-MUST_USE_RES struct LDKCOption_AmountZ Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg);
+void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * A complete description of the purpose of the payment. Intended to be displayed to the user
- * but with the caveat that it has not been verified in any way.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The CLTV delta added for this hop.
+ * If this is the last hop in [`Path::hops`]:
+ * * if we're sending to a [`BlindedPaymentPath`], this is the CLTV delta for the entire blinded
+ *   path
+ * * otherwise, this is the CLTV delta expected at the destination
  */
-MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg);
+uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
 
 /**
- * Features pertaining to the offer.
+ * The CLTV delta added for this hop.
+ * If this is the last hop in [`Path::hops`]:
+ * * if we're sending to a [`BlindedPaymentPath`], this is the CLTV delta for the entire blinded
+ *   path
+ * * otherwise, this is the CLTV delta expected at the destination
  */
-MUST_USE_RES struct LDKOfferFeatures Offer_offer_features(const struct LDKOffer *NONNULL_PTR this_arg);
+void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Duration since the Unix epoch when an invoice should no longer be requested.
+ * Indicates whether this hop is possibly announced in the public network graph.
  *
- * If `None`, the offer does not expire.
- */
-MUST_USE_RES struct LDKCOption_u64Z Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg);
-
-/**
- * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
- * displayed to the user but with the caveat that it has not been verified in any way.
+ * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
+ * either know for sure it's announced in the public graph, or if any public channels exist
+ * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
+ * the channel to be unannounced.
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Will be `true` for objects serialized with LDK version 0.0.116 and before.
  */
-MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg);
+bool RouteHop_get_maybe_announced_channel(const struct LDKRouteHop *NONNULL_PTR this_ptr);
 
 /**
- * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
- * recipient privacy by obfuscating its node id.
+ * Indicates whether this hop is possibly announced in the public network graph.
+ *
+ * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
+ * either know for sure it's announced in the public graph, or if any public channels exist
+ * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
+ * the channel to be unannounced.
+ *
+ * Will be `true` for objects serialized with LDK version 0.0.116 and before.
  */
-MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg);
+void RouteHop_set_maybe_announced_channel(struct LDKRouteHop *NONNULL_PTR this_ptr, bool val);
 
 /**
- * The quantity of items supported.
+ * Constructs a new RouteHop given each field
  */
-MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKRouteHop RouteHop_new(struct LDKPublicKey pubkey_arg, struct LDKNodeFeatures node_features_arg, uint64_t short_channel_id_arg, struct LDKChannelFeatures channel_features_arg, uint64_t fee_msat_arg, uint32_t cltv_expiry_delta_arg, bool maybe_announced_channel_arg);
 
 /**
- * The public key used by the recipient to sign invoices.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Creates a copy of the RouteHop
  */
-MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg);
+struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
 
 /**
- * Returns the id of the offer.
+ * Generates a non-cryptographic 64-bit hash of the RouteHop.
  */
-MUST_USE_RES struct LDKOfferId Offer_id(const struct LDKOffer *NONNULL_PTR this_arg);
+uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
 
 /**
- * Returns whether the given chain is supported by the offer.
+ * 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.
  */
-MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain);
+bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
 
 /**
- * Whether the offer has expired.
+ * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
  */
-MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
 
 /**
- * Whether the offer has expired given the duration since the Unix epoch.
+ * Read a RouteHop from a byte array, created by RouteHop_write
  */
-MUST_USE_RES bool Offer_is_expired_no_std(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
+struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
 
 /**
- * Returns whether the given quantity is valid for the offer.
+ * Frees any resources used by the BlindedTail, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity);
+void BlindedTail_free(struct LDKBlindedTail this_obj);
 
 /**
- * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer.
- *
- * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * The hops of the [`BlindedPaymentPath`] provided by the recipient.
  */
-MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
+struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
 
 /**
- * Similar to [`Offer::request_invoice`] except it:
- * - derives the [`InvoiceRequest::payer_id`] such that a different key can be used for each
- *   request,
- * - sets [`InvoiceRequest::payer_metadata`] when [`InvoiceRequestBuilder::build`] is called
- *   such that it can be used by [`Bolt12Invoice::verify`] to determine if the invoice was
- *   requested using a base [`ExpandedKey`] from which the payer id was derived, and
- * - includes the [`PaymentId`] encrypted in [`InvoiceRequest::payer_metadata`] so that it can
- *   be used when sending the payment for the requested invoice.
- *
- * Useful to protect the sender's privacy.
- *
- * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id
- * [`InvoiceRequest::payer_metadata`]: crate::offers::invoice_request::InvoiceRequest::payer_metadata
- * [`Bolt12Invoice::verify`]: crate::offers::invoice::Bolt12Invoice::verify
- * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
+ * The hops of the [`BlindedPaymentPath`] provided by the recipient.
  */
-MUST_USE_RES struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice_deriving_payer_id(const struct LDKOffer *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source, struct LDKThirtyTwoBytes payment_id);
+void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
 
 /**
- * Similar to [`Offer::request_invoice_deriving_payer_id`] except uses `payer_id` for the
- * [`InvoiceRequest::payer_id`] instead of deriving a different key for each request.
- *
- * Useful for recurring payments using the same `payer_id` with different invoices.
- *
- * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id
+ * The blinding point of the [`BlindedPaymentPath`] provided by the recipient.
  */
-MUST_USE_RES struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice_deriving_metadata(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKPublicKey payer_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source, struct LDKThirtyTwoBytes payment_id);
+struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
 
 /**
- * Creates an [`InvoiceRequestBuilder`] for the offer with the given `metadata` and `payer_id`,
- * which will be reflected in the `Bolt12Invoice` response.
- *
- * The `metadata` is useful for including information about the derivation of `payer_id` such
- * that invoice response handling can be stateless. Also serves as payer-provided entropy while
- * hashing in the signature calculation.
- *
- * This should not leak any information such as by using a simple BIP-32 derivation path.
- * Otherwise, payments may be correlated.
- *
- * Errors if the offer contains unknown required features.
- *
- * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * The blinding point of the [`BlindedPaymentPath`] provided by the recipient.
  */
-MUST_USE_RES struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id);
+void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Offer.
+ * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
+ * inferring the destination. May be 0.
  */
-uint64_t Offer_hash(const struct LDKOffer *NONNULL_PTR o);
+uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the Offer object into a byte array which can be read by Offer_read
+ * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
+ * inferring the destination. May be 0.
  */
-struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj);
+void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Frees any resources used by the Amount
+ * The total amount paid on this [`Path`], excluding the fees.
  */
-void Amount_free(struct LDKAmount this_ptr);
+uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the Amount
+ * The total amount paid on this [`Path`], excluding the fees.
  */
-struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig);
+void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Utility method to constructs a new Bitcoin-variant Amount
+ * Constructs a new BlindedTail given each field
  */
-struct LDKAmount Amount_bitcoin(uint64_t amount_msats);
+MUST_USE_RES struct LDKBlindedTail BlindedTail_new(struct LDKCVec_BlindedHopZ hops_arg, struct LDKPublicKey blinding_point_arg, uint32_t excess_final_cltv_expiry_delta_arg, uint64_t final_value_msat_arg);
 
 /**
- * Utility method to constructs a new Currency-variant Amount
+ * Creates a copy of the BlindedTail
  */
-struct LDKAmount Amount_currency(struct LDKThreeBytes iso4217_code, uint64_t amount);
+struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the Quantity
+ * Generates a non-cryptographic 64-bit hash of the BlindedTail.
  */
-void Quantity_free(struct LDKQuantity this_ptr);
+uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o);
 
 /**
- * Creates a copy of the Quantity
+ * Checks if two BlindedTails 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 LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig);
+bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b);
 
 /**
- * Utility method to constructs a new Bounded-variant Quantity
+ * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read
  */
-struct LDKQuantity Quantity_bounded(uint64_t a);
+struct LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj);
 
 /**
- * Utility method to constructs a new Unbounded-variant Quantity
+ * Read a BlindedTail from a byte array, created by BlindedTail_write
  */
-struct LDKQuantity Quantity_unbounded(void);
+struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser);
 
 /**
- * Utility method to constructs a new One-variant Quantity
+ * Frees any resources used by the Path, if is_owned is set and inner is non-NULL.
  */
-struct LDKQuantity Quantity_one(void);
+void Path_free(struct LDKPath this_obj);
 
 /**
- * Read a Offer object from a string
+ * The list of unblinded hops in this [`Path`]. Must be at least length one.
  */
-struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s);
+struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the InvoiceWithExplicitSigningPubkeyBuilder, if is_owned is set and inner is non-NULL.
+ * The list of unblinded hops in this [`Path`]. Must be at least length one.
  */
-void InvoiceWithExplicitSigningPubkeyBuilder_free(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj);
+void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val);
 
 /**
- * Frees any resources used by the InvoiceWithDerivedSigningPubkeyBuilder, if is_owned is set and inner is non-NULL.
+ * The blinded path at which this path terminates, if we're sending to one, and its metadata.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void InvoiceWithDerivedSigningPubkeyBuilder_free(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_obj);
+struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr);
 
 /**
- * Builds an unsigned [`Bolt12Invoice`] after checking for valid semantics. It can be signed by
- * [`UnsignedBolt12Invoice::sign`].
+ * The blinded path at which this path terminates, if we're sending to one, and its metadata.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ InvoiceWithExplicitSigningPubkeyBuilder_build(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg);
+void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val);
 
 /**
- * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`].
- * Any expiry that has already passed is valid and can be checked for using
- * [`Bolt12Invoice::is_expired`].
+ * Constructs a new Path given each field
  *
- * Successive calls to this method will override the previous setting.
+ * Note that blinded_tail_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs);
+MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg);
 
 /**
- * Adds a P2WSH address to [`Bolt12Invoice::fallbacks`].
- *
- * Successive calls to this method will add another address. Caller is responsible for not
- * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
+ * Creates a copy of the Path
  */
-MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]);
+struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig);
 
 /**
- * Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`].
- *
- * Successive calls to this method will add another address. Caller is responsible for not
- * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
+ * Generates a non-cryptographic 64-bit hash of the Path.
  */
-MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]);
+uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o);
 
 /**
- * Adds a P2TR address to [`Bolt12Invoice::fallbacks`].
- *
- * Successive calls to this method will add another address. Caller is responsible for not
- * adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
+ * Checks if two Paths 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.
  */
-MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key);
+bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b);
 
 /**
- * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is
- * disallowed.
+ * Gets the fees for a given path, excluding any excess paid to the recipient.
  */
-MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg);
+MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg);
 
 /**
- * Builds a signed [`Bolt12Invoice`] after checking for valid semantics.
+ * Gets the total amount paid on this [`Path`], excluding the fees.
  */
-MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg);
+MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg);
 
 /**
- * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`].
- * Any expiry that has already passed is valid and can be checked for using
- * [`Bolt12Invoice::is_expired`].
- *
- * Successive calls to this method will override the previous setting.
+ * Gets the final hop's CLTV expiry delta.
  */
-MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs);
+MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg);
 
 /**
- * Adds a P2WSH address to [`Bolt12Invoice::fallbacks`].
- *
- * Successive calls to this method will add another address. Caller is responsible for not
- * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
+ * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]);
+void Route_free(struct LDKRoute this_obj);
 
 /**
- * Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`].
- *
- * Successive calls to this method will add another address. Caller is responsible for not
- * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
+ * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
+ * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
+ * the same.
  */
-MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]);
+struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
 
 /**
- * Adds a P2TR address to [`Bolt12Invoice::fallbacks`].
- *
- * Successive calls to this method will add another address. Caller is responsible for not
- * adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
+ * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
+ * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
+ * the same.
  */
-MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key);
+void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val);
 
 /**
- * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is
- * disallowed.
+ * The `route_params` parameter passed to [`find_route`].
+ *
+ * This is used by `ChannelManager` to track information which may be required for retries.
+ *
+ * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg);
+struct LDKRouteParameters Route_get_route_params(const struct LDKRoute *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the UnsignedBolt12Invoice, if is_owned is set and inner is non-NULL.
+ * The `route_params` parameter passed to [`find_route`].
+ *
+ * This is used by `ChannelManager` to track information which may be required for retries.
+ *
+ * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj);
+void Route_set_route_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKRouteParameters val);
 
 /**
- * Creates a copy of the UnsignedBolt12Invoice
+ * Constructs a new Route given each field
+ *
+ * Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKUnsignedBolt12Invoice UnsignedBolt12Invoice_clone(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR orig);
+MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKRouteParameters route_params_arg);
 
 /**
- * Calls the free function if one is set
+ * Creates a copy of the Route
  */
-void SignBolt12InvoiceFn_free(struct LDKSignBolt12InvoiceFn this_ptr);
+struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
 
 /**
- * Returns the [`TaggedHash`] of the invoice to sign.
+ * Generates a non-cryptographic 64-bit hash of the Route.
  */
-MUST_USE_RES struct LDKTaggedHash UnsignedBolt12Invoice_tagged_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the Bolt12Invoice, if is_owned is set and inner is non-NULL.
+ * 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.
  */
-void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj);
+bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
 
 /**
- * Creates a copy of the Bolt12Invoice
+ * Returns the total amount of fees paid on this [`Route`].
+ *
+ * For objects serialized with LDK 0.0.117 and after, this includes any extra payment made to
+ * the recipient, which can happen in excess of the amount passed to [`find_route`] via
+ * [`RouteParameters::final_value_msat`], if we had to reach the [`htlc_minimum_msat`] limits.
+ *
+ * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
  */
-struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig);
+MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
 
 /**
- * The chains that may be used when paying a requested invoice.
+ * Returns the total amount paid on this [`Route`], excluding the fees.
  *
- * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
+ * Might be more than requested as part of the given [`RouteParameters::final_value_msat`] if
+ * we had to reach the [`htlc_minimum_msat`] limits.
  *
- * [`Offer::chains`]: crate::offers::offer::Offer::chains
+ * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
+ */
+MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
+
+/**
+ * Get the string representation of a Route object
  */
-MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ UnsignedBolt12Invoice_offer_chains(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+struct LDKStr Route_to_str(const struct LDKRoute *NONNULL_PTR o);
 
 /**
- * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
- * invoice originated from an offer.
- *
- * From [`InvoiceRequest::chain`] or [`Refund::chain`].
- *
- * [`offer_chains`]: Self::offer_chains
- * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
+ * Serialize the Route object into a byte array which can be read by Route_read
  */
-MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_chain(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
 
 /**
- * Opaque bytes set by the originating [`Offer`].
- *
- * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
- * if the [`Offer`] did not set it.
- *
- * [`Offer`]: crate::offers::offer::Offer
- * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
+ * Read a Route from a byte array, created by Route_write
  */
-MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedBolt12Invoice_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
 
 /**
- * The minimum amount required for a successful payment of a single item.
- *
- * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
- * the [`Offer`] did not set it.
- *
- * [`Offer`]: crate::offers::offer::Offer
- * [`Offer::amount`]: crate::offers::offer::Offer::amount
+ * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKCOption_AmountZ UnsignedBolt12Invoice_amount(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+void RouteParameters_free(struct LDKRouteParameters this_obj);
 
 /**
- * Features pertaining to the originating [`Offer`].
- *
- * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
- * [`Refund`].
- *
- * [`Offer`]: crate::offers::offer::Offer
- * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The parameters of the failed payment path.
  */
-MUST_USE_RES struct LDKOfferFeatures UnsignedBolt12Invoice_offer_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
 
 /**
- * A complete description of the purpose of the originating offer or refund.
- *
- * From [`Offer::description`] or [`Refund::description`].
- *
- * [`Offer::description`]: crate::offers::offer::Offer::description
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The parameters of the failed payment path.
  */
-MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_description(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
 
 /**
- * Duration since the Unix epoch when an invoice should no longer be requested.
- *
- * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
- *
- * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
+ * The amount in msats sent on the failed payment path.
  */
-MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_absolute_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
 
 /**
- * The issuer of the offer or refund.
- *
- * From [`Offer::issuer`] or [`Refund::issuer`].
- *
- * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The amount in msats sent on the failed payment path.
  */
-MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_issuer(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Paths to the recipient originating from publicly reachable nodes.
+ * The maximum total fees, in millisatoshi, that may accrue during route finding.
  *
- * From [`Offer::paths`] or [`Refund::paths`].
+ * This limit also applies to the total fees that may arise while retrying failed payment
+ * paths.
  *
- * [`Offer::paths`]: crate::offers::offer::Offer::paths
+ * Note that values below a few sats may result in some paths being spuriously ignored.
  */
-MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+struct LDKCOption_u64Z RouteParameters_get_max_total_routing_fee_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
 
 /**
- * The quantity of items supported.
+ * The maximum total fees, in millisatoshi, that may accrue during route finding.
  *
- * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
- * [`Refund`].
+ * This limit also applies to the total fees that may arise while retrying failed payment
+ * paths.
  *
- * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
+ * Note that values below a few sats may result in some paths being spuriously ignored.
  */
-MUST_USE_RES struct LDKCOption_QuantityZ UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+void RouteParameters_set_max_total_routing_fee_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
 
 /**
- * An unpredictable series of bytes from the payer.
- *
- * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
+ * Constructs a new RouteParameters given each field
  */
-MUST_USE_RES struct LDKu8slice UnsignedBolt12Invoice_payer_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPaymentParameters payment_params_arg, uint64_t final_value_msat_arg, struct LDKCOption_u64Z max_total_routing_fee_msat_arg);
 
 /**
- * Features pertaining to requesting an invoice.
- *
- * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
+ * Creates a copy of the RouteParameters
  */
-MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedBolt12Invoice_invoice_request_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
 
 /**
- * The quantity of items requested or refunded for.
- *
- * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
+ * Generates a non-cryptographic 64-bit hash of the RouteParameters.
  */
-MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+uint64_t RouteParameters_hash(const struct LDKRouteParameters *NONNULL_PTR o);
 
 /**
- * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
- * refund in case there are no [`message_paths`].
- *
- * [`message_paths`]: Self::message_paths
+ * Checks if two RouteParameterss 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.
  */
-MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_payer_id(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
 
 /**
- * A payer-provided note reflected back in the invoice.
- *
- * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
+ * Constructs [`RouteParameters`] from the given [`PaymentParameters`] and a payment amount.
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats
  */
-MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_payer_note(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKRouteParameters RouteParameters_from_payment_params_and_value(struct LDKPaymentParameters payment_params, uint64_t final_value_msat);
 
 /**
- * Duration since the Unix epoch when the invoice was created.
+ * Sets the maximum number of hops that can be included in a payment path, based on the provided
+ * [`RecipientOnionFields`] and blinded paths.
  */
-MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_NoneNoneZ RouteParameters_set_max_path_length(struct LDKRouteParameters *NONNULL_PTR this_arg, const struct LDKRecipientOnionFields *NONNULL_PTR recipient_onion, bool is_keysend, uint32_t best_block_height);
 
 /**
- * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
- * should no longer be paid.
+ * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
  */
-MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
 
 /**
- * Whether the invoice has expired.
+ * Read a RouteParameters from a byte array, created by RouteParameters_write
  */
-MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
 
 /**
- * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
+ * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_payment_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+void PaymentParameters_free(struct LDKPaymentParameters this_obj);
 
 /**
- * The minimum amount required for a successful payment of the invoice.
+ * Information about the payee, such as their features and route hints for their channels.
  */
-MUST_USE_RES uint64_t UnsignedBolt12Invoice_amount_msats(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+struct LDKPayee PaymentParameters_get_payee(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
 
 /**
- * Features pertaining to paying an invoice.
+ * Information about the payee, such as their features and route hints for their channels.
  */
-MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+void PaymentParameters_set_payee(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
 
 /**
- * The public key corresponding to the key used to sign the invoice.
+ * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
  */
-MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
+struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
 
 /**
- * The chains that may be used when paying a requested invoice.
- *
- * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
- *
- * [`Offer::chains`]: crate::offers::offer::Offer::chains
+ * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
  */
-MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ Bolt12Invoice_offer_chains(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
 
 /**
- * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
- * invoice originated from an offer.
- *
- * From [`InvoiceRequest::chain`] or [`Refund::chain`].
- *
- * [`offer_chains`]: Self::offer_chains
- * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
+ * The maximum total CLTV delta we accept for the route.
+ * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
  */
-MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_chain(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
 
 /**
- * Opaque bytes set by the originating [`Offer`].
- *
- * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
- * if the [`Offer`] did not set it.
- *
- * [`Offer`]: crate::offers::offer::Offer
- * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
+ * The maximum total CLTV delta we accept for the route.
+ * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
  */
-MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt12Invoice_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * The minimum amount required for a successful payment of a single item.
- *
- * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
- * the [`Offer`] did not set it.
- *
- * [`Offer`]: crate::offers::offer::Offer
- * [`Offer::amount`]: crate::offers::offer::Offer::amount
+ * The maximum number of paths that may be used by (MPP) payments.
+ * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
  */
-MUST_USE_RES struct LDKCOption_AmountZ Bolt12Invoice_amount(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
 
 /**
- * Features pertaining to the originating [`Offer`].
- *
- * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
- * [`Refund`].
- *
- * [`Offer`]: crate::offers::offer::Offer
- * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The maximum number of paths that may be used by (MPP) payments.
+ * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
  */
-MUST_USE_RES struct LDKOfferFeatures Bolt12Invoice_offer_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
 
 /**
- * A complete description of the purpose of the originating offer or refund.
- *
- * From [`Offer::description`] or [`Refund::description`].
- *
- * [`Offer::description`]: crate::offers::offer::Offer::description
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The maximum number of [`Path::hops`] in any returned path.
+ * Defaults to [`MAX_PATH_LENGTH_ESTIMATE`].
  */
-MUST_USE_RES struct LDKPrintableString Bolt12Invoice_description(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+uint8_t PaymentParameters_get_max_path_length(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
 
 /**
- * Duration since the Unix epoch when an invoice should no longer be requested.
- *
- * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
- *
- * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
+ * The maximum number of [`Path::hops`] in any returned path.
+ * Defaults to [`MAX_PATH_LENGTH_ESTIMATE`].
  */
-MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_absolute_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+void PaymentParameters_set_max_path_length(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
 
 /**
- * The issuer of the offer or refund.
+ * Selects the maximum share of a channel's total capacity which will be sent over a channel,
+ * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
+ * a lower value prefers to send larger MPP parts, potentially saturating channels and
+ * increasing failure probability for those paths.
  *
- * From [`Offer::issuer`] or [`Refund::issuer`].
+ * Note that this restriction will be relaxed during pathfinding after paths which meet this
+ * restriction have been found. While paths which meet this criteria will be searched for, it
+ * is ultimately up to the scorer to select them over other paths.
  *
- * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
+ * A value of 0 will allow payments up to and including a channel's total announced usable
+ * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Default value: 2
  */
-MUST_USE_RES struct LDKPrintableString Bolt12Invoice_issuer(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
 
 /**
- * Paths to the recipient originating from publicly reachable nodes.
- *
- * From [`Offer::paths`] or [`Refund::paths`].
+ * Selects the maximum share of a channel's total capacity which will be sent over a channel,
+ * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
+ * a lower value prefers to send larger MPP parts, potentially saturating channels and
+ * increasing failure probability for those paths.
  *
- * [`Offer::paths`]: crate::offers::offer::Offer::paths
- */
-MUST_USE_RES struct LDKCVec_BlindedPathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
-
-/**
- * The quantity of items supported.
+ * Note that this restriction will be relaxed during pathfinding after paths which meet this
+ * restriction have been found. While paths which meet this criteria will be searched for, it
+ * is ultimately up to the scorer to select them over other paths.
  *
- * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
- * [`Refund`].
+ * A value of 0 will allow payments up to and including a channel's total announced usable
+ * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
  *
- * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
+ * Default value: 2
  */
-MUST_USE_RES struct LDKCOption_QuantityZ Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
 
 /**
- * An unpredictable series of bytes from the payer.
+ * A list of SCIDs which this payment was previously attempted over and which caused the
+ * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
+ * these SCIDs.
  *
- * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
+ * Returns a copy of the field.
  */
-MUST_USE_RES struct LDKu8slice Bolt12Invoice_payer_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
 
 /**
- * Features pertaining to requesting an invoice.
- *
- * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
+ * A list of SCIDs which this payment was previously attempted over and which caused the
+ * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
+ * these SCIDs.
  */
-MUST_USE_RES struct LDKInvoiceRequestFeatures Bolt12Invoice_invoice_request_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
 
 /**
- * The quantity of items requested or refunded for.
+ * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
+ * payment was previously attempted over and which caused the payment to fail. Future attempts
+ * for the same payment shouldn't be relayed through any of these blinded paths.
  *
- * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
+ * Returns a copy of the field.
  */
-MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+struct LDKCVec_u64Z PaymentParameters_get_previously_failed_blinded_path_idxs(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
 
 /**
- * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
- * refund in case there are no [`message_paths`].
- *
- * [`message_paths`]: Self::message_paths
+ * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
+ * payment was previously attempted over and which caused the payment to fail. Future attempts
+ * for the same payment shouldn't be relayed through any of these blinded paths.
  */
-MUST_USE_RES struct LDKPublicKey Bolt12Invoice_payer_id(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+void PaymentParameters_set_previously_failed_blinded_path_idxs(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
 
 /**
- * A payer-provided note reflected back in the invoice.
- *
- * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Constructs a new PaymentParameters given each field
  */
-MUST_USE_RES struct LDKPrintableString Bolt12Invoice_payer_note(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPaymentParameters PaymentParameters_new(struct LDKPayee payee_arg, struct LDKCOption_u64Z expiry_time_arg, uint32_t max_total_cltv_expiry_delta_arg, uint8_t max_path_count_arg, uint8_t max_path_length_arg, uint8_t max_channel_saturation_power_of_half_arg, struct LDKCVec_u64Z previously_failed_channels_arg, struct LDKCVec_u64Z previously_failed_blinded_path_idxs_arg);
 
 /**
- * Duration since the Unix epoch when the invoice was created.
+ * Creates a copy of the PaymentParameters
  */
-MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
 
 /**
- * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
- * should no longer be paid.
+ * Generates a non-cryptographic 64-bit hash of the PaymentParameters.
  */
-MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
 
 /**
- * Whether the invoice has expired.
+ * Checks if two PaymentParameterss 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.
  */
-MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
 
 /**
- * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
+ * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
  */
-MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
 
 /**
- * The minimum amount required for a successful payment of the invoice.
+ * Read a PaymentParameters from a byte array, created by PaymentParameters_write
  */
-MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
 
 /**
- * Features pertaining to paying an invoice.
+ * Creates a payee with the node id of the given `pubkey`.
+ *
+ * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
+ * provided.
  */
-MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
 
 /**
- * The public key corresponding to the key used to sign the invoice.
+ * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
+ *
+ * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
+ * provided.
+ *
+ * Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose
+ * whether your router will be allowed to find a multi-part route for this payment. If you
+ * set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via
+ * [`RecipientOnionFields::secret_only`].
+ *
+ * [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only
  */
-MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta, bool allow_mpp);
 
 /**
- * Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`].
+ * Creates parameters for paying to a blinded payee from the provided invoice. Sets
+ * [`Payee::Blinded::route_hints`], [`Payee::Blinded::features`], and
+ * [`PaymentParameters::expiry_time`].
  */
-MUST_USE_RES struct LDKSchnorrSignature Bolt12Invoice_signature(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice);
 
 /**
- * Hash that was used for signing the invoice.
+ * Creates parameters for paying to a blinded payee from the provided blinded route hints.
  */
-MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_BlindedPaymentPathZ blinded_route_hints);
 
 /**
- * Verifies that the invoice was for a request or refund created using the given key. Returns
- * the associated [`PaymentId`] to use when sending the payment.
+ * Frees any resources used by the Payee
  */
-MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
+void Payee_free(struct LDKPayee this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Bolt12Invoice.
+ * Creates a copy of the Payee
  */
-uint64_t Bolt12Invoice_hash(const struct LDKBolt12Invoice *NONNULL_PTR o);
+struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
 
 /**
- * Serialize the UnsignedBolt12Invoice object into a byte array which can be read by UnsignedBolt12Invoice_read
+ * Utility method to constructs a new Blinded-variant Payee
  */
-struct LDKCVec_u8Z UnsignedBolt12Invoice_write(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR obj);
+struct LDKPayee Payee_blinded(struct LDKCVec_BlindedPaymentPathZ route_hints, struct LDKBolt12InvoiceFeatures features);
 
 /**
- * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read
+ * Utility method to constructs a new Clear-variant Payee
  */
-struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj);
+struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta);
 
 /**
- * Frees any resources used by the BlindedPayInfo, if is_owned is set and inner is non-NULL.
+ * Generates a non-cryptographic 64-bit hash of the Payee.
  */
-void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj);
+uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
 
 /**
- * Base fee charged (in millisatoshi) for the entire blinded path.
+ * Checks if two Payees contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
+bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
 
 /**
- * Base fee charged (in millisatoshi) for the entire blinded path.
+ * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
  */
-void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
 
 /**
- * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
- * (i.e., 10,000 is 1%).
+ * Read a RouteHint from a byte array, created by RouteHint_write
  */
-uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
+struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
 
 /**
- * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
- * (i.e., 10,000 is 1%).
+ * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
  */
-void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
 
 /**
- * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
- * path.
+ * Read a RouteHintHop from a byte array, created by RouteHintHop_write
  */
-uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
+struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
 
 /**
- * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
- * path.
+ * Frees any resources used by the FirstHopCandidate, if is_owned is set and inner is non-NULL.
  */
-void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val);
+void FirstHopCandidate_free(struct LDKFirstHopCandidate this_obj);
 
 /**
- * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
- * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
- * seen by the recipient.
+ * Creates a copy of the FirstHopCandidate
  */
-uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
+struct LDKFirstHopCandidate FirstHopCandidate_clone(const struct LDKFirstHopCandidate *NONNULL_PTR orig);
 
 /**
- * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
- * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
- * seen by the recipient.
+ * Frees any resources used by the PublicHopCandidate, if is_owned is set and inner is non-NULL.
  */
-void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
+void PublicHopCandidate_free(struct LDKPublicHopCandidate this_obj);
 
 /**
- * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
- * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
- * seen by the recipient.
+ * The short channel ID of the channel, i.e. the identifier by which we refer to this
+ * channel.
  */
-uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
+uint64_t PublicHopCandidate_get_short_channel_id(const struct LDKPublicHopCandidate *NONNULL_PTR this_ptr);
 
 /**
- * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
- * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
- * seen by the recipient.
+ * The short channel ID of the channel, i.e. the identifier by which we refer to this
+ * channel.
  */
-void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
+void PublicHopCandidate_set_short_channel_id(struct LDKPublicHopCandidate *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
- * onion payload.
+ * Creates a copy of the PublicHopCandidate
  */
-struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
+struct LDKPublicHopCandidate PublicHopCandidate_clone(const struct LDKPublicHopCandidate *NONNULL_PTR orig);
 
 /**
- * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
- * onion payload.
+ * Frees any resources used by the PrivateHopCandidate, if is_owned is set and inner is non-NULL.
  */
-void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
+void PrivateHopCandidate_free(struct LDKPrivateHopCandidate this_obj);
 
 /**
- * Constructs a new BlindedPayInfo given each field
+ * Creates a copy of the PrivateHopCandidate
  */
-MUST_USE_RES struct LDKBlindedPayInfo BlindedPayInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKBlindedHopFeatures features_arg);
+struct LDKPrivateHopCandidate PrivateHopCandidate_clone(const struct LDKPrivateHopCandidate *NONNULL_PTR orig);
 
 /**
- * Creates a copy of the BlindedPayInfo
+ * Frees any resources used by the BlindedPathCandidate, if is_owned is set and inner is non-NULL.
  */
-struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig);
+void BlindedPathCandidate_free(struct LDKBlindedPathCandidate this_obj);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
+ * Creates a copy of the BlindedPathCandidate
  */
-uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o);
+struct LDKBlindedPathCandidate BlindedPathCandidate_clone(const struct LDKBlindedPathCandidate *NONNULL_PTR orig);
 
 /**
- * Checks if two BlindedPayInfos 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 OneHopBlindedPathCandidate, if is_owned is set and inner is non-NULL.
  */
-bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b);
+void OneHopBlindedPathCandidate_free(struct LDKOneHopBlindedPathCandidate this_obj);
 
 /**
- * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
+ * Creates a copy of the OneHopBlindedPathCandidate
  */
-struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj);
+struct LDKOneHopBlindedPathCandidate OneHopBlindedPathCandidate_clone(const struct LDKOneHopBlindedPathCandidate *NONNULL_PTR orig);
 
 /**
- * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
+ * Frees any resources used by the CandidateRouteHop
  */
-struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser);
+void CandidateRouteHop_free(struct LDKCandidateRouteHop this_ptr);
 
 /**
- * Frees any resources used by the InvoiceError, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the CandidateRouteHop
  */
-void InvoiceError_free(struct LDKInvoiceError this_obj);
+struct LDKCandidateRouteHop CandidateRouteHop_clone(const struct LDKCandidateRouteHop *NONNULL_PTR orig);
 
 /**
- * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
- *
- * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Utility method to constructs a new FirstHop-variant CandidateRouteHop
  */
-struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
+struct LDKCandidateRouteHop CandidateRouteHop_first_hop(struct LDKFirstHopCandidate a);
 
 /**
- * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
- *
- * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
- *
- * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Utility method to constructs a new PublicHop-variant CandidateRouteHop
  */
-void InvoiceError_set_erroneous_field(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKErroneousField val);
+struct LDKCandidateRouteHop CandidateRouteHop_public_hop(struct LDKPublicHopCandidate a);
 
 /**
- * An explanation of the error.
+ * Utility method to constructs a new PrivateHop-variant CandidateRouteHop
  */
-struct LDKUntrustedString InvoiceError_get_message(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
+struct LDKCandidateRouteHop CandidateRouteHop_private_hop(struct LDKPrivateHopCandidate a);
 
 /**
- * An explanation of the error.
+ * Utility method to constructs a new Blinded-variant CandidateRouteHop
  */
-void InvoiceError_set_message(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
+struct LDKCandidateRouteHop CandidateRouteHop_blinded(struct LDKBlindedPathCandidate a);
 
 /**
- * Constructs a new InvoiceError given each field
- *
- * Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Utility method to constructs a new OneHopBlinded-variant CandidateRouteHop
  */
-MUST_USE_RES struct LDKInvoiceError InvoiceError_new(struct LDKErroneousField erroneous_field_arg, struct LDKUntrustedString message_arg);
+struct LDKCandidateRouteHop CandidateRouteHop_one_hop_blinded(struct LDKOneHopBlindedPathCandidate a);
 
 /**
- * Creates a copy of the InvoiceError
+ * Returns the globally unique short channel ID for this hop, if one is known.
+ *
+ * This only returns `Some` if the channel is public (either our own, or one we've learned
+ * from the public network graph), and thus the short channel ID we have for this channel is
+ * globally unique and identifies this channel in a global namespace.
  */
-struct LDKInvoiceError InvoiceError_clone(const struct LDKInvoiceError *NONNULL_PTR orig);
+MUST_USE_RES struct LDKCOption_u64Z CandidateRouteHop_globally_unique_short_channel_id(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the ErroneousField, if is_owned is set and inner is non-NULL.
+ * Returns the required difference in HTLC CLTV expiry between the [`Self::source`] and the
+ * next-hop for an HTLC taking this hop.
+ *
+ * This is the time that the node(s) in this hop have to claim the HTLC on-chain if the
+ * next-hop goes on chain with a payment preimage.
  */
-void ErroneousField_free(struct LDKErroneousField this_obj);
+MUST_USE_RES uint32_t CandidateRouteHop_cltv_expiry_delta(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
 
 /**
- * The type number of the TLV field containing the error.
+ * Returns the minimum amount that can be sent over this hop, in millisatoshis.
  */
-uint64_t ErroneousField_get_tlv_fieldnum(const struct LDKErroneousField *NONNULL_PTR this_ptr);
+MUST_USE_RES uint64_t CandidateRouteHop_htlc_minimum_msat(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
 
 /**
- * The type number of the TLV field containing the error.
+ * Returns the fees that must be paid to route an HTLC over this channel.
  */
-void ErroneousField_set_tlv_fieldnum(struct LDKErroneousField *NONNULL_PTR this_ptr, uint64_t val);
+MUST_USE_RES struct LDKRoutingFees CandidateRouteHop_fees(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
 
 /**
- * A value to use for the TLV field to avoid the error.
+ * Returns the source node id of current hop.
  *
- * Returns a copy of the field.
+ * Source node id refers to the node forwarding the HTLC through this hop.
+ *
+ * For [`Self::FirstHop`] we return payer's node id.
  */
-struct LDKCOption_CVec_u8ZZ ErroneousField_get_suggested_value(const struct LDKErroneousField *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKNodeId CandidateRouteHop_source(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
 
 /**
- * A value to use for the TLV field to avoid the error.
+ * Returns the target node id of this hop, if known.
+ *
+ * Target node id refers to the node receiving the HTLC after this hop.
+ *
+ * For [`Self::Blinded`] we return `None` because the ultimate destination after the blinded
+ * path is unknown.
+ *
+ * For [`Self::OneHopBlinded`] we return `None` because the target is the same as the source,
+ * and such a return value would be somewhat nonsensical.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void ErroneousField_set_suggested_value(struct LDKErroneousField *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
+MUST_USE_RES struct LDKNodeId CandidateRouteHop_target(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new ErroneousField given each field
+ * 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 the `payee` field
+ * in the given [`RouteParameters::payment_params`].
+ * 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 the `payee` field
+ * of [`RouteParameters::payment_params`].
+ *
+ * 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 these channels
+ * from `network_graph` 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.
+ *
+ * # Panics
+ *
+ * Panics if first_hops contains channels without `short_channel_id`s;
+ * [`ChannelManager::list_usable_channels`] will never include such channels.
+ *
+ * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
+ * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
+ * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
+ *
+ * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKErroneousField ErroneousField_new(uint64_t tlv_fieldnum_arg, struct LDKCOption_CVec_u8ZZ suggested_value_arg);
+struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScoreLookUp *NONNULL_PTR scorer, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params, const uint8_t (*random_seed_bytes)[32]);
 
 /**
- * Creates a copy of the ErroneousField
+ * Construct a route from us (payer) to the target node (payee) via the given hops (which should
+ * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
+ *
+ * Re-uses logic from `find_route`, so the restrictions described there also apply here.
  */
-struct LDKErroneousField ErroneousField_clone(const struct LDKErroneousField *NONNULL_PTR orig);
+struct LDKCResult_RouteLightningErrorZ build_route_from_hops(struct LDKPublicKey our_node_pubkey, struct LDKCVec_PublicKeyZ hops, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, const uint8_t (*random_seed_bytes)[32]);
 
 /**
- * Creates an [`InvoiceError`] with the given message.
+ * Calls the free function if one is set
  */
-MUST_USE_RES struct LDKInvoiceError InvoiceError_from_string(struct LDKStr s);
+void ScoreLookUp_free(struct LDKScoreLookUp this_ptr);
 
 /**
- * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
+ * Calls the free function if one is set
  */
-struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj);
+void ScoreUpdate_free(struct LDKScoreUpdate this_ptr);
 
 /**
- * Read a InvoiceError from a byte array, created by InvoiceError_write
+ * Calls the free function if one is set
  */
-struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser);
+void Score_free(struct LDKScore this_ptr);
 
 /**
- * Frees any resources used by the InvoiceRequestWithExplicitPayerIdBuilder, if is_owned is set and inner is non-NULL.
+ * Calls the free function if one is set
  */
-void InvoiceRequestWithExplicitPayerIdBuilder_free(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_obj);
+void LockableScore_free(struct LDKLockableScore this_ptr);
 
 /**
- * Frees any resources used by the InvoiceRequestWithDerivedPayerIdBuilder, if is_owned is set and inner is non-NULL.
+ * Calls the free function if one is set
  */
-void InvoiceRequestWithDerivedPayerIdBuilder_free(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_obj);
+void WriteableScore_free(struct LDKWriteableScore this_ptr);
 
 /**
- * Builds an unsigned [`InvoiceRequest`] after checking for valid semantics. It can be signed
- * by [`UnsignedInvoiceRequest::sign`].
+ * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_build(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg);
+void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
 
 /**
- * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not
- * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported
- * by the offer.
- *
- * Successive calls to this method will override the previous setting.
+ * Constructs a new LockableScore which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
  */
-MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_chain(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, enum LDKNetwork network);
+struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
 
 /**
- * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is
- * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]).
- *
- * Successive calls to this method will override the previous setting.
- *
- * [`quantity`]: Self::quantity
+ * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
  */
-MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t amount_msats);
+struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
 
 /**
- * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity`
- * does not conform to [`Offer::is_valid_quantity`].
- *
- * Successive calls to this method will override the previous setting.
+ * Constructs a new WriteableScore which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
  */
-MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_quantity(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t quantity);
+struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
 
 /**
- * Sets the [`InvoiceRequest::payer_note`].
- *
- * Successive calls to this method will override the previous setting.
+ * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
  */
-MUST_USE_RES void InvoiceRequestWithExplicitPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, struct LDKStr payer_note);
+MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
 
 /**
- * Builds a signed [`InvoiceRequest`] after checking for valid semantics.
+ * Frees any resources used by the MultiThreadedScoreLockRead, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg);
+void MultiThreadedScoreLockRead_free(struct LDKMultiThreadedScoreLockRead this_obj);
 
 /**
- * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not
- * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported
- * by the offer.
- *
- * Successive calls to this method will override the previous setting.
+ * Frees any resources used by the MultiThreadedScoreLockWrite, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_chain(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, enum LDKNetwork network);
+void MultiThreadedScoreLockWrite_free(struct LDKMultiThreadedScoreLockWrite this_obj);
 
 /**
- * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is
- * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]).
- *
- * Successive calls to this method will override the previous setting.
- *
- * [`quantity`]: Self::quantity
+ * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
  */
-MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t amount_msats);
+struct LDKScoreLookUp MultiThreadedScoreLockRead_as_ScoreLookUp(const struct LDKMultiThreadedScoreLockRead *NONNULL_PTR this_arg);
 
 /**
- * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity`
- * does not conform to [`Offer::is_valid_quantity`].
- *
- * Successive calls to this method will override the previous setting.
+ * Serialize the MultiThreadedScoreLockWrite object into a byte array which can be read by MultiThreadedScoreLockWrite_read
  */
-MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_quantity(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t quantity);
+struct LDKCVec_u8Z MultiThreadedScoreLockWrite_write(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR obj);
 
 /**
- * Sets the [`InvoiceRequest::payer_note`].
- *
- * Successive calls to this method will override the previous setting.
+ * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
  */
-MUST_USE_RES void InvoiceRequestWithDerivedPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, struct LDKStr payer_note);
+struct LDKScoreUpdate MultiThreadedScoreLockWrite_as_ScoreUpdate(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the UnsignedInvoiceRequest, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
  */
-void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj);
+void ChannelUsage_free(struct LDKChannelUsage this_obj);
 
 /**
- * Creates a copy of the UnsignedInvoiceRequest
+ * The amount to send through the channel, denominated in millisatoshis.
  */
-struct LDKUnsignedInvoiceRequest UnsignedInvoiceRequest_clone(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR orig);
+uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
 
 /**
- * Calls the free function if one is set
+ * The amount to send through the channel, denominated in millisatoshis.
  */
-void SignInvoiceRequestFn_free(struct LDKSignInvoiceRequestFn this_ptr);
+void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Returns the [`TaggedHash`] of the invoice to sign.
+ * Total amount, denominated in millisatoshis, already allocated to send through the channel
+ * as part of a multi-path payment.
  */
-MUST_USE_RES struct LDKTaggedHash UnsignedInvoiceRequest_tagged_hash(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the InvoiceRequest, if is_owned is set and inner is non-NULL.
+ * Total amount, denominated in millisatoshis, already allocated to send through the channel
+ * as part of a multi-path payment.
  */
-void InvoiceRequest_free(struct LDKInvoiceRequest this_obj);
+void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Creates a copy of the InvoiceRequest
+ * The effective capacity of the channel.
  */
-struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig);
+struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the VerifiedInvoiceRequest, if is_owned is set and inner is non-NULL.
+ * The effective capacity of the channel.
  */
-void VerifiedInvoiceRequest_free(struct LDKVerifiedInvoiceRequest this_obj);
+void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
 
 /**
- * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made.
+ * Constructs a new ChannelUsage given each field
  */
-struct LDKOfferId VerifiedInvoiceRequest_get_offer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
 
 /**
- * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made.
+ * Creates a copy of the ChannelUsage
  */
-void VerifiedInvoiceRequest_set_offer_id(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKOfferId val);
+struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
 
 /**
- * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
- *
- * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
- * [`respond_with`].
- *
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
- * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
- * [`respond_with`]: Self::respond_with
+ * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
  */
-struct LDKCOption_SecretKeyZ VerifiedInvoiceRequest_get_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
+void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
 
 /**
- * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
- *
- * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
- * [`respond_with`].
- *
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
- * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
- * [`respond_with`]: Self::respond_with
+ * Creates a copy of the FixedPenaltyScorer
  */
-void VerifiedInvoiceRequest_set_keys(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKCOption_SecretKeyZ val);
+struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
 
 /**
- * Creates a copy of the VerifiedInvoiceRequest
+ * Creates a new scorer using `penalty_msat`.
  */
-struct LDKVerifiedInvoiceRequest VerifiedInvoiceRequest_clone(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR orig);
+MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
 
 /**
- * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
- * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
- * for the selected chain.
+ * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
  */
-MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ UnsignedInvoiceRequest_chains(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+struct LDKScoreLookUp FixedPenaltyScorer_as_ScoreLookUp(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
 
 /**
- * Opaque bytes set by the originator. Useful for authentication and validating fields since it
- * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
+ * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
  */
-MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedInvoiceRequest_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+struct LDKScoreUpdate FixedPenaltyScorer_as_ScoreUpdate(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
 
 /**
- * The minimum amount required for a successful payment of a single item.
+ * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
  */
-MUST_USE_RES struct LDKCOption_AmountZ UnsignedInvoiceRequest_amount(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
 
 /**
- * A complete description of the purpose of the payment. Intended to be displayed to the user
- * but with the caveat that it has not been verified in any way.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
  */
-MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_description(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
 
 /**
- * Features pertaining to the offer.
+ * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKOfferFeatures UnsignedInvoiceRequest_offer_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
 
 /**
- * Duration since the Unix epoch when an invoice should no longer be requested.
- *
- * If `None`, the offer does not expire.
+ * Frees any resources used by the ProbabilisticScoringFeeParameters, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_absolute_expiry(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_free(struct LDKProbabilisticScoringFeeParameters this_obj);
 
 /**
- * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
- * displayed to the user but with the caveat that it has not been verified in any way.
+ * A fixed penalty in msats to apply to each channel.
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Default value: 500 msat
  */
-MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_issuer(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
 
 /**
- * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
- * recipient privacy by obfuscating its node id.
+ * A fixed penalty in msats to apply to each channel.
+ *
+ * Default value: 500 msat
  */
-MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_set_base_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The quantity of items supported.
+ * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
+ * applied to each channel, in excess of the [`base_penalty_msat`].
+ *
+ * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
+ * fees plus penalty) for large payments. The penalty is computed as the product of this
+ * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
+ * amount plus the amount of any other HTLCs flowing we sent over the same channel).
+ *
+ * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
+ *
+ * Default value: 8,192 msat
+ *
+ * [`base_penalty_msat`]: Self::base_penalty_msat
  */
-MUST_USE_RES struct LDKQuantity UnsignedInvoiceRequest_supported_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
 
 /**
- * The public key used by the recipient to sign invoices.
+ * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
+ * applied to each channel, in excess of the [`base_penalty_msat`].
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
+ * fees plus penalty) for large payments. The penalty is computed as the product of this
+ * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
+ * amount plus the amount of any other HTLCs flowing we sent over the same channel).
+ *
+ * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
+ *
+ * Default value: 8,192 msat
+ *
+ * [`base_penalty_msat`]: Self::base_penalty_msat
  */
-MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * An unpredictable series of bytes, typically containing information about the derivation of
- * [`payer_id`].
+ * A multiplier used in conjunction with the negative `log10` of the channel's success
+ * probability for a payment, as determined by our latest estimates of the channel's
+ * liquidity, to determine the liquidity penalty.
  *
- * [`payer_id`]: Self::payer_id
+ * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
+ * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
+ * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
+ * lower bounding the success probability to `0.01`) when the amount falls within the
+ * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
+ * result in a `u64::max_value` penalty, however.
+ *
+ * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
+ *
+ * Default value: 30,000 msat
+ *
+ * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
  */
-MUST_USE_RES struct LDKu8slice UnsignedInvoiceRequest_payer_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
 
 /**
- * A chain from [`Offer::chains`] that the offer is valid for.
+ * A multiplier used in conjunction with the negative `log10` of the channel's success
+ * probability for a payment, as determined by our latest estimates of the channel's
+ * liquidity, to determine the liquidity penalty.
+ *
+ * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
+ * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
+ * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
+ * lower bounding the success probability to `0.01`) when the amount falls within the
+ * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
+ * result in a `u64::max_value` penalty, however.
+ *
+ * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
+ *
+ * Default value: 30,000 msat
+ *
+ * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
  */
-MUST_USE_RES struct LDKThirtyTwoBytes UnsignedInvoiceRequest_chain(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
- * must be greater than or equal to [`Offer::amount`], converted if necessary.
+ * A multiplier used in conjunction with the total amount flowing over a channel and the
+ * negative `log10` of the channel's success probability for the payment, as determined by our
+ * latest estimates of the channel's liquidity, to determine the amount penalty.
  *
- * [`chain`]: Self::chain
+ * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
+ * fees plus penalty) for large payments. The penalty is computed as the product of this
+ * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
+ * `log10` of the success probability.
+ *
+ * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
+ *
+ * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
+ * the amount will result in a penalty of the multiplier. And, as the success probability
+ * decreases, the negative `log10` weighting will increase dramatically. For higher success
+ * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
+ * fall below `1`.
+ *
+ * Default value: 192 msat
  */
-MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_amount_msats(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
 
 /**
- * Features pertaining to requesting an invoice.
+ * A multiplier used in conjunction with the total amount flowing over a channel and the
+ * negative `log10` of the channel's success probability for the payment, as determined by our
+ * latest estimates of the channel's liquidity, to determine the amount penalty.
+ *
+ * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
+ * fees plus penalty) for large payments. The penalty is computed as the product of this
+ * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
+ * `log10` of the success probability.
+ *
+ * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
+ *
+ * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
+ * the amount will result in a penalty of the multiplier. And, as the success probability
+ * decreases, the negative `log10` weighting will increase dramatically. For higher success
+ * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
+ * fall below `1`.
+ *
+ * Default value: 192 msat
  */
-MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedInvoiceRequest_invoice_request_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
+ * A multiplier used in conjunction with the negative `log10` of the channel's success
+ * probability for the payment, as determined based on the history of our estimates of the
+ * channel's available liquidity, to determine a penalty.
+ *
+ * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
+ * only our latest estimate for the current liquidity available in the channel, it estimates
+ * success probability based on the estimated liquidity available in the channel through
+ * history. Specifically, every time we update our liquidity bounds on a given channel, we
+ * track which of several buckets those bounds fall into, exponentially decaying the
+ * probability of each bucket as new samples are added.
+ *
+ * Default value: 10,000 msat
+ *
+ * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
  */
-MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
 
 /**
- * A possibly transient pubkey used to sign the invoice request.
+ * A multiplier used in conjunction with the negative `log10` of the channel's success
+ * probability for the payment, as determined based on the history of our estimates of the
+ * channel's available liquidity, to determine a penalty.
+ *
+ * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
+ * only our latest estimate for the current liquidity available in the channel, it estimates
+ * success probability based on the estimated liquidity available in the channel through
+ * history. Specifically, every time we update our liquidity bounds on a given channel, we
+ * track which of several buckets those bounds fall into, exponentially decaying the
+ * probability of each bucket as new samples are added.
+ *
+ * Default value: 10,000 msat
+ *
+ * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
  */
-MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_payer_id(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * A payer-provided note which will be seen by the recipient and reflected back in the invoice
- * response.
+ * A multiplier used in conjunction with the total amount flowing over a channel and the
+ * negative `log10` of the channel's success probability for the payment, as determined based
+ * on the history of our estimates of the channel's available liquidity, to determine a
+ * penalty.
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
+ * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
+ * of the amount flowing over this channel, weighted by the negative `log10` of the success
+ * probability.
+ *
+ * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
+ * of using only our latest estimate for the current liquidity available in the channel, it
+ * estimates success probability based on the estimated liquidity available in the channel
+ * through history. Specifically, every time we update our liquidity bounds on a given
+ * channel, we track which of several buckets those bounds fall into, exponentially decaying
+ * the probability of each bucket as new samples are added.
+ *
+ * Default value: 64 msat
+ *
+ * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
  */
-MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_payer_note(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
+uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
 
 /**
- * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
- * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
- * for the selected chain.
+ * A multiplier used in conjunction with the total amount flowing over a channel and the
+ * negative `log10` of the channel's success probability for the payment, as determined based
+ * on the history of our estimates of the channel's available liquidity, to determine a
+ * penalty.
+ *
+ * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
+ * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
+ * of the amount flowing over this channel, weighted by the negative `log10` of the success
+ * probability.
+ *
+ * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
+ * of using only our latest estimate for the current liquidity available in the channel, it
+ * estimates success probability based on the estimated liquidity available in the channel
+ * through history. Specifically, every time we update our liquidity bounds on a given
+ * channel, we track which of several buckets those bounds fall into, exponentially decaying
+ * the probability of each bucket as new samples are added.
+ *
+ * Default value: 64 msat
+ *
+ * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
  */
-MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ InvoiceRequest_chains(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Opaque bytes set by the originator. Useful for authentication and validating fields since it
- * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
+ * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
+ * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
+ * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
+ * as this makes balance discovery attacks harder to execute, thereby creating an incentive
+ * to restrict `htlc_maximum_msat` and improve privacy.
+ *
+ * Default value: 250 msat
  */
-MUST_USE_RES struct LDKCOption_CVec_u8ZZ InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+uint64_t ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
 
 /**
- * The minimum amount required for a successful payment of a single item.
+ * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
+ * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
+ * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
+ * as this makes balance discovery attacks harder to execute, thereby creating an incentive
+ * to restrict `htlc_maximum_msat` and improve privacy.
+ *
+ * Default value: 250 msat
  */
-MUST_USE_RES struct LDKCOption_AmountZ InvoiceRequest_amount(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * A complete description of the purpose of the payment. Intended to be displayed to the user
- * but with the caveat that it has not been verified in any way.
+ * This penalty is applied when the total amount flowing over a channel exceeds our current
+ * estimate of the channel's available liquidity. The total amount is the amount of the
+ * current HTLC plus any HTLCs which we've sent over the same channel.
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that in this case all other penalties, including the
+ * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
+ * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
+ * applicable, are still included in the overall penalty.
+ *
+ * If you wish to avoid creating paths with such channels entirely, setting this to a value of
+ * `u64::max_value()` will guarantee that.
+ *
+ * Default value: 1_0000_0000_000 msat (1 Bitcoin)
+ *
+ * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
+ * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
+ * [`base_penalty_msat`]: Self::base_penalty_msat
+ * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
  */
-MUST_USE_RES struct LDKPrintableString InvoiceRequest_description(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+uint64_t ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
 
 /**
- * Features pertaining to the offer.
+ * This penalty is applied when the total amount flowing over a channel exceeds our current
+ * estimate of the channel's available liquidity. The total amount is the amount of the
+ * current HTLC plus any HTLCs which we've sent over the same channel.
+ *
+ * Note that in this case all other penalties, including the
+ * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
+ * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
+ * applicable, are still included in the overall penalty.
+ *
+ * If you wish to avoid creating paths with such channels entirely, setting this to a value of
+ * `u64::max_value()` will guarantee that.
+ *
+ * Default value: 1_0000_0000_000 msat (1 Bitcoin)
+ *
+ * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
+ * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
+ * [`base_penalty_msat`]: Self::base_penalty_msat
+ * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
  */
-MUST_USE_RES struct LDKOfferFeatures InvoiceRequest_offer_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Duration since the Unix epoch when an invoice should no longer be requested.
+ * In order to calculate most of the scores above, we must first convert a lower and upper
+ * bound on the available liquidity in a channel into the probability that we think a payment
+ * will succeed. That probability is derived from a Probability Density Function for where we
+ * think the liquidity in a channel likely lies, given such bounds.
  *
- * If `None`, the offer does not expire.
+ * If this flag is set, that PDF is simply a constant - we assume that the actual available
+ * liquidity in a channel is just as likely to be at any point between our lower and upper
+ * bounds.
+ *
+ * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
+ * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
+ * matches experimental results - most routing nodes do not aggressively rebalance their
+ * channels and flows in the network are often unbalanced, leaving liquidity usually
+ * unavailable.
+ *
+ * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
+ * of floating-point multiplications in the hottest routing code, which may lead to routing
+ * performance degradation on some machines.
+ *
+ * Default value: false
  */
-MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_absolute_expiry(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+bool ProbabilisticScoringFeeParameters_get_linear_success_probability(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
 
 /**
- * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
- * displayed to the user but with the caveat that it has not been verified in any way.
+ * In order to calculate most of the scores above, we must first convert a lower and upper
+ * bound on the available liquidity in a channel into the probability that we think a payment
+ * will succeed. That probability is derived from a Probability Density Function for where we
+ * think the liquidity in a channel likely lies, given such bounds.
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * If this flag is set, that PDF is simply a constant - we assume that the actual available
+ * liquidity in a channel is just as likely to be at any point between our lower and upper
+ * bounds.
+ *
+ * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
+ * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
+ * matches experimental results - most routing nodes do not aggressively rebalance their
+ * channels and flows in the network are often unbalanced, leaving liquidity usually
+ * unavailable.
+ *
+ * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
+ * of floating-point multiplications in the hottest routing code, which may lead to routing
+ * performance degradation on some machines.
+ *
+ * Default value: false
  */
-MUST_USE_RES struct LDKPrintableString InvoiceRequest_issuer(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_set_linear_success_probability(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, bool val);
 
 /**
- * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
- * recipient privacy by obfuscating its node id.
+ * Creates a copy of the ProbabilisticScoringFeeParameters
  */
-MUST_USE_RES struct LDKCVec_BlindedPathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_clone(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR orig);
 
 /**
- * The quantity of items supported.
+ * Creates a "default" ProbabilisticScoringFeeParameters. See struct and individual field documentaiton for details on which values are used.
  */
-MUST_USE_RES struct LDKQuantity InvoiceRequest_supported_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_default(void);
 
 /**
- * The public key used by the recipient to sign invoices.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Marks the node with the given `node_id` as banned,
+ * i.e it will be avoided during path finding.
  */
-MUST_USE_RES struct LDKPublicKey InvoiceRequest_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_add_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
 
 /**
- * An unpredictable series of bytes, typically containing information about the derivation of
- * [`payer_id`].
- *
- * [`payer_id`]: Self::payer_id
+ * Marks all nodes in the given list as banned, i.e.,
+ * they will be avoided during path finding.
  */
-MUST_USE_RES struct LDKu8slice InvoiceRequest_payer_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_add_banned_from_list(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
 
 /**
- * A chain from [`Offer::chains`] that the offer is valid for.
+ * Removes the node with the given `node_id` from the list of nodes to avoid.
  */
-MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_remove_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
 
 /**
- * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
- * must be greater than or equal to [`Offer::amount`], converted if necessary.
- *
- * [`chain`]: Self::chain
+ * Sets a manual penalty for the given node.
  */
-MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_set_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
 
 /**
- * Features pertaining to requesting an invoice.
+ * Removes the node with the given `node_id` from the list of manual penalties.
  */
-MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_invoice_request_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_remove_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
 
 /**
- * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
+ * Clears the list of manual penalties that are applied during path finding.
  */
-MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringFeeParameters_clear_manual_penalties(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg);
 
 /**
- * A possibly transient pubkey used to sign the invoice request.
+ * Frees any resources used by the ProbabilisticScoringDecayParameters, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScoringDecayParameters_free(struct LDKProbabilisticScoringDecayParameters this_obj);
 
 /**
- * A payer-provided note which will be seen by the recipient and reflected back in the invoice
- * response.
+ * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
+ * tracking can simply live on with increasingly stale data. Instead, when a channel has not
+ * seen a liquidity estimate update for this amount of time, the historical datapoints are
+ * decayed by half.
+ * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that after 16 or more half lives all historical data will be completely gone.
+ *
+ * Default value: 14 days
+ *
+ * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
  */
-MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+uint64_t ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
 
 /**
- * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the
- * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time.
+ * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
+ * tracking can simply live on with increasingly stale data. Instead, when a channel has not
+ * seen a liquidity estimate update for this amount of time, the historical datapoints are
+ * decayed by half.
+ * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
  *
- * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned
- * creation time is used for the `created_at` parameter.
+ * Note that after 16 or more half lives all historical data will be completely gone.
  *
- * [`Duration`]: core::time::Duration
+ * Default value: 14 days
+ *
+ * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
  */
-MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash);
+void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Creates an [`InvoiceBuilder`] for the request with the given required fields.
- *
- * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after
- * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds
- * where [`std::time::SystemTime`] is not available.
+ * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
+ * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
+ * the available liquidity is halved and the upper-bound moves half-way to the channel's total
+ * capacity.
  *
- * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment
- * for the invoice.
+ * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
+ * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
+ * struct documentation for more info on the way the liquidity bounds are used.
  *
- * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It
- * must contain one or more elements ordered from most-preferred to least-preferred, if there's
- * a preference. Note, however, that any privacy is lost if a public node id was used for
- * [`Offer::signing_pubkey`].
+ * For example, if the channel's capacity is 1 million sats, and the current upper and lower
+ * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
+ * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
  *
- * Errors if the request contains unknown required features.
+ * Default value: 6 hours
  *
  * # Note
  *
- * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`],
- * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead.
- *
- * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at
- * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey
+ * When built with the `no-std` feature, time will never elapse. Therefore, the channel
+ * liquidity knowledge will never decay except when the bounds cross.
  */
-MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with_no_std(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
+uint64_t ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
 
 /**
- * Verifies that the request was for an offer created using the given key. Returns the verified
- * request which contains the derived keys needed to sign a [`Bolt12Invoice`] for the request
- * if they could be extracted from the metadata.
+ * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
+ * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
+ * the available liquidity is halved and the upper-bound moves half-way to the channel's total
+ * capacity.
  *
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
+ * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
+ * struct documentation for more info on the way the liquidity bounds are used.
+ *
+ * For example, if the channel's capacity is 1 million sats, and the current upper and lower
+ * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
+ * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
+ *
+ * Default value: 6 hours
+ *
+ * # Note
+ *
+ * When built with the `no-std` feature, time will never elapse. Therefore, the channel
+ * liquidity knowledge will never decay except when the bounds cross.
  */
-MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
+void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Signature of the invoice request using [`payer_id`].
- *
- * [`payer_id`]: Self::payer_id
+ * Constructs a new ProbabilisticScoringDecayParameters given each field
  */
-MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_new(uint64_t historical_no_updates_half_life_arg, uint64_t liquidity_offset_half_life_arg);
 
 /**
- * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
- * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
- * for the selected chain.
+ * Creates a copy of the ProbabilisticScoringDecayParameters
  */
-MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ VerifiedInvoiceRequest_chains(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_clone(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR orig);
 
 /**
- * Opaque bytes set by the originator. Useful for authentication and validating fields since it
- * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
+ * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used.
  */
-MUST_USE_RES struct LDKCOption_CVec_u8ZZ VerifiedInvoiceRequest_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_default(void);
 
 /**
- * The minimum amount required for a successful payment of a single item.
+ * Creates a new scorer using the given scoring parameters for sending payments from a node
+ * through a network graph.
  */
-MUST_USE_RES struct LDKCOption_AmountZ VerifiedInvoiceRequest_amount(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringDecayParameters decay_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
 
 /**
- * A complete description of the purpose of the payment. Intended to be displayed to the user
- * but with the caveat that it has not been verified in any way.
+ * Dump the contents of this scorer into the configured logger.
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that this writes roughly one line per channel for which we have a liquidity estimate,
+ * which may be a substantial amount of log output.
  */
-MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_description(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
 
 /**
- * Features pertaining to the offer.
+ * Query the estimated minimum and maximum liquidity available for sending a payment over the
+ * channel with `scid` towards the given `target` node.
  */
-MUST_USE_RES struct LDKOfferFeatures VerifiedInvoiceRequest_offer_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_C2Tuple_u64u64ZZ ProbabilisticScorer_estimated_channel_liquidity_range(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target);
 
 /**
- * Duration since the Unix epoch when an invoice should no longer be requested.
+ * Query the historical estimated minimum and maximum liquidity available for sending a
+ * payment over the channel with `scid` towards the given `target` node.
  *
- * If `None`, the offer does not expire.
- */
-MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_absolute_expiry(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
-
-/**
- * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
- * displayed to the user but with the caveat that it has not been verified in any way.
+ * Returns two sets of 32 buckets. The first set describes the lower-bound liquidity history,
+ * the second set describes the upper-bound liquidity history. Each bucket describes the
+ * relative frequency at which we've seen a liquidity bound in the bucket's range relative to
+ * the channel's total capacity, on an arbitrary scale. Because the values are slowly decayed,
+ * more recent data points are weighted more heavily than older datapoints.
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that the range of each bucket varies by its location to provide more granular results
+ * at the edges of a channel's capacity, where it is more likely to sit.
+ *
+ * When scoring, the estimated probability that an upper-/lower-bound lies in a given bucket
+ * is calculated by dividing that bucket's value with the total value of all buckets.
+ *
+ * For example, using a lower bucket count for illustrative purposes, a value of
+ * `[0, 0, 0, ..., 0, 32]` indicates that we believe the probability of a bound being very
+ * close to the channel's capacity to be 100%, and have never (recently) seen it in any other
+ * bucket. A value of `[31, 0, 0, ..., 0, 0, 32]` indicates we've seen the bound being both
+ * in the top and bottom bucket, and roughly with similar (recent) frequency.
+ *
+ * Because the datapoints are decayed slowly over time, values will eventually return to
+ * `Some(([0; 32], [0; 32]))` or `None` if no data remains for a channel.
+ *
+ * In order to fetch a single success probability from the buckets provided here, as used in
+ * the scoring model, see [`Self::historical_estimated_payment_success_probability`].
  */
-MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_issuer(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target);
 
 /**
- * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
- * recipient privacy by obfuscating its node id.
+ * Query the probability of payment success sending the given `amount_msat` over the channel
+ * with `scid` towards the given `target` node, based on the historical estimated liquidity
+ * bounds.
+ *
+ * These are the same bounds as returned by
+ * [`Self::historical_estimated_channel_liquidity_probabilities`] (but not those returned by
+ * [`Self::estimated_channel_liquidity_range`]).
  */
-MUST_USE_RES struct LDKCVec_BlindedPathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_f64Z ProbabilisticScorer_historical_estimated_payment_success_probability(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target, uint64_t amount_msat, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR params);
 
 /**
- * The quantity of items supported.
+ * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
  */
-MUST_USE_RES struct LDKQuantity VerifiedInvoiceRequest_supported_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+struct LDKScoreLookUp ProbabilisticScorer_as_ScoreLookUp(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
 
 /**
- * The public key used by the recipient to sign invoices.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
  */
-MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+struct LDKScoreUpdate ProbabilisticScorer_as_ScoreUpdate(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
 
 /**
- * An unpredictable series of bytes, typically containing information about the derivation of
- * [`payer_id`].
- *
- * [`payer_id`]: Self::payer_id
+ * 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
  */
-MUST_USE_RES struct LDKu8slice VerifiedInvoiceRequest_payer_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
 
 /**
- * A chain from [`Offer::chains`] that the offer is valid for.
+ * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
  */
-MUST_USE_RES struct LDKThirtyTwoBytes VerifiedInvoiceRequest_chain(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
 
 /**
- * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
- * must be greater than or equal to [`Offer::amount`], converted if necessary.
- *
- * [`chain`]: Self::chain
+ * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
  */
-MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_amount_msats(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringDecayParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
 
 /**
- * Features pertaining to requesting an invoice.
+ * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKInvoiceRequestFeatures VerifiedInvoiceRequest_invoice_request_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
 
 /**
- * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
+ * The outpoint which is spendable.
  */
-MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * A possibly transient pubkey used to sign the invoice request.
+ * The outpoint which is spendable.
  */
-MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_payer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
 
 /**
- * A payer-provided note which will be seen by the recipient and reflected back in the invoice
- * response.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Per commitment point to derive the delayed payment key by key holder.
  */
-MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_payer_note(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
+struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the
- * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time.
- *
- * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned
- * creation time is used for the `created_at` parameter.
- *
- * [`Duration`]: core::time::Duration
+ * Per commitment point to derive the delayed payment key by key holder.
  */
-MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash);
+void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Creates an [`InvoiceBuilder`] for the request with the given required fields.
- *
- * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after
- * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds
- * where [`std::time::SystemTime`] is not available.
- *
- * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment
- * for the invoice.
- *
- * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It
- * must contain one or more elements ordered from most-preferred to least-preferred, if there's
- * a preference. Note, however, that any privacy is lost if a public node id was used for
- * [`Offer::signing_pubkey`].
- *
- * Errors if the request contains unknown required features.
- *
- * # Note
- *
- * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`],
- * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead.
- *
- * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at
- * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey
+ * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
+ * the witness_script.
  */
-MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
+uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses
- * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use
- * the same [`ExpandedKey`] as the one used to create the offer.
- *
- * See [`InvoiceRequest::respond_with`] for further details.
- *
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
+ * the witness_script.
  */
-MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash);
+void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
- * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses
- * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use
- * the same [`ExpandedKey`] as the one used to create the offer.
- *
- * See [`InvoiceRequest::respond_with_no_std`] for further details.
- *
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * The output which is referenced by the given outpoint.
  */
-MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
+struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
+ * The output which is referenced by the given outpoint.
  */
-struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj);
+void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
 
 /**
- * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read
+ * The revocation point specific to the commitment transaction which was broadcast. Used to
+ * derive the witnessScript for this output.
  */
-struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);
+struct LDKRevocationKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the InvoiceRequestFields, if is_owned is set and inner is non-NULL.
+ * The revocation point specific to the commitment transaction which was broadcast. Used to
+ * derive the witnessScript for this output.
  */
-void InvoiceRequestFields_free(struct LDKInvoiceRequestFields this_obj);
+void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
 
 /**
- * A possibly transient pubkey used to sign the invoice request.
+ * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
+ * This may be useful in re-deriving keys used in the channel to spend the output.
  */
-struct LDKPublicKey InvoiceRequestFields_get_payer_id(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
+const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
 
 /**
- * A possibly transient pubkey used to sign the invoice request.
+ * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
+ * This may be useful in re-deriving keys used in the channel to spend the output.
  */
-void InvoiceRequestFields_set_payer_id(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
+ * The value of the channel which this output originated from, possibly indirectly.
  */
-struct LDKCOption_u64Z InvoiceRequestFields_get_quantity(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
+uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
+ * The value of the channel which this output originated from, possibly indirectly.
  */
-void InvoiceRequestFields_set_quantity(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * A payer-provided note which will be seen by the recipient and reflected back in the invoice
- * response. Truncated to [`PAYER_NOTE_LIMIT`] characters.
+ * The channel public keys and other parameters needed to generate a spending transaction or
+ * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`].
+ *
+ * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later.
  *
  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKUntrustedString InvoiceRequestFields_get_payer_note_truncated(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
+struct LDKChannelTransactionParameters DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * A payer-provided note which will be seen by the recipient and reflected back in the invoice
- * response. Truncated to [`PAYER_NOTE_LIMIT`] characters.
+ * The channel public keys and other parameters needed to generate a spending transaction or
+ * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`].
+ *
+ * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later.
  *
  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void InvoiceRequestFields_set_payer_note_truncated(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
+void DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
 
 /**
- * Constructs a new InvoiceRequestFields given each field
+ * Constructs a new DelayedPaymentOutputDescriptor given each field
  *
- * Note that payer_note_truncated_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
- */
-MUST_USE_RES struct LDKInvoiceRequestFields InvoiceRequestFields_new(struct LDKPublicKey payer_id_arg, struct LDKCOption_u64Z quantity_arg, struct LDKUntrustedString payer_note_truncated_arg);
-
-/**
- * Creates a copy of the InvoiceRequestFields
- */
-struct LDKInvoiceRequestFields InvoiceRequestFields_clone(const struct LDKInvoiceRequestFields *NONNULL_PTR orig);
-
-/**
- * Checks if two InvoiceRequestFieldss 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 InvoiceRequestFields_eq(const struct LDKInvoiceRequestFields *NONNULL_PTR a, const struct LDKInvoiceRequestFields *NONNULL_PTR b);
-
-/**
- * Serialize the InvoiceRequestFields object into a byte array which can be read by InvoiceRequestFields_read
- */
-struct LDKCVec_u8Z InvoiceRequestFields_write(const struct LDKInvoiceRequestFields *NONNULL_PTR obj);
-
-/**
- * Read a InvoiceRequestFields from a byte array, created by InvoiceRequestFields_write
- */
-struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ InvoiceRequestFields_read(struct LDKu8slice ser);
-
-/**
- * Frees any resources used by the TaggedHash, if is_owned is set and inner is non-NULL.
+ * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void TaggedHash_free(struct LDKTaggedHash this_obj);
+MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKRevocationKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg, struct LDKChannelTransactionParameters channel_transaction_parameters_arg);
 
 /**
- * Creates a copy of the TaggedHash
+ * Creates a copy of the DelayedPaymentOutputDescriptor
  */
-struct LDKTaggedHash TaggedHash_clone(const struct LDKTaggedHash *NONNULL_PTR orig);
+struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
 
 /**
- * Returns the digest to sign.
+ * Generates a non-cryptographic 64-bit hash of the DelayedPaymentOutputDescriptor.
  */
-MUST_USE_RES const uint8_t (*TaggedHash_as_digest(const struct LDKTaggedHash *NONNULL_PTR this_arg))[32];
+uint64_t DelayedPaymentOutputDescriptor_hash(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR o);
 
 /**
- * Returns the tag used in the tagged hash.
+ * Checks if two DelayedPaymentOutputDescriptors 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.
  */
-MUST_USE_RES struct LDKStr TaggedHash_tag(const struct LDKTaggedHash *NONNULL_PTR this_arg);
+bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
 
 /**
- * Returns the merkle root used in the tagged hash.
+ * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
  */
-MUST_USE_RES struct LDKThirtyTwoBytes TaggedHash_merkle_root(const struct LDKTaggedHash *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
 
 /**
- * Frees any resources used by the SignError
+ * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
  */
-void SignError_free(struct LDKSignError this_ptr);
+struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
 
 /**
- * Creates a copy of the SignError
+ * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
  */
-struct LDKSignError SignError_clone(const struct LDKSignError *NONNULL_PTR orig);
+void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
 
 /**
- * Utility method to constructs a new Signing-variant SignError
+ * The outpoint which is spendable.
  */
-struct LDKSignError SignError_signing(void);
+struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Utility method to constructs a new Verification-variant SignError
+ * The outpoint which is spendable.
  */
-struct LDKSignError SignError_verification(enum LDKSecp256k1Error a);
+void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
 
 /**
- * Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
+ * The output which is referenced by the given outpoint.
  */
-void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj);
+struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the Bolt12ParseError
+ * The output which is referenced by the given outpoint.
  */
-struct LDKBolt12ParseError Bolt12ParseError_clone(const struct LDKBolt12ParseError *NONNULL_PTR orig);
+void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
 
 /**
- * Creates a copy of the Bolt12SemanticError
+ * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
+ * This may be useful in re-deriving keys used in the channel to spend the output.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_clone(const enum LDKBolt12SemanticError *NONNULL_PTR orig);
+const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
 
 /**
- * Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
+ * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
+ * This may be useful in re-deriving keys used in the channel to spend the output.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_already_expired(void);
+void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
+ * The value of the channel which this transactions spends.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_chain(void);
+uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
+ * The value of the channel which this transactions spends.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_chain(void);
+void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
+ * The necessary channel parameters that need to be provided to the re-derived signer through
+ * [`ChannelSigner::provide_channel_parameters`].
+ *
+ * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_missing_amount(void);
+struct LDKChannelTransactionParameters StaticPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
+ * The necessary channel parameters that need to be provided to the re-derived signer through
+ * [`ChannelSigner::provide_channel_parameters`].
+ *
+ * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_invalid_amount(void);
+void StaticPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
 
 /**
- * Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
+ * Constructs a new StaticPaymentOutputDescriptor given each field
+ *
+ * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_insufficient_amount(void);
+MUST_USE_RES struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg, struct LDKChannelTransactionParameters channel_transaction_parameters_arg);
 
 /**
- * Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
+ * Creates a copy of the StaticPaymentOutputDescriptor
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_amount(void);
+struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
 
 /**
- * Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
+ * Generates a non-cryptographic 64-bit hash of the StaticPaymentOutputDescriptor.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_currency(void);
+uint64_t StaticPaymentOutputDescriptor_hash(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR o);
 
 /**
- * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
+ * Checks if two StaticPaymentOutputDescriptors 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.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_unknown_required_features(void);
+bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
 
 /**
- * Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
+ * Returns the `witness_script` of the spendable output.
+ *
+ * Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that
+ * originated from an anchor outputs channel, as they take the form of a P2WSH script.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_features(void);
+MUST_USE_RES struct LDKCOption_CVec_u8ZZ StaticPaymentOutputDescriptor_witness_script(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
+ * The maximum length a well-formed witness spending one of these should have.
+ * Note: If you have the grind_signatures feature enabled, this will be at least 1 byte
+ * shorter.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void);
+MUST_USE_RES uint64_t StaticPaymentOutputDescriptor_max_witness_length(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
+ * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void);
+struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
 
 /**
- * Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
+ * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void);
+struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
 
 /**
- * Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
+ * Frees any resources used by the SpendableOutputDescriptor
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void);
+void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
 
 /**
- * Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
+ * Creates a copy of the SpendableOutputDescriptor
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void);
+struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
 
 /**
- * Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
+ * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void);
+struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output, struct LDKThirtyTwoBytes channel_keys_id);
 
 /**
- * Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
+ * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_quantity(void);
+struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
 
 /**
- * Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
+ * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_invalid_metadata(void);
+struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
 
 /**
- * Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
+ * Generates a non-cryptographic 64-bit hash of the SpendableOutputDescriptor.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_metadata(void);
+uint64_t SpendableOutputDescriptor_hash(const struct LDKSpendableOutputDescriptor *NONNULL_PTR o);
 
 /**
- * Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
+ * Checks if two SpendableOutputDescriptors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void);
+bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
 
 /**
- * Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
+ * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void);
+struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
 
 /**
- * Utility method to constructs a new DuplicatePaymentId-variant Bolt12SemanticError
+ * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_duplicate_payment_id(void);
+struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
 
 /**
- * Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
+ * Creates an unsigned [`Psbt`] which spends the given descriptors to
+ * the given outputs, plus an output to the given change destination (if sufficient
+ * change value remains). The PSBT will have a feerate, at least, of the given value.
+ *
+ * The `locktime` argument is used to set the transaction's locktime. If `None`, the
+ * transaction will have a locktime of 0. It it recommended to set this to the current block
+ * height to avoid fee sniping, unless you have some specific reason to use a different
+ * locktime.
+ *
+ * Returns the PSBT and expected max transaction weight.
+ *
+ * Returns `Err(())` if the output value is greater than the input value minus required fee,
+ * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
+ * does not match the one we can spend.
+ *
+ * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void);
+MUST_USE_RES struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ SpendableOutputDescriptor_create_spendable_outputs_psbt(struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
 
 /**
- * Utility method to constructs a new UnexpectedPaths-variant Bolt12SemanticError
+ * Frees any resources used by the ChannelDerivationParameters, if is_owned is set and inner is non-NULL.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_paths(void);
+void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
 
 /**
- * Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
+ * The value in satoshis of the channel we're attempting to spend the anchor output of.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void);
+uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
 
 /**
- * Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
+ * The value in satoshis of the channel we're attempting to spend the anchor output of.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void);
+void ChannelDerivationParameters_set_value_satoshis(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
+ * The unique identifier to re-derive the signer for the associated channel.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void);
+const uint8_t (*ChannelDerivationParameters_get_keys_id(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr))[32];
 
 /**
- * Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
+ * The unique identifier to re-derive the signer for the associated channel.
  */
-enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void);
+void ChannelDerivationParameters_set_keys_id(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Frees any resources used by the RefundMaybeWithDerivedMetadataBuilder, if is_owned is set and inner is non-NULL.
+ * The necessary channel parameters that need to be provided to the re-derived signer through
+ * [`ChannelSigner::provide_channel_parameters`].
  */
-void RefundMaybeWithDerivedMetadataBuilder_free(struct LDKRefundMaybeWithDerivedMetadataBuilder this_obj);
+struct LDKChannelTransactionParameters ChannelDerivationParameters_get_transaction_parameters(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the RefundMaybeWithDerivedMetadataBuilder
+ * The necessary channel parameters that need to be provided to the re-derived signer through
+ * [`ChannelSigner::provide_channel_parameters`].
  */
-struct LDKRefundMaybeWithDerivedMetadataBuilder RefundMaybeWithDerivedMetadataBuilder_clone(const struct LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR orig);
+void ChannelDerivationParameters_set_transaction_parameters(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
 
 /**
- * Creates a new builder for a refund using the [`Refund::payer_id`] for the public node id to
- * send to if no [`Refund::paths`] are set. Otherwise, it may be a transient pubkey.
- *
- * Additionally, sets the required (empty) [`Refund::description`], [`Refund::payer_metadata`],
- * and [`Refund::amount_msats`].
- *
- * # Note
- *
- * If constructing a [`Refund`] for use with a [`ChannelManager`], use
- * [`ChannelManager::create_refund_builder`] instead of [`RefundBuilder::new`].
- *
- * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
- * [`ChannelManager::create_refund_builder`]: crate::ln::channelmanager::ChannelManager::create_refund_builder
+ * Constructs a new ChannelDerivationParameters given each field
  */
-MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_new(struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id, uint64_t amount_msats);
+MUST_USE_RES struct LDKChannelDerivationParameters ChannelDerivationParameters_new(uint64_t value_satoshis_arg, struct LDKThirtyTwoBytes keys_id_arg, struct LDKChannelTransactionParameters transaction_parameters_arg);
 
 /**
- * Similar to [`RefundBuilder::new`] except, if [`RefundBuilder::path`] is called, the payer id
- * is derived from the given [`ExpandedKey`] and nonce. This provides sender privacy by using a
- * different payer id for each refund, assuming a different nonce is used.  Otherwise, the
- * provided `node_id` is used for the payer id.
- *
- * Also, sets the metadata when [`RefundBuilder::build`] is called such that it can be used to
- * verify that an [`InvoiceRequest`] was produced for the refund given an [`ExpandedKey`].
- *
- * The `payment_id` is encrypted in the metadata and should be unique. This ensures that only
- * one invoice will be paid for the refund and that payments can be uniquely identified.
- *
- * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
- * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
+ * Creates a copy of the ChannelDerivationParameters
  */
-MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id);
+struct LDKChannelDerivationParameters ChannelDerivationParameters_clone(const struct LDKChannelDerivationParameters *NONNULL_PTR orig);
 
 /**
- * Sets the [`Refund::description`].
- *
- * Successive calls to this method will override the previous setting.
+ * Checks if two ChannelDerivationParameterss 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.
  */
-MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_description(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr description);
+bool ChannelDerivationParameters_eq(const struct LDKChannelDerivationParameters *NONNULL_PTR a, const struct LDKChannelDerivationParameters *NONNULL_PTR b);
 
 /**
- * Sets the [`Refund::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
- * already passed is valid and can be checked for using [`Refund::is_expired`].
- *
- * Successive calls to this method will override the previous setting.
+ * Serialize the ChannelDerivationParameters object into a byte array which can be read by ChannelDerivationParameters_read
  */
-MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t absolute_expiry);
+struct LDKCVec_u8Z ChannelDerivationParameters_write(const struct LDKChannelDerivationParameters *NONNULL_PTR obj);
 
 /**
- * Sets the [`Refund::issuer`].
- *
- * Successive calls to this method will override the previous setting.
+ * Read a ChannelDerivationParameters from a byte array, created by ChannelDerivationParameters_write
  */
-MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_issuer(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr issuer);
+struct LDKCResult_ChannelDerivationParametersDecodeErrorZ ChannelDerivationParameters_read(struct LDKu8slice ser);
 
 /**
- * Adds a blinded path to [`Refund::paths`]. Must include at least one path if only connected
- * by private channels or if [`Refund::payer_id`] is not a public node id.
- *
- * Successive calls to this method will add another blinded path. Caller is responsible for not
- * adding duplicate paths.
+ * Frees any resources used by the HTLCDescriptor, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_path(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKBlindedPath path);
+void HTLCDescriptor_free(struct LDKHTLCDescriptor this_obj);
 
 /**
- * Sets the [`Refund::chain`] of the given [`Network`] for paying an invoice. If not
- * called, [`Network::Bitcoin`] is assumed.
- *
- * Successive calls to this method will override the previous setting.
+ * The parameters required to derive the signer for the HTLC input.
  */
-MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_chain(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, enum LDKNetwork network);
+struct LDKChannelDerivationParameters HTLCDescriptor_get_channel_derivation_parameters(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Sets [`Refund::quantity`] of items. This is purely for informational purposes. It is useful
- * when the refund pertains to a [`Bolt12Invoice`] that paid for more than one item from an
- * [`Offer`] as specified by [`InvoiceRequest::quantity`].
- *
- * Successive calls to this method will override the previous setting.
- *
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
- * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
- * [`Offer`]: crate::offers::offer::Offer
+ * The parameters required to derive the signer for the HTLC input.
  */
-MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_quantity(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t quantity);
+void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
 
 /**
- * Sets the [`Refund::payer_note`].
- *
- * Successive calls to this method will override the previous setting.
+ * The txid of the commitment transaction in which the HTLC output lives.
  */
-MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_payer_note(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr payer_note);
+const uint8_t (*HTLCDescriptor_get_commitment_txid(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr))[32];
 
 /**
- * Builds a [`Refund`] after checking for valid semantics.
+ * The txid of the commitment transaction in which the HTLC output lives.
  */
-MUST_USE_RES struct LDKCResult_RefundBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_build(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg);
+void HTLCDescriptor_set_commitment_txid(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Frees any resources used by the Refund, if is_owned is set and inner is non-NULL.
+ * The number of the commitment transaction in which the HTLC output lives.
  */
-void Refund_free(struct LDKRefund this_obj);
+uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the Refund
+ * The number of the commitment transaction in which the HTLC output lives.
  */
-struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig);
+void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * A complete description of the purpose of the refund. Intended to be displayed to the user
- * but with the caveat that it has not been verified in any way.
+ * The key tweak corresponding to the number of the commitment transaction in which the HTLC
+ * output lives. This tweak is applied to all the basepoints for both parties in the channel to
+ * arrive at unique keys per commitment.
+ *
+ * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
  */
-MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg);
+struct LDKPublicKey HTLCDescriptor_get_per_commitment_point(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Duration since the Unix epoch when an invoice should no longer be sent.
+ * The key tweak corresponding to the number of the commitment transaction in which the HTLC
+ * output lives. This tweak is applied to all the basepoints for both parties in the channel to
+ * arrive at unique keys per commitment.
  *
- * If `None`, the refund does not expire.
+ * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
  */
-MUST_USE_RES struct LDKCOption_u64Z Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg);
+void HTLCDescriptor_set_per_commitment_point(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Whether the refund has expired.
+ * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
+ * originating from a channel supporting anchor outputs, otherwise it is the channel's
+ * negotiated feerate at the time the commitment transaction was built.
  */
-MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg);
+uint32_t HTLCDescriptor_get_feerate_per_kw(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Whether the refund has expired given the duration since the Unix epoch.
+ * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
+ * originating from a channel supporting anchor outputs, otherwise it is the channel's
+ * negotiated feerate at the time the commitment transaction was built.
  */
-MUST_USE_RES bool Refund_is_expired_no_std(const struct LDKRefund *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
+void HTLCDescriptor_set_feerate_per_kw(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
- * displayed to the user but with the caveat that it has not been verified in any way.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The details of the HTLC as it appears in the commitment transaction.
  */
-MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg);
+struct LDKHTLCOutputInCommitment HTLCDescriptor_get_htlc(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender
- * privacy by obfuscating its node id.
+ * The details of the HTLC as it appears in the commitment transaction.
  */
-MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg);
+void HTLCDescriptor_set_htlc(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKHTLCOutputInCommitment val);
 
 /**
- * An unpredictable series of bytes, typically containing information about the derivation of
- * [`payer_id`].
- *
- * [`payer_id`]: Self::payer_id
+ * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
+ * taken.
  */
-MUST_USE_RES struct LDKu8slice Refund_payer_metadata(const struct LDKRefund *NONNULL_PTR this_arg);
+struct LDKCOption_ThirtyTwoBytesZ HTLCDescriptor_get_preimage(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * A chain that the refund is valid for.
+ * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
+ * taken.
  */
-MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg);
+void HTLCDescriptor_set_preimage(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
 
 /**
- * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]).
- *
- * [`chain`]: Self::chain
+ * The counterparty's signature required to spend the HTLC output.
  */
-MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg);
+struct LDKECDSASignature HTLCDescriptor_get_counterparty_sig(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Features pertaining to requesting an invoice.
+ * The counterparty's signature required to spend the HTLC output.
  */
-MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg);
+void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
 
 /**
- * The quantity of an item that refund is for.
+ * Constructs a new HTLCDescriptor given each field
  */
-MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKHTLCDescriptor HTLCDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKThirtyTwoBytes commitment_txid_arg, uint64_t per_commitment_number_arg, struct LDKPublicKey per_commitment_point_arg, uint32_t feerate_per_kw_arg, struct LDKHTLCOutputInCommitment htlc_arg, struct LDKCOption_ThirtyTwoBytesZ preimage_arg, struct LDKECDSASignature counterparty_sig_arg);
 
 /**
- * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly
- * transient pubkey.
- *
- * [`paths`]: Self::paths
+ * Creates a copy of the HTLCDescriptor
  */
-MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg);
+struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig);
 
 /**
- * Payer provided note to include in the invoice.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Checks if two HTLCDescriptors 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.
  */
-MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg);
+bool HTLCDescriptor_eq(const struct LDKHTLCDescriptor *NONNULL_PTR a, const struct LDKHTLCDescriptor *NONNULL_PTR b);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Refund.
+ * Serialize the HTLCDescriptor object into a byte array which can be read by HTLCDescriptor_read
  */
-uint64_t Refund_hash(const struct LDKRefund *NONNULL_PTR o);
+struct LDKCVec_u8Z HTLCDescriptor_write(const struct LDKHTLCDescriptor *NONNULL_PTR obj);
 
 /**
- * Serialize the Refund object into a byte array which can be read by Refund_read
+ * Read a HTLCDescriptor from a byte array, created by HTLCDescriptor_write
  */
-struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj);
+struct LDKCResult_HTLCDescriptorDecodeErrorZ HTLCDescriptor_read(struct LDKu8slice ser);
 
 /**
- * Read a Refund object from a string
+ * Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
+ * being spent by the HTLC input in the HTLC transaction.
  */
-struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s);
+MUST_USE_RES struct LDKOutPoint HTLCDescriptor_outpoint(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the UtxoLookupError
+ * Returns the UTXO to be spent by the HTLC input, which can be obtained via
+ * [`Self::unsigned_tx_input`].
  */
-enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
+MUST_USE_RES struct LDKTxOut HTLCDescriptor_previous_utxo(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new UnknownChain-variant UtxoLookupError
+ * Returns the unsigned transaction input spending the HTLC output in the commitment
+ * transaction.
  */
-enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
+MUST_USE_RES struct LDKTxIn HTLCDescriptor_unsigned_tx_input(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new UnknownTx-variant UtxoLookupError
+ * Returns the delayed output created as a result of spending the HTLC output in the commitment
+ * transaction.
  */
-enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
+MUST_USE_RES struct LDKTxOut HTLCDescriptor_tx_output(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the UtxoResult
+ * Returns the witness script of the HTLC output in the commitment transaction.
  */
-void UtxoResult_free(struct LDKUtxoResult this_ptr);
+MUST_USE_RES struct LDKCVec_u8Z HTLCDescriptor_witness_script(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the UtxoResult
+ * Returns the fully signed witness required to spend the HTLC output in the commitment
+ * transaction.
  */
-struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
+MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature, struct LDKu8slice witness_script);
 
 /**
- * Utility method to constructs a new Sync-variant UtxoResult
+ * Derives the channel signer required to sign the HTLC input.
  */
-struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
+MUST_USE_RES struct LDKEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
 
 /**
- * Utility method to constructs a new Async-variant UtxoResult
+ * Calls the free function if one is set
  */
-struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
+void ChannelSigner_free(struct LDKChannelSigner this_ptr);
 
 /**
- * Calls the free function if one is set
+ * Creates a copy of the Recipient
  */
-void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
+enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
+ * Utility method to constructs a new Node-variant Recipient
  */
-void UtxoFuture_free(struct LDKUtxoFuture this_obj);
+enum LDKRecipient Recipient_node(void);
 
 /**
- * Creates a copy of the UtxoFuture
+ * Utility method to constructs a new PhantomNode-variant Recipient
  */
-struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
+enum LDKRecipient Recipient_phantom_node(void);
 
 /**
- * Builds a new future for later resolution.
+ * Calls the free function if one is set
  */
-MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
+void EntropySource_free(struct LDKEntropySource this_ptr);
 
 /**
- * Resolves this future against the given `graph` and with the given `result`.
- *
- * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
- * forwarding the validated gossip message onwards to peers.
- *
- * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
- * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
- * after this.
- *
- * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
- * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
+ * Calls the free function if one is set
  */
-void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
+void NodeSigner_free(struct LDKNodeSigner this_ptr);
 
 /**
- * Resolves this future against the given `graph` and with the given `result`.
- *
- * The given `gossip` is used to broadcast any validated messages onwards to all peers which
- * have available buffer space.
- *
- * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
- * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
- * after this.
- *
- * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
- * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
+ * Calls the free function if one is set
  */
-void UtxoFuture_resolve(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, const struct LDKP2PGossipSync *NONNULL_PTR gossip, struct LDKCResult_TxOutUtxoLookupErrorZ result);
+void OutputSpender_free(struct LDKOutputSpender this_ptr);
 
 /**
- * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
+ * Calls the free function if one is set
  */
-void NodeId_free(struct LDKNodeId this_obj);
+void SignerProvider_free(struct LDKSignerProvider this_ptr);
 
 /**
- * Creates a copy of the NodeId
+ * Calls the free function if one is set
  */
-struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
+void ChangeDestinationSource_free(struct LDKChangeDestinationSource this_ptr);
 
 /**
- * Create a new NodeId from a public key
+ * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
+void InMemorySigner_free(struct LDKInMemorySigner this_obj);
 
 /**
- * Create a new NodeId from a slice of bytes
+ * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
+ * holder's anchor output in a commitment transaction, if one is present.
  */
-MUST_USE_RES struct LDKCResult_NodeIdDecodeErrorZ NodeId_from_slice(struct LDKu8slice bytes);
+const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
 
 /**
- * Get the public key slice from this NodeId
+ * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
+ * holder's anchor output in a commitment transaction, if one is present.
  */
-MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
+void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
 
 /**
- * Get the public key as an array from this NodeId
+ * Holder secret key for blinded revocation pubkey.
  */
-MUST_USE_RES const uint8_t (*NodeId_as_array(const struct LDKNodeId *NONNULL_PTR this_arg))[33];
+const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
 
 /**
- * Get the public key from this NodeId
+ * Holder secret key for blinded revocation pubkey.
  */
-MUST_USE_RES struct LDKCResult_PublicKeySecp256k1ErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg);
+void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the NodeId.
+ * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
  */
-uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
+const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
 
 /**
- * Serialize the NodeId object into a byte array which can be read by NodeId_read
+ * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
  */
-struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
+void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
 
 /**
- * Read a NodeId from a byte array, created by NodeId_write
+ * Holder secret key used in an HTLC transaction.
  */
-struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
+const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
 
 /**
- * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
+ * Holder secret key used in an HTLC transaction.
  */
-void NetworkGraph_free(struct LDKNetworkGraph this_obj);
+void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
 
 /**
- * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
+ * Holder HTLC secret key used in commitment transaction HTLC outputs.
  */
-void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
+const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
 
 /**
- * Frees any resources used by the NetworkUpdate
+ * Holder HTLC secret key used in commitment transaction HTLC outputs.
  */
-void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
+void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
 
 /**
- * Creates a copy of the NetworkUpdate
+ * Commitment seed.
  */
-struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
+const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
 
 /**
- * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
+ * Commitment seed.
  */
-struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
+void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
+ * Creates a copy of the InMemorySigner
  */
-struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
+struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
 
 /**
- * Utility method to constructs a new NodeFailure-variant NetworkUpdate
+ * Creates a new [`InMemorySigner`].
  */
-struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
+MUST_USE_RES struct LDKInMemorySigner InMemorySigner_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id, struct LDKThirtyTwoBytes rand_bytes_unique_start);
 
 /**
- * Checks if two NetworkUpdates contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Returns the counterparty's pubkeys.
+ *
+ * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
+ * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
+MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
 
 /**
- * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
+ * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
+ * transactions, i.e., the amount of time that we have to wait to recover our funds if we
+ * broadcast a transaction.
+ *
+ * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
+ * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
  */
-struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
+MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
 
 /**
- * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
+ * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
+ * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
+ * if they broadcast a transaction.
+ *
+ * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
+ * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
  */
-struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
+ * Returns whether the holder is the initiator.
+ *
+ * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
+ * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
  */
-void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
+MUST_USE_RES struct LDKCOption_boolZ InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+
+/**
+ * Funding outpoint
+ *
+ * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
+ * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
 
 /**
- * Creates a new tracker of the actual state of the network of channels and nodes,
- * assuming an existing [`NetworkGraph`].
- * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
- * correct, and the announcement is signed with channel owners' keys.
+ * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
+ * building transactions.
+ *
+ * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
+ * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
+MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
 
 /**
- * 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.
+ * Returns the channel type features of the channel parameters. Should be helpful for
+ * determining a channel's category, i. e. legacy/anchors/taproot/etc.
+ *
+ * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
+ * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void P2PGossipSync_add_utxo_lookup(const struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
+MUST_USE_RES struct LDKChannelTypeFeatures InMemorySigner_channel_type_features(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
 
 /**
- * Handles any network updates originating from [`Event`]s.
- * Note that this will skip applying any [`NetworkUpdate::ChannelUpdateMessage`] to avoid
- * leaking possibly identifying information of the sender to the public network.
+ * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
+ * by `descriptor`, returning the witness stack for the input.
  *
- * [`Event`]: crate::events::Event
+ * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
+ * is not spending the outpoint described by [`descriptor.outpoint`],
+ * or if an output descriptor `script_pubkey` does not match the one we can spend.
+ *
+ * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
  */
-void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
+MUST_USE_RES struct LDKCResult_WitnessNoneZ InMemorySigner_sign_counterparty_payment_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor);
 
 /**
- * Gets the chain hash for this network graph.
+ * Sign the single input of `spend_tx` at index `input_idx` which spends the output
+ * described by `descriptor`, returning the witness stack for the input.
+ *
+ * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
+ * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
+ * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
+ * `script_pubkey` does not match the one we can spend.
+ *
+ * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
+ * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
  */
-MUST_USE_RES struct LDKThirtyTwoBytes NetworkGraph_get_chain_hash(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_WitnessNoneZ InMemorySigner_sign_dynamic_p2wsh_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor);
 
 /**
- * Verifies the signature of a [`NodeAnnouncement`].
- *
- * Returns an error if it is invalid.
+ * Constructs a new EntropySource which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
  */
-struct LDKCResult_NoneLightningErrorZ verify_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg);
+struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
 
 /**
- * Verifies all signatures included in a [`ChannelAnnouncement`].
- *
- * Returns an error if one of the signatures is invalid.
+ * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
  */
-struct LDKCResult_NoneLightningErrorZ verify_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg);
+struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
+ * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
  */
-struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
+struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
+ * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
  */
-struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
 
 /**
- * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
+ * Read a InMemorySigner from a byte array, created by InMemorySigner_write
  */
-void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
+struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg);
 
 /**
- * When the last update to the channel direction was issued.
- * Value is opaque, as set in the announcement.
+ * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
  */
-uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
+void KeysManager_free(struct LDKKeysManager this_obj);
 
 /**
- * When the last update to the channel direction was issued.
- * Value is opaque, as set in the announcement.
+ * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
+ * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
+ * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
+ * without a doubt, be unique to this instance. ie if you start multiple times with the same
+ * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
+ * is to simply use the current time (with very high precision).
+ *
+ * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
+ * obviously, `starting_time` should be unique every time you reload the library - it is only
+ * used to generate new ephemeral key data (which will be stored by the individual channel if
+ * necessary).
+ *
+ * Note that the seed is required to recover certain on-chain funds independent of
+ * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
+ * for any channel, and some on-chain during-closing funds.
+ *
+ * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
  */
-void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
+MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
 
 /**
- * Whether the channel can be currently used for payments (in this one direction).
+ * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
  */
-bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
 
 /**
- * Whether the channel can be currently used for payments (in this one direction).
+ * Derive an old [`EcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
  */
-void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
+MUST_USE_RES struct LDKInMemorySigner KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]);
 
 /**
- * The difference in CLTV values that you must have when routing through this channel.
+ * Signs the given [`Psbt`] which spends the given [`SpendableOutputDescriptor`]s.
+ * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there
+ * are no other inputs that need signing.
+ *
+ * Returns `Err(())` if the PSBT is missing a descriptor or if we fail to sign.
+ *
+ * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
+ * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
  */
-uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_CVec_u8ZNoneZ KeysManager_sign_spendable_outputs_psbt(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_u8Z psbt);
 
 /**
- * The difference in CLTV values that you must have when routing through this channel.
+ * Constructs a new EntropySource which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
  */
-void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
+struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
 
 /**
- * The minimum value, which must be relayed to the next hop via the channel
+ * Constructs a new NodeSigner which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
  */
-uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
+struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
 
 /**
- * The minimum value, which must be relayed to the next hop via the channel
+ * Constructs a new OutputSpender which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is
  */
-void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKOutputSpender KeysManager_as_OutputSpender(const struct LDKKeysManager *NONNULL_PTR this_arg);
 
 /**
- * The maximum value which may be relayed to the next hop via the channel.
+ * Constructs a new SignerProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
  */
-uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
+struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
 
 /**
- * The maximum value which may be relayed to the next hop via the channel.
+ * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
  */
-void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
+void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
 
 /**
- * Fees charged when the channel is used for routing
+ * Constructs a new EntropySource which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
  */
-struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
+struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
 
 /**
- * Fees charged when the channel is used for routing
+ * Constructs a new NodeSigner which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
  */
-void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
+struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
 
 /**
- * Most recent update for the channel received from the network
- * 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
+ * Constructs a new OutputSpender which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is
  */
-struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
+struct LDKOutputSpender PhantomKeysManager_as_OutputSpender(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
 
 /**
- * Most recent update for the channel received from the network
- * 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
+ * Constructs a new SignerProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
  */
-void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
+struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new ChannelUpdateInfo given each field
+ * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
+ * that is shared across all nodes that intend to participate in [phantom node payments]
+ * together.
  *
- * Note that last_update_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
+ * `starting_time_nanos`.
+ *
+ * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
+ * same across restarts, or else inbound payments may fail.
+ *
+ * [phantom node payments]: PhantomKeysManager
  */
-MUST_USE_RES struct LDKChannelUpdateInfo ChannelUpdateInfo_new(uint32_t last_update_arg, bool enabled_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, struct LDKChannelUpdate last_update_message_arg);
+MUST_USE_RES struct LDKPhantomKeysManager PhantomKeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos, const uint8_t (*cross_node_seed)[32]);
 
 /**
- * Creates a copy of the ChannelUpdateInfo
+ * See [`KeysManager::derive_channel_keys`] for documentation on this method.
  */
-struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
+MUST_USE_RES struct LDKInMemorySigner PhantomKeysManager_derive_channel_keys(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]);
 
 /**
- * Checks if two ChannelUpdateInfos 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.
+ * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
  */
-bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
+MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
 
 /**
- * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
+ * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
+ * last-hop onion data, etc.
  */
-struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
+MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
 
 /**
- * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
+ * Frees any resources used by the RandomBytes, if is_owned is set and inner is non-NULL.
  */
-struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
+void RandomBytes_free(struct LDKRandomBytes this_obj);
 
 /**
- * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
+ * Creates a new instance using the given seed.
  */
-void ChannelInfo_free(struct LDKChannelInfo this_obj);
+MUST_USE_RES struct LDKRandomBytes RandomBytes_new(struct LDKThirtyTwoBytes seed);
 
 /**
- * Protocol features of a channel communicated during its announcement
+ * Constructs a new EntropySource which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
  */
-struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
+struct LDKEntropySource RandomBytes_as_EntropySource(const struct LDKRandomBytes *NONNULL_PTR this_arg);
 
 /**
- * Protocol features of a channel communicated during its announcement
+ * Creates a copy of a EcdsaChannelSigner
  */
-void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
+struct LDKEcdsaChannelSigner EcdsaChannelSigner_clone(const struct LDKEcdsaChannelSigner *NONNULL_PTR orig);
 
 /**
- * Source node of the first direction of a channel
+ * Calls the free function if one is set
  */
-struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
+void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
 
 /**
- * Source node of the first direction of a channel
+ * Calls the free function if one is set
  */
-void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
+void AsyncPaymentsMessageHandler_free(struct LDKAsyncPaymentsMessageHandler this_ptr);
 
 /**
- * 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
+ * Frees any resources used by the AsyncPaymentsMessage
  */
-struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
+void AsyncPaymentsMessage_free(struct LDKAsyncPaymentsMessage 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
+ * Creates a copy of the AsyncPaymentsMessage
  */
-void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
+struct LDKAsyncPaymentsMessage AsyncPaymentsMessage_clone(const struct LDKAsyncPaymentsMessage *NONNULL_PTR orig);
 
 /**
- * Source node of the second direction of a channel
+ * Utility method to constructs a new HeldHtlcAvailable-variant AsyncPaymentsMessage
  */
-struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
+struct LDKAsyncPaymentsMessage AsyncPaymentsMessage_held_htlc_available(struct LDKHeldHtlcAvailable a);
 
 /**
- * Source node of the second direction of a channel
+ * Utility method to constructs a new ReleaseHeldHtlc-variant AsyncPaymentsMessage
  */
-void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
+struct LDKAsyncPaymentsMessage AsyncPaymentsMessage_release_held_htlc(struct LDKReleaseHeldHtlc a);
 
 /**
- * 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
+ * Frees any resources used by the HeldHtlcAvailable, if is_owned is set and inner is non-NULL.
  */
-struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
+void HeldHtlcAvailable_free(struct LDKHeldHtlcAvailable this_obj);
 
 /**
- * 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
+ * The secret that will be used by the recipient of this message to release the held HTLC.
  */
-void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
+const uint8_t (*HeldHtlcAvailable_get_payment_release_secret(const struct LDKHeldHtlcAvailable *NONNULL_PTR this_ptr))[32];
 
 /**
- * The channel capacity as seen on-chain, if chain lookup is available.
+ * The secret that will be used by the recipient of this message to release the held HTLC.
  */
-struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
+void HeldHtlcAvailable_set_payment_release_secret(struct LDKHeldHtlcAvailable *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * The channel capacity as seen on-chain, if chain lookup is available.
+ * Constructs a new HeldHtlcAvailable given each field
  */
-void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+MUST_USE_RES struct LDKHeldHtlcAvailable HeldHtlcAvailable_new(struct LDKThirtyTwoBytes payment_release_secret_arg);
 
 /**
- * An initial announcement of the channel
- * 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
+ * Creates a copy of the HeldHtlcAvailable
  */
-struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
+struct LDKHeldHtlcAvailable HeldHtlcAvailable_clone(const struct LDKHeldHtlcAvailable *NONNULL_PTR orig);
 
 /**
- * An initial announcement of the channel
- * 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
+ * Frees any resources used by the ReleaseHeldHtlc, if is_owned is set and inner is non-NULL.
  */
-void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
+void ReleaseHeldHtlc_free(struct LDKReleaseHeldHtlc this_obj);
 
 /**
- * Creates a copy of the ChannelInfo
+ * Used to release the HTLC held upstream if it matches the corresponding
+ * [`HeldHtlcAvailable::payment_release_secret`].
  */
-struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
+const uint8_t (*ReleaseHeldHtlc_get_payment_release_secret(const struct LDKReleaseHeldHtlc *NONNULL_PTR this_ptr))[32];
 
 /**
- * Checks if two ChannelInfos 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.
+ * Used to release the HTLC held upstream if it matches the corresponding
+ * [`HeldHtlcAvailable::payment_release_secret`].
  */
-bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
+void ReleaseHeldHtlc_set_payment_release_secret(struct LDKReleaseHeldHtlc *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Constructs a new ReleaseHeldHtlc given each field
  */
-MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
+MUST_USE_RES struct LDKReleaseHeldHtlc ReleaseHeldHtlc_new(struct LDKThirtyTwoBytes payment_release_secret_arg);
 
 /**
- * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
+ * Creates a copy of the ReleaseHeldHtlc
  */
-struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
+struct LDKReleaseHeldHtlc ReleaseHeldHtlc_clone(const struct LDKReleaseHeldHtlc *NONNULL_PTR orig);
 
 /**
- * Read a ChannelInfo from a byte array, created by ChannelInfo_write
+ * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
  */
-struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
+struct LDKOnionMessageContents ReleaseHeldHtlc_as_OnionMessageContents(const struct LDKReleaseHeldHtlc *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
+ * Serialize the HeldHtlcAvailable object into a byte array which can be read by HeldHtlcAvailable_read
  */
-void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
+struct LDKCVec_u8Z HeldHtlcAvailable_write(const struct LDKHeldHtlcAvailable *NONNULL_PTR obj);
 
 /**
- * Creates a copy of the DirectedChannelInfo
+ * Read a HeldHtlcAvailable from a byte array, created by HeldHtlcAvailable_write
  */
-struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
+struct LDKCResult_HeldHtlcAvailableDecodeErrorZ HeldHtlcAvailable_read(struct LDKu8slice ser);
 
 /**
- * Returns information for the channel.
+ * Serialize the ReleaseHeldHtlc object into a byte array which can be read by ReleaseHeldHtlc_read
  */
-MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z ReleaseHeldHtlc_write(const struct LDKReleaseHeldHtlc *NONNULL_PTR obj);
 
 /**
- * Returns the [`EffectiveCapacity`] of the channel in the direction.
- *
- * This is either the total capacity from the funding transaction, if known, or the
- * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
- * otherwise.
+ * Read a ReleaseHeldHtlc from a byte array, created by ReleaseHeldHtlc_write
  */
-MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
+struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ ReleaseHeldHtlc_read(struct LDKu8slice ser);
 
 /**
- * Returns the `node_id` of the source hop.
- *
- * Refers to the `node_id` forwarding the payment to the next hop.
+ * Returns whether `tlv_type` corresponds to a TLV record for async payment messages.
  */
-MUST_USE_RES struct LDKNodeId DirectedChannelInfo_source(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
+MUST_USE_RES bool AsyncPaymentsMessage_is_known_type(uint64_t tlv_type);
 
 /**
- * Returns the `node_id` of the target hop.
- *
- * Refers to the `node_id` receiving the payment from the previous hop.
+ * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
  */
-MUST_USE_RES struct LDKNodeId DirectedChannelInfo_target(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
+struct LDKOnionMessageContents AsyncPaymentsMessage_as_OnionMessageContents(const struct LDKAsyncPaymentsMessage *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the EffectiveCapacity
+ * Serialize the AsyncPaymentsMessage object into a byte array which can be read by AsyncPaymentsMessage_read
  */
-void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
+struct LDKCVec_u8Z AsyncPaymentsMessage_write(const struct LDKAsyncPaymentsMessage *NONNULL_PTR obj);
 
 /**
- * Creates a copy of the EffectiveCapacity
+ * Read a AsyncPaymentsMessage from a byte array, created by AsyncPaymentsMessage_write
  */
-struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
+struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ AsyncPaymentsMessage_read(struct LDKu8slice ser, uint64_t arg);
 
 /**
- * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
+ * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
  */
-struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
+void OnionMessenger_free(struct LDKOnionMessenger this_obj);
 
 /**
- * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity
+ * Frees any resources used by the Responder, if is_owned is set and inner is non-NULL.
  */
-struct LDKEffectiveCapacity EffectiveCapacity_advertised_max_htlc(uint64_t amount_msat);
+void Responder_free(struct LDKResponder this_obj);
 
 /**
- * Utility method to constructs a new Total-variant EffectiveCapacity
+ * Creates a copy of the Responder
  */
-struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
+struct LDKResponder Responder_clone(const struct LDKResponder *NONNULL_PTR orig);
 
 /**
- * Utility method to constructs a new Infinite-variant EffectiveCapacity
+ * Checks if two Responders 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 LDKEffectiveCapacity EffectiveCapacity_infinite(void);
+bool Responder_eq(const struct LDKResponder *NONNULL_PTR a, const struct LDKResponder *NONNULL_PTR b);
 
 /**
- * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity
+ * Serialize the Responder object into a byte array which can be read by Responder_read
  */
-struct LDKEffectiveCapacity EffectiveCapacity_hint_max_htlc(uint64_t amount_msat);
+struct LDKCVec_u8Z Responder_write(const struct LDKResponder *NONNULL_PTR obj);
 
 /**
- * Utility method to constructs a new Unknown-variant EffectiveCapacity
+ * Read a Responder from a byte array, created by Responder_write
  */
-struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
+struct LDKCResult_ResponderDecodeErrorZ Responder_read(struct LDKu8slice ser);
 
 /**
- * Returns the effective capacity denominated in millisatoshi.
+ * Creates a [`ResponseInstruction`] for responding without including a reply path.
+ *
+ * Use when the recipient doesn't need to send back a reply to us.
  */
-MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKResponseInstruction Responder_respond(struct LDKResponder this_arg);
 
 /**
- * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
+ * Creates a [`ResponseInstruction`] for responding including a reply path.
+ *
+ * Use when the recipient needs to send back a reply to us.
  */
-void RoutingFees_free(struct LDKRoutingFees this_obj);
+MUST_USE_RES struct LDKResponseInstruction Responder_respond_with_reply_path(struct LDKResponder this_arg, struct LDKMessageContext context);
 
 /**
- * Flat routing fee in millisatoshis.
+ * Frees any resources used by the ResponseInstruction, if is_owned is set and inner is non-NULL.
  */
-uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
+void ResponseInstruction_free(struct LDKResponseInstruction this_obj);
 
 /**
- * Flat routing fee in millisatoshis.
+ * Creates a copy of the ResponseInstruction
  */
-void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKResponseInstruction ResponseInstruction_clone(const struct LDKResponseInstruction *NONNULL_PTR orig);
 
 /**
- * Liquidity-based routing fee in millionths of a routed amount.
- * In other words, 10000 is 1%.
+ * Frees any resources used by the MessageSendInstructions
  */
-uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
+void MessageSendInstructions_free(struct LDKMessageSendInstructions this_ptr);
 
 /**
- * Liquidity-based routing fee in millionths of a routed amount.
- * In other words, 10000 is 1%.
+ * Creates a copy of the MessageSendInstructions
  */
-void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKMessageSendInstructions MessageSendInstructions_clone(const struct LDKMessageSendInstructions *NONNULL_PTR orig);
 
 /**
- * Constructs a new RoutingFees given each field
+ * Utility method to constructs a new WithSpecifiedReplyPath-variant MessageSendInstructions
  */
-MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
+struct LDKMessageSendInstructions MessageSendInstructions_with_specified_reply_path(struct LDKDestination destination, struct LDKBlindedMessagePath reply_path);
 
 /**
- * Checks if two RoutingFeess 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.
+ * Utility method to constructs a new WithReplyPath-variant MessageSendInstructions
  */
-bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
+struct LDKMessageSendInstructions MessageSendInstructions_with_reply_path(struct LDKDestination destination, struct LDKMessageContext context);
 
 /**
- * Creates a copy of the RoutingFees
+ * Utility method to constructs a new WithoutReplyPath-variant MessageSendInstructions
  */
-struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
+struct LDKMessageSendInstructions MessageSendInstructions_without_reply_path(struct LDKDestination destination);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the RoutingFees.
+ * Utility method to constructs a new ForReply-variant MessageSendInstructions
  */
-uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
+struct LDKMessageSendInstructions MessageSendInstructions_for_reply(struct LDKResponseInstruction instructions);
 
 /**
- * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
+ * Calls the free function if one is set
  */
-struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
+void MessageRouter_free(struct LDKMessageRouter this_ptr);
 
 /**
- * Read a RoutingFees from a byte array, created by RoutingFees_write
+ * Frees any resources used by the DefaultMessageRouter, if is_owned is set and inner is non-NULL.
  */
-struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
+void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj);
 
 /**
- * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
+ * Creates a [`DefaultMessageRouter`] using the given [`NetworkGraph`].
  */
-void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
+MUST_USE_RES struct LDKDefaultMessageRouter DefaultMessageRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKEntropySource entropy_source);
 
 /**
- * Protocol features the node announced support for
+ * Constructs a new MessageRouter which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
  */
-struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
+struct LDKMessageRouter DefaultMessageRouter_as_MessageRouter(const struct LDKDefaultMessageRouter *NONNULL_PTR this_arg);
 
 /**
- * Protocol features the node announced support for
+ * Frees any resources used by the OnionMessagePath, if is_owned is set and inner is non-NULL.
  */
-void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
+void OnionMessagePath_free(struct LDKOnionMessagePath this_obj);
 
 /**
- * When the last known update to the node state was issued.
- * Value is opaque, as set in the announcement.
+ * Nodes on the path between the sender and the destination.
+ *
+ * Returns a copy of the field.
  */
-uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
+struct LDKCVec_PublicKeyZ OnionMessagePath_get_intermediate_nodes(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
 
 /**
- * When the last known update to the node state was issued.
- * Value is opaque, as set in the announcement.
+ * Nodes on the path between the sender and the destination.
  */
-void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
+void OnionMessagePath_set_intermediate_nodes(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCVec_PublicKeyZ val);
 
 /**
- * Color assigned to the node
+ * The recipient of the message.
  */
-const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
+struct LDKDestination OnionMessagePath_get_destination(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
 
 /**
- * Color assigned to the node
+ * The recipient of the message.
  */
-void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
+void OnionMessagePath_set_destination(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKDestination val);
 
 /**
- * Moniker assigned to the node.
- * May be invalid or malicious (eg control chars),
- * should not be exposed to the user.
+ * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
+ *
+ * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
+ * this to initiate such a connection.
+ *
+ * Returns a copy of the field.
  */
-struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
+struct LDKCOption_CVec_SocketAddressZZ OnionMessagePath_get_first_node_addresses(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
 
 /**
- * Moniker assigned to the node.
- * May be invalid or malicious (eg control chars),
- * should not be exposed to the user.
+ * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
+ *
+ * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
+ * this to initiate such a connection.
  */
-void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
+void OnionMessagePath_set_first_node_addresses(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCOption_CVec_SocketAddressZZ val);
 
 /**
- * An initial announcement of the node
- * 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
+ * Constructs a new OnionMessagePath given each field
  */
-struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKOnionMessagePath OnionMessagePath_new(struct LDKCVec_PublicKeyZ intermediate_nodes_arg, struct LDKDestination destination_arg, struct LDKCOption_CVec_SocketAddressZZ first_node_addresses_arg);
 
 /**
- * An initial announcement of the node
- * 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
+ * Creates a copy of the OnionMessagePath
  */
-void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
+struct LDKOnionMessagePath OnionMessagePath_clone(const struct LDKOnionMessagePath *NONNULL_PTR orig);
 
 /**
- * Constructs a new NodeAnnouncementInfo given each field
+ * Returns the first node in the path.
  *
- * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKNodeAnnouncement announcement_message_arg);
+MUST_USE_RES struct LDKPublicKey OnionMessagePath_first_node(const struct LDKOnionMessagePath *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the NodeAnnouncementInfo
+ * Frees any resources used by the Destination
  */
-struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
+void Destination_free(struct LDKDestination this_ptr);
 
 /**
- * Checks if two NodeAnnouncementInfos 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 Destination
  */
-bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
+struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
 
 /**
- * Internet-level addresses via which one can connect to the node
+ * Utility method to constructs a new Node-variant Destination
  */
-MUST_USE_RES struct LDKCVec_SocketAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
+struct LDKDestination Destination_node(struct LDKPublicKey a);
 
 /**
- * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
+ * Utility method to constructs a new BlindedPath-variant Destination
  */
-struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
+struct LDKDestination Destination_blinded_path(struct LDKBlindedMessagePath a);
 
 /**
- * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
+ * Generates a non-cryptographic 64-bit hash of the Destination.
  */
-struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
+uint64_t Destination_hash(const struct LDKDestination *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
+ * Checks if two Destinations contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-void NodeAlias_free(struct LDKNodeAlias this_obj);
-
-const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
+bool Destination_eq(const struct LDKDestination *NONNULL_PTR a, const struct LDKDestination *NONNULL_PTR b);
 
-void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+/**
+ * Attempts to resolve the [`IntroductionNode::DirectedShortChannelId`] of a
+ * [`Destination::BlindedPath`] to a [`IntroductionNode::NodeId`], if applicable, using the
+ * provided [`ReadOnlyNetworkGraph`].
+ */
+void Destination_resolve(struct LDKDestination *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
 
 /**
- * Constructs a new NodeAlias given each field
+ * Frees any resources used by the SendSuccess
  */
-MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
+void SendSuccess_free(struct LDKSendSuccess this_ptr);
 
 /**
- * Creates a copy of the NodeAlias
+ * Creates a copy of the SendSuccess
  */
-struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
+struct LDKSendSuccess SendSuccess_clone(const struct LDKSendSuccess *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the NodeAlias.
+ * Utility method to constructs a new Buffered-variant SendSuccess
  */
-uint64_t NodeAlias_hash(const struct LDKNodeAlias *NONNULL_PTR o);
+struct LDKSendSuccess SendSuccess_buffered(void);
 
 /**
- * Checks if two NodeAliass 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.
+ * Utility method to constructs a new BufferedAwaitingConnection-variant SendSuccess
  */
-bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
+struct LDKSendSuccess SendSuccess_buffered_awaiting_connection(struct LDKPublicKey a);
 
 /**
- * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
+ * Generates a non-cryptographic 64-bit hash of the SendSuccess.
  */
-struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
+uint64_t SendSuccess_hash(const struct LDKSendSuccess *NONNULL_PTR o);
 
 /**
- * Read a NodeAlias from a byte array, created by NodeAlias_write
+ * Checks if two SendSuccesss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
+bool SendSuccess_eq(const struct LDKSendSuccess *NONNULL_PTR a, const struct LDKSendSuccess *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the SendError
  */
-void NodeInfo_free(struct LDKNodeInfo this_obj);
+void SendError_free(struct LDKSendError this_ptr);
 
 /**
- * All valid channels a node has announced
- *
- * Returns a copy of the field.
+ * Creates a copy of the SendError
  */
-struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
+struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
 
 /**
- * All valid channels a node has announced
+ * Utility method to constructs a new Secp256k1-variant SendError
  */
-void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
+struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
 
 /**
- * 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
+ * Utility method to constructs a new TooBigPacket-variant SendError
  */
-struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
+struct LDKSendError SendError_too_big_packet(void);
 
 /**
- * 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
+ * Utility method to constructs a new TooFewBlindedHops-variant SendError
  */
-void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
+struct LDKSendError SendError_too_few_blinded_hops(void);
 
 /**
- * Constructs a new NodeInfo given each field
- *
- * Note that announcement_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Utility method to constructs a new InvalidFirstHop-variant SendError
  */
-MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
+struct LDKSendError SendError_invalid_first_hop(struct LDKPublicKey a);
 
 /**
- * Creates a copy of the NodeInfo
+ * Utility method to constructs a new PathNotFound-variant SendError
  */
-struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
+struct LDKSendError SendError_path_not_found(void);
 
 /**
- * Checks if two NodeInfos 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.
+ * Utility method to constructs a new InvalidMessage-variant SendError
  */
-bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
+struct LDKSendError SendError_invalid_message(void);
 
 /**
- * Returns whether the node has only announced Tor addresses.
+ * Utility method to constructs a new BufferFull-variant SendError
  */
-MUST_USE_RES bool NodeInfo_is_tor_only(const struct LDKNodeInfo *NONNULL_PTR this_arg);
+struct LDKSendError SendError_buffer_full(void);
 
 /**
- * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
+ * Utility method to constructs a new GetNodeIdFailed-variant SendError
  */
-struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
+struct LDKSendError SendError_get_node_id_failed(void);
 
 /**
- * Read a NodeInfo from a byte array, created by NodeInfo_write
+ * Utility method to constructs a new UnresolvedIntroductionNode-variant SendError
  */
-struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
+struct LDKSendError SendError_unresolved_introduction_node(void);
 
 /**
- * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
+ * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
  */
-struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
+struct LDKSendError SendError_blinded_path_advance_failed(void);
 
 /**
- * Read a NetworkGraph from a byte array, created by NetworkGraph_write
+ * Generates a non-cryptographic 64-bit hash of the SendError.
  */
-struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
+uint64_t SendError_hash(const struct LDKSendError *NONNULL_PTR o);
 
 /**
- * Creates a new, empty, network graph.
+ * Checks if two SendErrors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
+bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
 
 /**
- * Returns a read-only view of the network graph.
+ * Calls the free function if one is set
  */
-MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
+void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
 
 /**
- * The unix timestamp provided by the most recent rapid gossip sync.
- * It will be set by the rapid sync process after every sync completion.
+ * Frees any resources used by the PeeledOnion
  */
-MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
+void PeeledOnion_free(struct LDKPeeledOnion this_ptr);
 
 /**
- * Update the unix timestamp provided by the most recent rapid gossip sync.
- * This should be done automatically by the rapid sync process after every sync completion.
+ * Creates a copy of the PeeledOnion
  */
-void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
+struct LDKPeeledOnion PeeledOnion_clone(const struct LDKPeeledOnion *NONNULL_PTR orig);
 
 /**
- * For an already known node (from channel announcements), update its stored properties from a
- * given node announcement.
- *
- * You probably don't want to call this directly, instead relying on a P2PGossipSync's
- * 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.
+ * Utility method to constructs a new Forward-variant PeeledOnion
  */
-MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
+struct LDKPeeledOnion PeeledOnion_forward(struct LDKNextMessageHop a, struct LDKOnionMessage b);
 
 /**
- * For an already known node (from channel announcements), update its stored properties from a
- * given node announcement without verifying the associated signatures. Because we aren't
- * given the associated signatures here we cannot relay the node announcement to any of our
- * peers.
+ * Utility method to constructs a new Receive-variant PeeledOnion
  */
-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);
+struct LDKPeeledOnion PeeledOnion_receive(struct LDKParsedOnionMessageContents a, struct LDKCOption_MessageContextZ b, struct LDKBlindedMessagePath c);
 
 /**
- * Store or update channel info from a channel announcement.
+ * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
+ * `path`, first calling [`Destination::resolve`] on `path.destination` with the given
+ * [`ReadOnlyNetworkGraph`].
  *
- * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
- * [`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.
+ * Returns the node id of the peer to send the message to, the message itself, and any addresses
+ * needed to connect to the first node.
  *
- * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
- * the corresponding UTXO exists on chain and is correctly-formatted.
+ * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_UtxoLookupZ utxo_lookup);
+struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message_resolving_destination(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedMessagePath reply_path);
 
 /**
- * Store or update channel info from a channel announcement.
+ * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
+ * `path`.
  *
- * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
- * [`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.
+ * Returns the node id of the peer to send the message to, the message itself, and any addresses
+ * needed to connect to the first node.
  *
- * This will skip verification of if the channel is actually on-chain.
+ * Returns [`SendError::UnresolvedIntroductionNode`] if:
+ * - `destination` contains a blinded path with an [`IntroductionNode::DirectedShortChannelId`],
+ * - unless it can be resolved by [`NodeIdLookUp::next_node_id`].
+ * Use [`create_onion_message_resolving_destination`] instead to resolve the introduction node
+ * first with a [`ReadOnlyNetworkGraph`].
+ *
+ * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement_no_lookup(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
+struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedMessagePath reply_path);
 
 /**
- * Store or update channel info from a channel announcement without verifying the associated
- * signatures. Because we aren't given the associated signatures here we cannot relay the
- * channel announcement to any of our peers.
+ * Decode one layer of an incoming [`OnionMessage`].
  *
- * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
- * the corresponding UTXO exists on chain and is correctly-formatted.
+ * Returns either the next layer of the onion for forwarding or the decrypted content for the
+ * receiver.
  */
-MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_UtxoLookupZ utxo_lookup);
+struct LDKCResult_PeeledOnionNoneZ peel_onion_message(const struct LDKOnionMessage *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
 
 /**
- * Update channel from partial announcement data received via rapid gossip sync
- *
- * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
- * rapid gossip sync server)
- *
- * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
+ * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
+ * their respective handlers.
  */
-MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_add_channel_from_partial_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, uint64_t timestamp, struct LDKChannelFeatures features, struct LDKPublicKey node_id_1, struct LDKPublicKey node_id_2);
+MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKNodeIdLookUp node_id_lookup, struct LDKMessageRouter message_router, struct LDKOffersMessageHandler offers_handler, struct LDKAsyncPaymentsMessageHandler async_payments_handler, struct LDKCustomOnionMessageHandler custom_handler);
 
 /**
- * Marks a channel in the graph as failed permanently.
+ * Similar to [`Self::new`], but rather than dropping onion messages that are
+ * intended to be forwarded to offline peers, we will intercept them for
+ * later forwarding.
  *
- * The channel and any node for which this was their last channel are removed from the graph.
+ * Interception flow:
+ * 1. If an onion message for an offline peer is received, `OnionMessenger` will
+ *    generate an [`Event::OnionMessageIntercepted`]. Event handlers can
+ *    then choose to persist this onion message for later forwarding, or drop
+ *    it.
+ * 2. When the offline peer later comes back online, `OnionMessenger` will
+ *    generate an [`Event::OnionMessagePeerConnected`]. Event handlers will
+ *    then fetch all previously intercepted onion messages for this peer.
+ * 3. Once the stored onion messages are fetched, they can finally be
+ *    forwarded to the now-online peer via [`Self::forward_onion_message`].
+ *
+ * # Note
+ *
+ * LDK will not rate limit how many [`Event::OnionMessageIntercepted`]s
+ * are generated, so it is the caller's responsibility to limit how many
+ * onion messages are persisted and only persist onion messages for relevant
+ * peers.
  */
-void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
+MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new_with_offline_peer_interception(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKNodeIdLookUp node_id_lookup, struct LDKMessageRouter message_router, struct LDKOffersMessageHandler offers_handler, struct LDKAsyncPaymentsMessageHandler async_payments_handler, struct LDKCustomOnionMessageHandler custom_handler);
 
 /**
- * Marks a node in the graph as permanently failed, effectively removing it and its channels
- * from local storage.
+ * Sends an [`OnionMessage`] based on its [`MessageSendInstructions`].
  */
-void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
+MUST_USE_RES struct LDKCResult_SendSuccessSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessageContents contents, struct LDKMessageSendInstructions instructions);
 
 /**
- * Removes information about channels that we haven't heard any updates about in some time.
- * This can be used regularly to prune the network graph of channels that likely no longer
- * exist.
- *
- * While there is no formal requirement that nodes regularly re-broadcast their channel
- * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
- * pruning occur for updates which are at least two weeks old, which we implement here.
- *
- * Note that for users of the `lightning-background-processor` crate this method may be
- * automatically called regularly for you.
- *
- * This method will also cause us to stop tracking removed nodes and channels if they have been
- * in the map for a while so that these can be resynced from gossip in the future.
- *
- * This method is only available with the `std` feature. See
- * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
+ * Forwards an [`OnionMessage`] to `peer_node_id`. Useful if we initialized
+ * the [`OnionMessenger`] with [`Self::new_with_offline_peer_interception`]
+ * and want to forward a previously intercepted onion message to a peer that
+ * has just come online.
  */
-void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_forward_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessage message, struct LDKPublicKey peer_node_id);
 
 /**
- * Removes information about channels that we haven't heard any updates about in some time.
- * This can be used regularly to prune the network graph of channels that likely no longer
- * exist.
- *
- * While there is no formal requirement that nodes regularly re-broadcast their channel
- * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
- * pruning occur for updates which are at least two weeks old, which we implement here.
- *
- * This method will also cause us to stop tracking removed nodes and channels if they have been
- * in the map for a while so that these can be resynced from gossip in the future.
+ * Handles the response to an [`OnionMessage`] based on its [`ResponseInstruction`],
+ * enqueueing any response for sending.
  *
- * This function takes the current unix time as an argument. For users with the `std` feature
- * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
+ * This function is useful for asynchronous handling of [`OnionMessage`]s.
+ * Handlers have the option to return `None`, indicating that no immediate response should be
+ * sent. Then, they can transfer the associated [`Responder`] to another task responsible for
+ * generating the response asynchronously. Subsequently, when the response is prepared and
+ * ready for sending, that task can invoke this method to enqueue the response for delivery.
  */
-void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
+MUST_USE_RES struct LDKCResult_SendSuccessSendErrorZ OnionMessenger_handle_onion_message_response(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessageContents response, struct LDKResponseInstruction instructions);
 
 /**
- * For an already known (from announcement) channel, update info about one of the directions
- * of the channel.
+ * Gets a [`Future`] that completes when an event is available via
+ * [`EventsProvider::process_pending_events`] or [`Self::process_pending_events_async`].
  *
- * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
- * [`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.
+ * Note that callbacks registered on the [`Future`] MUST NOT call back into this
+ * [`OnionMessenger`] and should instead register actions to be taken later.
  *
- * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
- * materially in the future will be rejected.
+ * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
  */
-MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
+MUST_USE_RES struct LDKFuture OnionMessenger_get_update_future(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
 
 /**
- * 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.
- *
- * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
- * materially in the future will be rejected.
+ * Constructs a new EventsProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
  */
-MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
+struct LDKEventsProvider OnionMessenger_as_EventsProvider(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
 
 /**
- * For an already known (from announcement) channel, verify the given [`ChannelUpdate`].
- *
- * This checks whether the update currently is applicable by [`Self::update_channel`].
- *
- * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
- * materially in the future will be rejected.
+ * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
  */
-MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_verify_channel_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
+struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
 
 /**
- * Returns information on a channel with the given id.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Calls the free function if one is set
  */
-MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
+void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr);
 
 /**
- * Returns the list of channels in the graph
+ * Frees any resources used by the OffersMessage
  */
-MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
+void OffersMessage_free(struct LDKOffersMessage this_ptr);
 
 /**
- * Returns information on a node with the given id.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Creates a copy of the OffersMessage
  */
-MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
+struct LDKOffersMessage OffersMessage_clone(const struct LDKOffersMessage *NONNULL_PTR orig);
 
 /**
- * Returns the list of nodes in the graph
+ * Utility method to constructs a new InvoiceRequest-variant OffersMessage
  */
-MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
+struct LDKOffersMessage OffersMessage_invoice_request(struct LDKInvoiceRequest a);
 
 /**
- * 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.
+ * Utility method to constructs a new Invoice-variant OffersMessage
  */
-MUST_USE_RES struct LDKCOption_CVec_SocketAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
+struct LDKOffersMessage OffersMessage_invoice(struct LDKBolt12Invoice a);
 
 /**
- * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
+ * Utility method to constructs a new InvoiceError-variant OffersMessage
  */
-void DefaultRouter_free(struct LDKDefaultRouter this_obj);
+struct LDKOffersMessage OffersMessage_invoice_error(struct LDKInvoiceError a);
 
 /**
- * Creates a new router.
+ * Returns whether `tlv_type` corresponds to a TLV record for Offers.
  */
-MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKEntropySource entropy_source, struct LDKLockableScore scorer, struct LDKProbabilisticScoringFeeParameters score_params);
+MUST_USE_RES bool OffersMessage_is_known_type(uint64_t tlv_type);
 
 /**
- * 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
+ * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
  */
-struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
+struct LDKOnionMessageContents OffersMessage_as_OnionMessageContents(const struct LDKOffersMessage *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new MessageRouter which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
+ * Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read
  */
-struct LDKMessageRouter DefaultRouter_as_MessageRouter(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z OffersMessage_write(const struct LDKOffersMessage *NONNULL_PTR obj);
 
 /**
- * Calls the free function if one is set
+ * Read a OffersMessage from a byte array, created by OffersMessage_write
  */
-void Router_free(struct LDKRouter this_ptr);
+struct LDKCResult_OffersMessageDecodeErrorZ OffersMessage_read(struct LDKu8slice ser, uint64_t arg_a, const struct LDKLogger *NONNULL_PTR arg_b);
 
 /**
- * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the Packet, if is_owned is set and inner is non-NULL.
  */
-void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
+void Packet_free(struct LDKPacket this_obj);
 
 /**
- * Initialize a new `ScorerAccountingForInFlightHtlcs`.
+ * Bolt 04 version number
  */
-MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScoreLookUp scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
+uint8_t Packet_get_version(const struct LDKPacket *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
+ * Bolt 04 version number
  */
-struct LDKScoreLookUp ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
+void Packet_set_version(struct LDKPacket *NONNULL_PTR this_ptr, uint8_t val);
 
 /**
- * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
+ * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
  */
-void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
+struct LDKPublicKey Packet_get_public_key(const struct LDKPacket *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the InFlightHtlcs
+ * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
  */
-struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
+void Packet_set_public_key(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Constructs an empty `InFlightHtlcs`.
+ * Encrypted payload for the next hop
+ *
+ * Returns a copy of the field.
  */
-MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
+struct LDKCVec_u8Z Packet_get_hop_data(const struct LDKPacket *NONNULL_PTR this_ptr);
 
 /**
- * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`.
+ * Encrypted payload for the next hop
  */
-void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id);
+void Packet_set_hop_data(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
 
 /**
- * Adds a known HTLC given the public key of the HTLC source, target, and short channel
- * id.
+ * HMAC to verify the integrity of hop_data
  */
-void InFlightHtlcs_add_inflight_htlc(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, uint64_t channel_scid, uint64_t used_msat);
+const uint8_t (*Packet_get_hmac(const struct LDKPacket *NONNULL_PTR this_ptr))[32];
 
 /**
- * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
- * id.
+ * HMAC to verify the integrity of hop_data
  */
-MUST_USE_RES struct LDKCOption_u64Z InFlightHtlcs_used_liquidity_msat(const struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, uint64_t channel_scid);
+void Packet_set_hmac(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
+ * Constructs a new Packet given each field
  */
-struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
+MUST_USE_RES struct LDKPacket Packet_new(uint8_t version_arg, struct LDKPublicKey public_key_arg, struct LDKCVec_u8Z hop_data_arg, struct LDKThirtyTwoBytes hmac_arg);
 
 /**
- * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
+ * Creates a copy of the Packet
  */
-struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
+struct LDKPacket Packet_clone(const struct LDKPacket *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
+ * Generates a non-cryptographic 64-bit hash of the Packet.
  */
-void RouteHop_free(struct LDKRouteHop this_obj);
+uint64_t Packet_hash(const struct LDKPacket *NONNULL_PTR o);
 
 /**
- * The node_id of the node at this hop.
+ * Checks if two Packets 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 LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
+bool Packet_eq(const struct LDKPacket *NONNULL_PTR a, const struct LDKPacket *NONNULL_PTR b);
 
 /**
- * The node_id of the node at this hop.
+ * Serialize the Packet object into a byte array which can be read by Packet_read
  */
-void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+struct LDKCVec_u8Z Packet_write(const struct LDKPacket *NONNULL_PTR 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.
+ * Frees any resources used by the ParsedOnionMessageContents
  */
-struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
+void ParsedOnionMessageContents_free(struct LDKParsedOnionMessageContents 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.
+ * Creates a copy of the ParsedOnionMessageContents
  */
-void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
+struct LDKParsedOnionMessageContents ParsedOnionMessageContents_clone(const struct LDKParsedOnionMessageContents *NONNULL_PTR orig);
 
 /**
- * The channel that should be used from the previous hop to reach this node.
+ * Utility method to constructs a new Offers-variant ParsedOnionMessageContents
  */
-uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
+struct LDKParsedOnionMessageContents ParsedOnionMessageContents_offers(struct LDKOffersMessage a);
 
 /**
- * The channel that should be used from the previous hop to reach this node.
+ * Utility method to constructs a new Custom-variant ParsedOnionMessageContents
  */
-void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKParsedOnionMessageContents ParsedOnionMessageContents_custom(struct LDKOnionMessageContents a);
 
 /**
- * The channel_announcement features of the channel that should be used from the previous hop
- * to reach this node.
+ * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
  */
-struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
+struct LDKOnionMessageContents ParsedOnionMessageContents_as_OnionMessageContents(const struct LDKParsedOnionMessageContents *NONNULL_PTR this_arg);
 
 /**
- * The channel_announcement features of the channel that should be used from the previous hop
- * to reach this node.
+ * Serialize the ParsedOnionMessageContents object into a byte array which can be read by ParsedOnionMessageContents_read
  */
-void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
+struct LDKCVec_u8Z ParsedOnionMessageContents_write(const struct LDKParsedOnionMessageContents *NONNULL_PTR obj);
 
 /**
- * The fee taken on this hop (for paying for the use of the *next* channel in the path).
- * If this is the last hop in [`Path::hops`]:
- * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
- * * otherwise, this is the full value of this [`Path`]'s part of the payment
- *
- * [`BlindedPath`]: crate::blinded_path::BlindedPath
+ * Creates a copy of a OnionMessageContents
  */
-uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
+struct LDKOnionMessageContents OnionMessageContents_clone(const struct LDKOnionMessageContents *NONNULL_PTR orig);
 
 /**
- * The fee taken on this hop (for paying for the use of the *next* channel in the path).
- * If this is the last hop in [`Path::hops`]:
- * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
- * * otherwise, this is the full value of this [`Path`]'s part of the payment
- *
- * [`BlindedPath`]: crate::blinded_path::BlindedPath
+ * Calls the free function if one is set
  */
-void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
+void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
 
 /**
- * The CLTV delta added for this hop.
- * If this is the last hop in [`Path::hops`]:
- * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
- * * otherwise, this is the CLTV delta expected at the destination
- *
- * [`BlindedPath`]: crate::blinded_path::BlindedPath
+ * Frees any resources used by the IntroductionNode
  */
-uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
+void IntroductionNode_free(struct LDKIntroductionNode this_ptr);
 
 /**
- * The CLTV delta added for this hop.
- * If this is the last hop in [`Path::hops`]:
- * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
- * * otherwise, this is the CLTV delta expected at the destination
- *
- * [`BlindedPath`]: crate::blinded_path::BlindedPath
+ * Creates a copy of the IntroductionNode
  */
-void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKIntroductionNode IntroductionNode_clone(const struct LDKIntroductionNode *NONNULL_PTR orig);
 
 /**
- * Indicates whether this hop is possibly announced in the public network graph.
- *
- * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
- * either know for sure it's announced in the public graph, or if any public channels exist
- * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
- * the channel to be unannounced.
- *
- * Will be `true` for objects serialized with LDK version 0.0.116 and before.
+ * Utility method to constructs a new NodeId-variant IntroductionNode
  */
-bool RouteHop_get_maybe_announced_channel(const struct LDKRouteHop *NONNULL_PTR this_ptr);
+struct LDKIntroductionNode IntroductionNode_node_id(struct LDKPublicKey a);
 
 /**
- * Indicates whether this hop is possibly announced in the public network graph.
- *
- * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
- * either know for sure it's announced in the public graph, or if any public channels exist
- * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
- * the channel to be unannounced.
- *
- * Will be `true` for objects serialized with LDK version 0.0.116 and before.
+ * Utility method to constructs a new DirectedShortChannelId-variant IntroductionNode
  */
-void RouteHop_set_maybe_announced_channel(struct LDKRouteHop *NONNULL_PTR this_ptr, bool val);
+struct LDKIntroductionNode IntroductionNode_directed_short_channel_id(enum LDKDirection a, uint64_t b);
 
 /**
- * Constructs a new RouteHop given each field
+ * Generates a non-cryptographic 64-bit hash of the IntroductionNode.
  */
-MUST_USE_RES struct LDKRouteHop RouteHop_new(struct LDKPublicKey pubkey_arg, struct LDKNodeFeatures node_features_arg, uint64_t short_channel_id_arg, struct LDKChannelFeatures channel_features_arg, uint64_t fee_msat_arg, uint32_t cltv_expiry_delta_arg, bool maybe_announced_channel_arg);
+uint64_t IntroductionNode_hash(const struct LDKIntroductionNode *NONNULL_PTR o);
 
 /**
- * Creates a copy of the RouteHop
+ * Checks if two IntroductionNodes contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
+bool IntroductionNode_eq(const struct LDKIntroductionNode *NONNULL_PTR a, const struct LDKIntroductionNode *NONNULL_PTR b);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the RouteHop.
+ * Creates a copy of the Direction
  */
-uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
+enum LDKDirection Direction_clone(const enum LDKDirection *NONNULL_PTR orig);
 
 /**
- * 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.
+ * Utility method to constructs a new NodeOne-variant Direction
  */
-bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
+enum LDKDirection Direction_node_one(void);
 
 /**
- * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
+ * Utility method to constructs a new NodeTwo-variant Direction
  */
-struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
+enum LDKDirection Direction_node_two(void);
 
 /**
- * Read a RouteHop from a byte array, created by RouteHop_write
+ * Generates a non-cryptographic 64-bit hash of the Direction.
  */
-struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
+uint64_t Direction_hash(const enum LDKDirection *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the BlindedTail, if is_owned is set and inner is non-NULL.
+ * Checks if two Directions contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-void BlindedTail_free(struct LDKBlindedTail this_obj);
+bool Direction_eq(const enum LDKDirection *NONNULL_PTR a, const enum LDKDirection *NONNULL_PTR b);
 
 /**
- * The hops of the [`BlindedPath`] provided by the recipient.
- *
- * [`BlindedPath`]: crate::blinded_path::BlindedPath
+ * Calls the free function if one is set
  */
-struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
+void NodeIdLookUp_free(struct LDKNodeIdLookUp this_ptr);
 
 /**
- * The hops of the [`BlindedPath`] provided by the recipient.
- *
- * [`BlindedPath`]: crate::blinded_path::BlindedPath
+ * Frees any resources used by the EmptyNodeIdLookUp, if is_owned is set and inner is non-NULL.
  */
-void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
+void EmptyNodeIdLookUp_free(struct LDKEmptyNodeIdLookUp this_obj);
 
 /**
- * The blinding point of the [`BlindedPath`] provided by the recipient.
- *
- * [`BlindedPath`]: crate::blinded_path::BlindedPath
+ * Constructs a new EmptyNodeIdLookUp given each field
  */
-struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKEmptyNodeIdLookUp EmptyNodeIdLookUp_new(void);
 
 /**
- * The blinding point of the [`BlindedPath`] provided by the recipient.
- *
- * [`BlindedPath`]: crate::blinded_path::BlindedPath
+ * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is
  */
-void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+struct LDKNodeIdLookUp EmptyNodeIdLookUp_as_NodeIdLookUp(const struct LDKEmptyNodeIdLookUp *NONNULL_PTR this_arg);
 
 /**
- * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
- * inferring the destination. May be 0.
+ * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
  */
-uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
+void BlindedHop_free(struct LDKBlindedHop this_obj);
 
 /**
- * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
- * inferring the destination. May be 0.
+ * The blinded node id of this hop in a blinded path.
  */
-void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKPublicKey BlindedHop_get_blinded_node_id(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
 
 /**
- * The total amount paid on this [`Path`], excluding the fees.
+ * The blinded node id of this hop in a blinded path.
  */
-uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
+void BlindedHop_set_blinded_node_id(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * The total amount paid on this [`Path`], excluding the fees.
+ * The encrypted payload intended for this hop in a blinded path.
+ *
+ * Returns a copy of the field.
  */
-void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKCVec_u8Z BlindedHop_get_encrypted_payload(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new BlindedTail given each field
+ * The encrypted payload intended for this hop in a blinded path.
  */
-MUST_USE_RES struct LDKBlindedTail BlindedTail_new(struct LDKCVec_BlindedHopZ hops_arg, struct LDKPublicKey blinding_point_arg, uint32_t excess_final_cltv_expiry_delta_arg, uint64_t final_value_msat_arg);
+void BlindedHop_set_encrypted_payload(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
 
 /**
- * Creates a copy of the BlindedTail
+ * Constructs a new BlindedHop given each field
  */
-struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig);
+MUST_USE_RES struct LDKBlindedHop BlindedHop_new(struct LDKPublicKey blinded_node_id_arg, struct LDKCVec_u8Z encrypted_payload_arg);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the BlindedTail.
+ * Creates a copy of the BlindedHop
  */
-uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o);
+struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
 
 /**
- * Checks if two BlindedTails 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.
+ * Generates a non-cryptographic 64-bit hash of the BlindedHop.
  */
-bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b);
+uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o);
 
 /**
- * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read
+ * Checks if two BlindedHops 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 LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj);
+bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b);
 
 /**
- * Read a BlindedTail from a byte array, created by BlindedTail_write
+ * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
  */
-struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser);
+struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
 
 /**
- * Frees any resources used by the Path, if is_owned is set and inner is non-NULL.
+ * Read a BlindedHop from a byte array, created by BlindedHop_write
  */
-void Path_free(struct LDKPath this_obj);
+struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
 
 /**
- * The list of unblinded hops in this [`Path`]. Must be at least length one.
+ * Frees any resources used by the BlindedPayInfo, if is_owned is set and inner is non-NULL.
  */
-struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr);
+void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj);
 
 /**
- * The list of unblinded hops in this [`Path`]. Must be at least length one.
+ * Base fee charged (in millisatoshi) for the entire blinded path.
  */
-void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val);
+uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
 
 /**
- * The blinded path at which this path terminates, if we're sending to one, and its metadata.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Base fee charged (in millisatoshi) for the entire blinded path.
  */
-struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr);
+void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * The blinded path at which this path terminates, if we're sending to one, and its metadata.
- *
- * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
+ * (i.e., 10,000 is 1%).
  */
-void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val);
+uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new Path given each field
- *
- * Note that blinded_tail_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
+ * (i.e., 10,000 is 1%).
  */
-MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg);
+void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Creates a copy of the Path
+ * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
+ * path.
  */
-struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig);
+uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Path.
+ * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
+ * path.
  */
-uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o);
+void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
- * Checks if two Paths 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 minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
+ * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
+ * seen by the recipient.
  */
-bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b);
+uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
 
 /**
- * Gets the fees for a given path, excluding any excess paid to the recipient.
+ * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
+ * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
+ * seen by the recipient.
  */
-MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg);
+void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Gets the total amount paid on this [`Path`], excluding the fees.
+ * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
+ * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
+ * seen by the recipient.
  */
-MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg);
+uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
 
 /**
- * Gets the final hop's CLTV expiry delta.
+ * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
+ * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
+ * seen by the recipient.
  */
-MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg);
+void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
+ * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
+ * onion payload.
  */
-void Route_free(struct LDKRoute this_obj);
+struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
 
 /**
- * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
- * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
- * the same.
+ * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
+ * onion payload.
  */
-struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
+void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
 
 /**
- * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
- * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
- * the same.
+ * Constructs a new BlindedPayInfo given each field
  */
-void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val);
+MUST_USE_RES struct LDKBlindedPayInfo BlindedPayInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKBlindedHopFeatures features_arg);
 
 /**
- * The `route_params` parameter passed to [`find_route`].
- *
- * This is used by `ChannelManager` to track information which may be required for retries.
- *
- * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Creates a copy of the BlindedPayInfo
  */
-struct LDKRouteParameters Route_get_route_params(const struct LDKRoute *NONNULL_PTR this_ptr);
+struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig);
 
 /**
- * The `route_params` parameter passed to [`find_route`].
- *
- * This is used by `ChannelManager` to track information which may be required for retries.
- *
- * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
- *
- * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
  */
-void Route_set_route_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKRouteParameters val);
+uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o);
 
 /**
- * Constructs a new Route given each field
- *
- * Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Checks if two BlindedPayInfos 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.
  */
-MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKRouteParameters route_params_arg);
+bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b);
 
 /**
- * Creates a copy of the Route
+ * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
  */
-struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
+struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Route.
+ * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
  */
-uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
+struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser);
 
 /**
- * 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.
+ * Frees any resources used by the BlindedPaymentPath, if is_owned is set and inner is non-NULL.
  */
-bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
+void BlindedPaymentPath_free(struct LDKBlindedPaymentPath this_obj);
 
 /**
- * Returns the total amount of fees paid on this [`Route`].
- *
- * For objects serialized with LDK 0.0.117 and after, this includes any extra payment made to
- * the recipient, which can happen in excess of the amount passed to [`find_route`] via
- * [`RouteParameters::final_value_msat`], if we had to reach the [`htlc_minimum_msat`] limits.
- *
- * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
+ * The [`BlindedPayInfo`] used to pay this blinded path.
  */
-MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
+struct LDKBlindedPayInfo BlindedPaymentPath_get_payinfo(const struct LDKBlindedPaymentPath *NONNULL_PTR this_ptr);
 
 /**
- * Returns the total amount paid on this [`Route`], excluding the fees.
- *
- * Might be more than requested as part of the given [`RouteParameters::final_value_msat`] if
- * we had to reach the [`htlc_minimum_msat`] limits.
- *
- * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
+ * The [`BlindedPayInfo`] used to pay this blinded path.
  */
-MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
+void BlindedPaymentPath_set_payinfo(struct LDKBlindedPaymentPath *NONNULL_PTR this_ptr, struct LDKBlindedPayInfo val);
 
 /**
- * Serialize the Route object into a byte array which can be read by Route_read
+ * Creates a copy of the BlindedPaymentPath
  */
-struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
+struct LDKBlindedPaymentPath BlindedPaymentPath_clone(const struct LDKBlindedPaymentPath *NONNULL_PTR orig);
 
 /**
- * Read a Route from a byte array, created by Route_write
+ * Generates a non-cryptographic 64-bit hash of the BlindedPaymentPath.
  */
-struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
+uint64_t BlindedPaymentPath_hash(const struct LDKBlindedPaymentPath *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
+ * Checks if two BlindedPaymentPaths 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 RouteParameters_free(struct LDKRouteParameters this_obj);
+bool BlindedPaymentPath_eq(const struct LDKBlindedPaymentPath *NONNULL_PTR a, const struct LDKBlindedPaymentPath *NONNULL_PTR b);
 
 /**
- * The parameters of the failed payment path.
+ * Create a one-hop blinded path for a payment.
  */
-struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_BlindedPaymentPathNoneZ BlindedPaymentPath_one_hop(struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint16_t min_final_cltv_expiry_delta, struct LDKEntropySource entropy_source);
 
 /**
- * The parameters of the failed payment path.
+ * Create a blinded path for a payment, to be forwarded along `intermediate_nodes`.
+ *
+ * Errors if:
+ * * a provided node id is invalid
+ * * [`BlindedPayInfo`] calculation results in an integer overflow
+ * * any unknown features are required in the provided [`ForwardTlvs`]
  */
-void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
+MUST_USE_RES struct LDKCResult_BlindedPaymentPathNoneZ BlindedPaymentPath_new(struct LDKCVec_PaymentForwardNodeZ intermediate_nodes, struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint64_t htlc_maximum_msat, uint16_t min_final_cltv_expiry_delta, struct LDKEntropySource entropy_source);
 
 /**
- * The amount in msats sent on the failed payment path.
+ * Returns the introduction [`NodeId`] of the blinded path, if it is publicly reachable (i.e.,
+ * it is found in the network graph).
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKNodeId BlindedPaymentPath_public_introduction_node_id(const struct LDKBlindedPaymentPath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
 
 /**
- * The amount in msats sent on the failed payment path.
+ * The [`IntroductionNode`] of the blinded path.
  */
-void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
+MUST_USE_RES struct LDKIntroductionNode BlindedPaymentPath_introduction_node(const struct LDKBlindedPaymentPath *NONNULL_PTR this_arg);
 
 /**
- * The maximum total fees, in millisatoshi, that may accrue during route finding.
- *
- * This limit also applies to the total fees that may arise while retrying failed payment
- * paths.
+ * Used by the [`IntroductionNode`] to decrypt its [`encrypted_payload`] to forward the payment.
  *
- * Note that values below a few sats may result in some paths being spuriously ignored.
+ * [`encrypted_payload`]: BlindedHop::encrypted_payload
  */
-struct LDKCOption_u64Z RouteParameters_get_max_total_routing_fee_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKPublicKey BlindedPaymentPath_blinding_point(const struct LDKBlindedPaymentPath *NONNULL_PTR this_arg);
 
 /**
- * The maximum total fees, in millisatoshi, that may accrue during route finding.
- *
- * This limit also applies to the total fees that may arise while retrying failed payment
- * paths.
+ * The [`BlindedHop`]s within the blinded path.
+ */
+MUST_USE_RES struct LDKCVec_BlindedHopZ BlindedPaymentPath_blinded_hops(const struct LDKBlindedPaymentPath *NONNULL_PTR this_arg);
+
+/**
+ * Advance the blinded onion payment path by one hop, making the second hop into the new
+ * introduction node.
  *
- * Note that values below a few sats may result in some paths being spuriously ignored.
+ * Will only modify `self` when returning `Ok`.
  */
-void RouteParameters_set_max_total_routing_fee_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedPaymentPath_advance_path_by_one(struct LDKBlindedPaymentPath *NONNULL_PTR this_arg, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup);
 
 /**
- * Constructs a new RouteParameters given each field
+ * Frees any resources used by the PaymentForwardNode, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPaymentParameters payment_params_arg, uint64_t final_value_msat_arg, struct LDKCOption_u64Z max_total_routing_fee_msat_arg);
+void PaymentForwardNode_free(struct LDKPaymentForwardNode this_obj);
 
 /**
- * Creates a copy of the RouteParameters
+ * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
+ * used for [`BlindedPayInfo`] construction.
  */
-struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
+struct LDKForwardTlvs PaymentForwardNode_get_tlvs(const struct LDKPaymentForwardNode *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the RouteParameters.
+ * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
+ * used for [`BlindedPayInfo`] construction.
  */
-uint64_t RouteParameters_hash(const struct LDKRouteParameters *NONNULL_PTR o);
+void PaymentForwardNode_set_tlvs(struct LDKPaymentForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val);
 
 /**
- * Checks if two RouteParameterss 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.
+ * This node's pubkey.
  */
-bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
+struct LDKPublicKey PaymentForwardNode_get_node_id(const struct LDKPaymentForwardNode *NONNULL_PTR this_ptr);
 
 /**
- * Constructs [`RouteParameters`] from the given [`PaymentParameters`] and a payment amount.
- *
- * [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats
+ * This node's pubkey.
  */
-MUST_USE_RES struct LDKRouteParameters RouteParameters_from_payment_params_and_value(struct LDKPaymentParameters payment_params, uint64_t final_value_msat);
+void PaymentForwardNode_set_node_id(struct LDKPaymentForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
+ * The maximum value, in msat, that may be accepted by this node.
  */
-struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
+uint64_t PaymentForwardNode_get_htlc_maximum_msat(const struct LDKPaymentForwardNode *NONNULL_PTR this_ptr);
 
 /**
- * Read a RouteParameters from a byte array, created by RouteParameters_write
+ * The maximum value, in msat, that may be accepted by this node.
  */
-struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
+void PaymentForwardNode_set_htlc_maximum_msat(struct LDKPaymentForwardNode *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
+ * Constructs a new PaymentForwardNode given each field
  */
-void PaymentParameters_free(struct LDKPaymentParameters this_obj);
+MUST_USE_RES struct LDKPaymentForwardNode PaymentForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg);
 
 /**
- * Information about the payee, such as their features and route hints for their channels.
+ * Creates a copy of the PaymentForwardNode
  */
-struct LDKPayee PaymentParameters_get_payee(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
+struct LDKPaymentForwardNode PaymentForwardNode_clone(const struct LDKPaymentForwardNode *NONNULL_PTR orig);
 
 /**
- * Information about the payee, such as their features and route hints for their channels.
+ * Frees any resources used by the ForwardTlvs, if is_owned is set and inner is non-NULL.
  */
-void PaymentParameters_set_payee(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
+void ForwardTlvs_free(struct LDKForwardTlvs this_obj);
 
 /**
- * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
+ * The short channel id this payment should be forwarded out over.
  */
-struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
+uint64_t ForwardTlvs_get_short_channel_id(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
 
 /**
- * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
+ * The short channel id this payment should be forwarded out over.
  */
-void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+void ForwardTlvs_set_short_channel_id(struct LDKForwardTlvs *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The maximum total CLTV delta we accept for the route.
- * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
+ * Payment parameters for relaying over [`Self::short_channel_id`].
  */
-uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
+struct LDKPaymentRelay ForwardTlvs_get_payment_relay(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
 
 /**
- * The maximum total CLTV delta we accept for the route.
- * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
+ * Payment parameters for relaying over [`Self::short_channel_id`].
  */
-void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
+void ForwardTlvs_set_payment_relay(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentRelay val);
 
 /**
- * The maximum number of paths that may be used by (MPP) payments.
- * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
+ * Payment constraints for relaying over [`Self::short_channel_id`].
  */
-uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
+struct LDKPaymentConstraints ForwardTlvs_get_payment_constraints(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
 
 /**
- * The maximum number of paths that may be used by (MPP) payments.
- * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
+ * Payment constraints for relaying over [`Self::short_channel_id`].
  */
-void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
+void ForwardTlvs_set_payment_constraints(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
 
 /**
- * Selects the maximum share of a channel's total capacity which will be sent over a channel,
- * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
- * a lower value prefers to send larger MPP parts, potentially saturating channels and
- * increasing failure probability for those paths.
- *
- * Note that this restriction will be relaxed during pathfinding after paths which meet this
- * restriction have been found. While paths which meet this criteria will be searched for, it
- * is ultimately up to the scorer to select them over other paths.
- *
- * A value of 0 will allow payments up to and including a channel's total announced usable
- * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
+ * Supported and required features when relaying a payment onion containing this object's
+ * corresponding [`BlindedHop::encrypted_payload`].
  *
- * Default value: 2
+ * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
  */
-uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
+struct LDKBlindedHopFeatures ForwardTlvs_get_features(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
 
 /**
- * Selects the maximum share of a channel's total capacity which will be sent over a channel,
- * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
- * a lower value prefers to send larger MPP parts, potentially saturating channels and
- * increasing failure probability for those paths.
- *
- * Note that this restriction will be relaxed during pathfinding after paths which meet this
- * restriction have been found. While paths which meet this criteria will be searched for, it
- * is ultimately up to the scorer to select them over other paths.
- *
- * A value of 0 will allow payments up to and including a channel's total announced usable
- * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
+ * Supported and required features when relaying a payment onion containing this object's
+ * corresponding [`BlindedHop::encrypted_payload`].
  *
- * Default value: 2
+ * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
  */
-void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
+void ForwardTlvs_set_features(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
 
 /**
- * A list of SCIDs which this payment was previously attempted over and which caused the
- * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
- * these SCIDs.
+ * Set if this [`BlindedPaymentPath`] is concatenated to another, to indicate the
+ * [`BlindedPaymentPath::blinding_point`] of the appended blinded path.
  *
- * Returns a copy of the field.
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
+struct LDKPublicKey ForwardTlvs_get_next_blinding_override(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
 
 /**
- * A list of SCIDs which this payment was previously attempted over and which caused the
- * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
- * these SCIDs.
+ * Set if this [`BlindedPaymentPath`] is concatenated to another, to indicate the
+ * [`BlindedPaymentPath::blinding_point`] of the appended blinded path.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
+void ForwardTlvs_set_next_blinding_override(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
- * payment was previously attempted over and which caused the payment to fail. Future attempts
- * for the same payment shouldn't be relayed through any of these blinded paths.
+ * Constructs a new ForwardTlvs given each field
  *
- * Returns a copy of the field.
+ * Note that next_blinding_override_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKCVec_u64Z PaymentParameters_get_previously_failed_blinded_path_idxs(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKForwardTlvs ForwardTlvs_new(uint64_t short_channel_id_arg, struct LDKPaymentRelay payment_relay_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKBlindedHopFeatures features_arg, struct LDKPublicKey next_blinding_override_arg);
 
 /**
- * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
- * payment was previously attempted over and which caused the payment to fail. Future attempts
- * for the same payment shouldn't be relayed through any of these blinded paths.
+ * Creates a copy of the ForwardTlvs
  */
-void PaymentParameters_set_previously_failed_blinded_path_idxs(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
+struct LDKForwardTlvs ForwardTlvs_clone(const struct LDKForwardTlvs *NONNULL_PTR orig);
 
 /**
- * Constructs a new PaymentParameters given each field
+ * Frees any resources used by the ReceiveTlvs, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKPaymentParameters PaymentParameters_new(struct LDKPayee payee_arg, struct LDKCOption_u64Z expiry_time_arg, uint32_t max_total_cltv_expiry_delta_arg, uint8_t max_path_count_arg, uint8_t max_channel_saturation_power_of_half_arg, struct LDKCVec_u64Z previously_failed_channels_arg, struct LDKCVec_u64Z previously_failed_blinded_path_idxs_arg);
+void ReceiveTlvs_free(struct LDKReceiveTlvs this_obj);
 
 /**
- * Creates a copy of the PaymentParameters
+ * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
  */
-struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
+const uint8_t (*ReceiveTlvs_get_payment_secret(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr))[32];
 
 /**
- * Generates a non-cryptographic 64-bit hash of the PaymentParameters.
+ * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
  */
-uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
+void ReceiveTlvs_set_payment_secret(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * Checks if two PaymentParameterss 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.
+ * Constraints for the receiver of this payment.
  */
-bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
+struct LDKPaymentConstraints ReceiveTlvs_get_payment_constraints(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
+ * Constraints for the receiver of this payment.
  */
-struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
+void ReceiveTlvs_set_payment_constraints(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
 
 /**
- * Read a PaymentParameters from a byte array, created by PaymentParameters_write
+ * Context for the receiver of this payment.
  */
-struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
+struct LDKPaymentContext ReceiveTlvs_get_payment_context(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
 
 /**
- * Creates a payee with the node id of the given `pubkey`.
- *
- * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
- * provided.
+ * Context for the receiver of this payment.
  */
-MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
+void ReceiveTlvs_set_payment_context(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentContext val);
 
 /**
- * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
- *
- * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
- * provided.
- *
- * Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose
- * whether your router will be allowed to find a multi-part route for this payment. If you
- * set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via
- * [`RecipientOnionFields::secret_only`].
- *
- * [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only
+ * Constructs a new ReceiveTlvs given each field
  */
-MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta, bool allow_mpp);
+MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKPaymentContext payment_context_arg);
 
 /**
- * Creates parameters for paying to a blinded payee from the provided invoice. Sets
- * [`Payee::Blinded::route_hints`], [`Payee::Blinded::features`], and
- * [`PaymentParameters::expiry_time`].
+ * Creates a copy of the ReceiveTlvs
  */
-MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice);
+struct LDKReceiveTlvs ReceiveTlvs_clone(const struct LDKReceiveTlvs *NONNULL_PTR orig);
 
 /**
- * Creates parameters for paying to a blinded payee from the provided blinded route hints.
+ * Frees any resources used by the PaymentRelay, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints);
+void PaymentRelay_free(struct LDKPaymentRelay this_obj);
 
 /**
- * Frees any resources used by the Payee
+ * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
  */
-void Payee_free(struct LDKPayee this_ptr);
+uint16_t PaymentRelay_get_cltv_expiry_delta(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the Payee
+ * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
  */
-struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
+void PaymentRelay_set_cltv_expiry_delta(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
- * Utility method to constructs a new Blinded-variant Payee
+ * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
+ * this [`BlindedHop`], (i.e., 10,000 is 1%).
  */
-struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features);
+uint32_t PaymentRelay_get_fee_proportional_millionths(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
 
 /**
- * Utility method to constructs a new Clear-variant Payee
+ * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
+ * this [`BlindedHop`], (i.e., 10,000 is 1%).
  */
-struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta);
+void PaymentRelay_set_fee_proportional_millionths(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Payee.
+ * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
  */
-uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
+uint32_t PaymentRelay_get_fee_base_msat(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two Payees contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
  */
-bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
+void PaymentRelay_set_fee_base_msat(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
+ * Constructs a new PaymentRelay given each field
  */
-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);
+MUST_USE_RES struct LDKPaymentRelay PaymentRelay_new(uint16_t cltv_expiry_delta_arg, uint32_t fee_proportional_millionths_arg, uint32_t fee_base_msat_arg);
 
 /**
- * Constructs a new RouteHint given each field
+ * Creates a copy of the PaymentRelay
  */
-MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
+struct LDKPaymentRelay PaymentRelay_clone(const struct LDKPaymentRelay *NONNULL_PTR orig);
 
 /**
- * Creates a copy of the RouteHint
+ * Frees any resources used by the PaymentConstraints, if is_owned is set and inner is non-NULL.
  */
-struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
+void PaymentConstraints_free(struct LDKPaymentConstraints this_obj);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the RouteHint.
+ * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
  */
-uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
+uint32_t PaymentConstraints_get_max_cltv_expiry(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
 
 /**
- * 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.
+ * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
  */
-bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
+void PaymentConstraints_set_max_cltv_expiry(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
+ * The minimum value, in msat, that may be accepted by the node corresponding to this
+ * [`BlindedHop`].
  */
-struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
+uint64_t PaymentConstraints_get_htlc_minimum_msat(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
 
 /**
- * Read a RouteHint from a byte array, created by RouteHint_write
+ * The minimum value, in msat, that may be accepted by the node corresponding to this
+ * [`BlindedHop`].
  */
-struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
+void PaymentConstraints_set_htlc_minimum_msat(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
+ * Constructs a new PaymentConstraints given each field
  */
-void RouteHintHop_free(struct LDKRouteHintHop this_obj);
+MUST_USE_RES struct LDKPaymentConstraints PaymentConstraints_new(uint32_t max_cltv_expiry_arg, uint64_t htlc_minimum_msat_arg);
 
 /**
- * The node_id of the non-target end of the route
+ * Creates a copy of the PaymentConstraints
  */
-struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+struct LDKPaymentConstraints PaymentConstraints_clone(const struct LDKPaymentConstraints *NONNULL_PTR orig);
 
 /**
- * The node_id of the non-target end of the route
+ * Frees any resources used by the PaymentContext
  */
-void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void PaymentContext_free(struct LDKPaymentContext this_ptr);
 
 /**
- * The short_channel_id of this channel
+ * Creates a copy of the PaymentContext
  */
-uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+struct LDKPaymentContext PaymentContext_clone(const struct LDKPaymentContext *NONNULL_PTR orig);
 
 /**
- * The short_channel_id of this channel
+ * Utility method to constructs a new Unknown-variant PaymentContext
  */
-void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKPaymentContext PaymentContext_unknown(struct LDKUnknownPaymentContext a);
 
 /**
- * The fees which must be paid to use this channel
+ * Utility method to constructs a new Bolt12Offer-variant PaymentContext
  */
-struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+struct LDKPaymentContext PaymentContext_bolt12_offer(struct LDKBolt12OfferContext a);
 
 /**
- * The fees which must be paid to use this channel
+ * Utility method to constructs a new Bolt12Refund-variant PaymentContext
  */
-void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
+struct LDKPaymentContext PaymentContext_bolt12_refund(struct LDKBolt12RefundContext a);
 
 /**
- * The difference in CLTV values between this node and the next node.
+ * Checks if two PaymentContexts contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+bool PaymentContext_eq(const struct LDKPaymentContext *NONNULL_PTR a, const struct LDKPaymentContext *NONNULL_PTR b);
 
 /**
- * The difference in CLTV values between this node and the next node.
+ * Frees any resources used by the UnknownPaymentContext, if is_owned is set and inner is non-NULL.
  */
-void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
+void UnknownPaymentContext_free(struct LDKUnknownPaymentContext this_obj);
 
 /**
- * The minimum value, in msat, which must be relayed to the next hop.
+ * Creates a copy of the UnknownPaymentContext
  */
-struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+struct LDKUnknownPaymentContext UnknownPaymentContext_clone(const struct LDKUnknownPaymentContext *NONNULL_PTR orig);
 
 /**
- * The minimum value, in msat, which must be relayed to the next hop.
+ * Checks if two UnknownPaymentContexts 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 RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+bool UnknownPaymentContext_eq(const struct LDKUnknownPaymentContext *NONNULL_PTR a, const struct LDKUnknownPaymentContext *NONNULL_PTR b);
 
 /**
- * The maximum value in msat available for routing with a single HTLC.
+ * Frees any resources used by the Bolt12OfferContext, if is_owned is set and inner is non-NULL.
  */
-struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+void Bolt12OfferContext_free(struct LDKBolt12OfferContext this_obj);
 
 /**
- * The maximum value in msat available for routing with a single HTLC.
+ * The identifier of the [`Offer`].
+ *
+ * [`Offer`]: crate::offers::offer::Offer
  */
-void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+struct LDKOfferId Bolt12OfferContext_get_offer_id(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new RouteHintHop given each field
+ * The identifier of the [`Offer`].
+ *
+ * [`Offer`]: crate::offers::offer::Offer
  */
-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 Bolt12OfferContext_set_offer_id(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKOfferId val);
 
 /**
- * Creates a copy of the RouteHintHop
+ * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`].
+ *
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
  */
-struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
+struct LDKInvoiceRequestFields Bolt12OfferContext_get_invoice_request(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the RouteHintHop.
+ * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`].
+ *
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
  */
-uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
+void Bolt12OfferContext_set_invoice_request(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKInvoiceRequestFields val);
 
 /**
- * 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.
+ * Constructs a new Bolt12OfferContext given each field
  */
-bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
+MUST_USE_RES struct LDKBolt12OfferContext Bolt12OfferContext_new(struct LDKOfferId offer_id_arg, struct LDKInvoiceRequestFields invoice_request_arg);
 
 /**
- * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
+ * Creates a copy of the Bolt12OfferContext
  */
-struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
+struct LDKBolt12OfferContext Bolt12OfferContext_clone(const struct LDKBolt12OfferContext *NONNULL_PTR orig);
 
 /**
- * Read a RouteHintHop from a byte array, created by RouteHintHop_write
+ * Checks if two Bolt12OfferContexts 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 LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
+bool Bolt12OfferContext_eq(const struct LDKBolt12OfferContext *NONNULL_PTR a, const struct LDKBolt12OfferContext *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the FirstHopCandidate, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the Bolt12RefundContext, if is_owned is set and inner is non-NULL.
  */
-void FirstHopCandidate_free(struct LDKFirstHopCandidate this_obj);
+void Bolt12RefundContext_free(struct LDKBolt12RefundContext this_obj);
 
 /**
- * Creates a copy of the FirstHopCandidate
+ * Constructs a new Bolt12RefundContext given each field
  */
-struct LDKFirstHopCandidate FirstHopCandidate_clone(const struct LDKFirstHopCandidate *NONNULL_PTR orig);
+MUST_USE_RES struct LDKBolt12RefundContext Bolt12RefundContext_new(void);
 
 /**
- * Frees any resources used by the PublicHopCandidate, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the Bolt12RefundContext
  */
-void PublicHopCandidate_free(struct LDKPublicHopCandidate this_obj);
+struct LDKBolt12RefundContext Bolt12RefundContext_clone(const struct LDKBolt12RefundContext *NONNULL_PTR orig);
 
 /**
- * The short channel ID of the channel, i.e. the identifier by which we refer to this
- * channel.
+ * Checks if two Bolt12RefundContexts 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.
  */
-uint64_t PublicHopCandidate_get_short_channel_id(const struct LDKPublicHopCandidate *NONNULL_PTR this_ptr);
+bool Bolt12RefundContext_eq(const struct LDKBolt12RefundContext *NONNULL_PTR a, const struct LDKBolt12RefundContext *NONNULL_PTR b);
 
 /**
- * The short channel ID of the channel, i.e. the identifier by which we refer to this
- * channel.
+ * Serialize the ForwardTlvs object into a byte array which can be read by ForwardTlvs_read
  */
-void PublicHopCandidate_set_short_channel_id(struct LDKPublicHopCandidate *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKCVec_u8Z ForwardTlvs_write(const struct LDKForwardTlvs *NONNULL_PTR obj);
 
 /**
- * Creates a copy of the PublicHopCandidate
+ * Serialize the ReceiveTlvs object into a byte array which can be read by ReceiveTlvs_read
  */
-struct LDKPublicHopCandidate PublicHopCandidate_clone(const struct LDKPublicHopCandidate *NONNULL_PTR orig);
+struct LDKCVec_u8Z ReceiveTlvs_write(const struct LDKReceiveTlvs *NONNULL_PTR obj);
 
 /**
- * Frees any resources used by the PrivateHopCandidate, if is_owned is set and inner is non-NULL.
+ * Serialize the PaymentRelay object into a byte array which can be read by PaymentRelay_read
  */
-void PrivateHopCandidate_free(struct LDKPrivateHopCandidate this_obj);
+struct LDKCVec_u8Z PaymentRelay_write(const struct LDKPaymentRelay *NONNULL_PTR obj);
 
 /**
- * Creates a copy of the PrivateHopCandidate
+ * Read a PaymentRelay from a byte array, created by PaymentRelay_write
  */
-struct LDKPrivateHopCandidate PrivateHopCandidate_clone(const struct LDKPrivateHopCandidate *NONNULL_PTR orig);
+struct LDKCResult_PaymentRelayDecodeErrorZ PaymentRelay_read(struct LDKu8slice ser);
 
 /**
- * Frees any resources used by the BlindedPathCandidate, if is_owned is set and inner is non-NULL.
+ * Serialize the PaymentConstraints object into a byte array which can be read by PaymentConstraints_read
  */
-void BlindedPathCandidate_free(struct LDKBlindedPathCandidate this_obj);
+struct LDKCVec_u8Z PaymentConstraints_write(const struct LDKPaymentConstraints *NONNULL_PTR obj);
 
 /**
- * Creates a copy of the BlindedPathCandidate
+ * Read a PaymentConstraints from a byte array, created by PaymentConstraints_write
  */
-struct LDKBlindedPathCandidate BlindedPathCandidate_clone(const struct LDKBlindedPathCandidate *NONNULL_PTR orig);
+struct LDKCResult_PaymentConstraintsDecodeErrorZ PaymentConstraints_read(struct LDKu8slice ser);
 
 /**
- * Frees any resources used by the OneHopBlindedPathCandidate, if is_owned is set and inner is non-NULL.
+ * Serialize the PaymentContext object into a byte array which can be read by PaymentContext_read
  */
-void OneHopBlindedPathCandidate_free(struct LDKOneHopBlindedPathCandidate this_obj);
+struct LDKCVec_u8Z PaymentContext_write(const struct LDKPaymentContext *NONNULL_PTR obj);
 
 /**
- * Creates a copy of the OneHopBlindedPathCandidate
+ * Read a PaymentContext from a byte array, created by PaymentContext_write
  */
-struct LDKOneHopBlindedPathCandidate OneHopBlindedPathCandidate_clone(const struct LDKOneHopBlindedPathCandidate *NONNULL_PTR orig);
+struct LDKCResult_PaymentContextDecodeErrorZ PaymentContext_read(struct LDKu8slice ser);
 
 /**
- * Frees any resources used by the CandidateRouteHop
+ * Serialize the UnknownPaymentContext object into a byte array which can be read by UnknownPaymentContext_read
  */
-void CandidateRouteHop_free(struct LDKCandidateRouteHop this_ptr);
+struct LDKCVec_u8Z UnknownPaymentContext_write(const struct LDKUnknownPaymentContext *NONNULL_PTR obj);
 
 /**
- * Creates a copy of the CandidateRouteHop
+ * Read a UnknownPaymentContext from a byte array, created by UnknownPaymentContext_write
  */
-struct LDKCandidateRouteHop CandidateRouteHop_clone(const struct LDKCandidateRouteHop *NONNULL_PTR orig);
+struct LDKCResult_UnknownPaymentContextDecodeErrorZ UnknownPaymentContext_read(struct LDKu8slice ser);
 
 /**
- * Utility method to constructs a new FirstHop-variant CandidateRouteHop
+ * Serialize the Bolt12OfferContext object into a byte array which can be read by Bolt12OfferContext_read
  */
-struct LDKCandidateRouteHop CandidateRouteHop_first_hop(struct LDKFirstHopCandidate a);
+struct LDKCVec_u8Z Bolt12OfferContext_write(const struct LDKBolt12OfferContext *NONNULL_PTR obj);
 
 /**
- * Utility method to constructs a new PublicHop-variant CandidateRouteHop
+ * Read a Bolt12OfferContext from a byte array, created by Bolt12OfferContext_write
  */
-struct LDKCandidateRouteHop CandidateRouteHop_public_hop(struct LDKPublicHopCandidate a);
+struct LDKCResult_Bolt12OfferContextDecodeErrorZ Bolt12OfferContext_read(struct LDKu8slice ser);
 
 /**
- * Utility method to constructs a new PrivateHop-variant CandidateRouteHop
+ * Serialize the Bolt12RefundContext object into a byte array which can be read by Bolt12RefundContext_read
  */
-struct LDKCandidateRouteHop CandidateRouteHop_private_hop(struct LDKPrivateHopCandidate a);
+struct LDKCVec_u8Z Bolt12RefundContext_write(const struct LDKBolt12RefundContext *NONNULL_PTR obj);
 
 /**
- * Utility method to constructs a new Blinded-variant CandidateRouteHop
+ * Read a Bolt12RefundContext from a byte array, created by Bolt12RefundContext_write
  */
-struct LDKCandidateRouteHop CandidateRouteHop_blinded(struct LDKBlindedPathCandidate a);
+struct LDKCResult_Bolt12RefundContextDecodeErrorZ Bolt12RefundContext_read(struct LDKu8slice ser);
 
 /**
- * Utility method to constructs a new OneHopBlinded-variant CandidateRouteHop
+ * Frees any resources used by the BlindedMessagePath, if is_owned is set and inner is non-NULL.
  */
-struct LDKCandidateRouteHop CandidateRouteHop_one_hop_blinded(struct LDKOneHopBlindedPathCandidate a);
+void BlindedMessagePath_free(struct LDKBlindedMessagePath this_obj);
 
 /**
- * Returns the globally unique short channel ID for this hop, if one is known.
- *
- * This only returns `Some` if the channel is public (either our own, or one we've learned
- * from the public network graph), and thus the short channel ID we have for this channel is
- * globally unique and identifies this channel in a global namespace.
+ * Creates a copy of the BlindedMessagePath
  */
-MUST_USE_RES struct LDKCOption_u64Z CandidateRouteHop_globally_unique_short_channel_id(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
+struct LDKBlindedMessagePath BlindedMessagePath_clone(const struct LDKBlindedMessagePath *NONNULL_PTR orig);
 
 /**
- * Returns the required difference in HTLC CLTV expiry between the [`Self::source`] and the
- * next-hop for an HTLC taking this hop.
- *
- * This is the time that the node(s) in this hop have to claim the HTLC on-chain if the
- * next-hop goes on chain with a payment preimage.
+ * Generates a non-cryptographic 64-bit hash of the BlindedMessagePath.
  */
-MUST_USE_RES uint32_t CandidateRouteHop_cltv_expiry_delta(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
+uint64_t BlindedMessagePath_hash(const struct LDKBlindedMessagePath *NONNULL_PTR o);
 
 /**
- * Returns the minimum amount that can be sent over this hop, in millisatoshis.
+ * Checks if two BlindedMessagePaths 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.
  */
-MUST_USE_RES uint64_t CandidateRouteHop_htlc_minimum_msat(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
+bool BlindedMessagePath_eq(const struct LDKBlindedMessagePath *NONNULL_PTR a, const struct LDKBlindedMessagePath *NONNULL_PTR b);
 
 /**
- * Returns the fees that must be paid to route an HTLC over this channel.
+ * Serialize the BlindedMessagePath object into a byte array which can be read by BlindedMessagePath_read
  */
-MUST_USE_RES struct LDKRoutingFees CandidateRouteHop_fees(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z BlindedMessagePath_write(const struct LDKBlindedMessagePath *NONNULL_PTR obj);
 
 /**
- * Returns the source node id of current hop.
- *
- * Source node id refers to the node forwarding the HTLC through this hop.
- *
- * For [`Self::FirstHop`] we return payer's node id.
+ * Read a BlindedMessagePath from a byte array, created by BlindedMessagePath_write
  */
-MUST_USE_RES struct LDKNodeId CandidateRouteHop_source(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
+struct LDKCResult_BlindedMessagePathDecodeErrorZ BlindedMessagePath_read(struct LDKu8slice ser);
 
 /**
- * Returns the target node id of this hop, if known.
- *
- * Target node id refers to the node receiving the HTLC after this hop.
- *
- * For [`Self::Blinded`] we return `None` because the ultimate destination after the blinded
- * path is unknown.
- *
- * For [`Self::OneHopBlinded`] we return `None` because the target is the same as the source,
- * and such a return value would be somewhat nonsensical.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Create a one-hop blinded path for a message.
  */
-MUST_USE_RES struct LDKNodeId CandidateRouteHop_target(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_BlindedMessagePathNoneZ BlindedMessagePath_one_hop(struct LDKPublicKey recipient_node_id, struct LDKMessageContext context, struct LDKEntropySource entropy_source);
 
 /**
- * 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 the `payee` field
- * in the given [`RouteParameters::payment_params`].
- * 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 the `payee` field
- * of [`RouteParameters::payment_params`].
- *
- * 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 these channels
- * from `network_graph` 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.
- *
- * # Panics
- *
- * Panics if first_hops contains channels without `short_channel_id`s;
- * [`ChannelManager::list_usable_channels`] will never include such channels.
- *
- * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
- * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
- * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
+ * Create a path for an onion message, to be forwarded along `node_pks`. The last node
+ * pubkey in `node_pks` will be the destination node.
  *
- * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Errors if no hops are provided or if `node_pk`(s) are invalid.
  */
-struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScoreLookUp *NONNULL_PTR scorer, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params, const uint8_t (*random_seed_bytes)[32]);
+MUST_USE_RES struct LDKCResult_BlindedMessagePathNoneZ BlindedMessagePath_new(struct LDKCVec_MessageForwardNodeZ intermediate_nodes, struct LDKPublicKey recipient_node_id, struct LDKMessageContext context, struct LDKEntropySource entropy_source);
 
 /**
- * Construct a route from us (payer) to the target node (payee) via the given hops (which should
- * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
+ * Attempts to a use a compact representation for the [`IntroductionNode`] by using a directed
+ * short channel id from a channel in `network_graph` leading to the introduction node.
  *
- * Re-uses logic from `find_route`, so the restrictions described there also apply here.
+ * While this may result in a smaller encoding, there is a trade off in that the path may
+ * become invalid if the channel is closed or hasn't been propagated via gossip. Therefore,
+ * calling this may not be suitable for long-lived blinded paths.
  */
-struct LDKCResult_RouteLightningErrorZ build_route_from_hops(struct LDKPublicKey our_node_pubkey, struct LDKCVec_PublicKeyZ hops, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, const uint8_t (*random_seed_bytes)[32]);
+void BlindedMessagePath_use_compact_introduction_node(struct LDKBlindedMessagePath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
 
 /**
- * Calls the free function if one is set
+ * Returns the introduction [`NodeId`] of the blinded path, if it is publicly reachable (i.e.,
+ * it is found in the network graph).
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void ScoreLookUp_free(struct LDKScoreLookUp this_ptr);
+MUST_USE_RES struct LDKNodeId BlindedMessagePath_public_introduction_node_id(const struct LDKBlindedMessagePath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
 
 /**
- * Calls the free function if one is set
+ * The [`IntroductionNode`] of the blinded path.
  */
-void ScoreUpdate_free(struct LDKScoreUpdate this_ptr);
+MUST_USE_RES struct LDKIntroductionNode BlindedMessagePath_introduction_node(const struct LDKBlindedMessagePath *NONNULL_PTR this_arg);
 
 /**
- * Calls the free function if one is set
+ * Used by the [`IntroductionNode`] to decrypt its [`encrypted_payload`] to forward the message.
+ *
+ * [`encrypted_payload`]: BlindedHop::encrypted_payload
  */
-void Score_free(struct LDKScore this_ptr);
+MUST_USE_RES struct LDKPublicKey BlindedMessagePath_blinding_point(const struct LDKBlindedMessagePath *NONNULL_PTR this_arg);
 
 /**
- * Calls the free function if one is set
+ * The [`BlindedHop`]s within the blinded path.
  */
-void LockableScore_free(struct LDKLockableScore this_ptr);
+MUST_USE_RES struct LDKCVec_BlindedHopZ BlindedMessagePath_blinded_hops(const struct LDKBlindedMessagePath *NONNULL_PTR this_arg);
 
 /**
- * Calls the free function if one is set
+ * Advance the blinded onion message path by one hop, making the second hop into the new
+ * introduction node.
+ *
+ * Will only modify `self` when returning `Ok`.
  */
-void WriteableScore_free(struct LDKWriteableScore this_ptr);
+MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedMessagePath_advance_path_by_one(struct LDKBlindedMessagePath *NONNULL_PTR this_arg, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup);
 
 /**
- * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the NextMessageHop
  */
-void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
+void NextMessageHop_free(struct LDKNextMessageHop this_ptr);
 
 /**
- * Constructs a new LockableScore which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
+ * Creates a copy of the NextMessageHop
  */
-struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
+struct LDKNextMessageHop NextMessageHop_clone(const struct LDKNextMessageHop *NONNULL_PTR orig);
 
 /**
- * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
+ * Utility method to constructs a new NodeId-variant NextMessageHop
  */
-struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
+struct LDKNextMessageHop NextMessageHop_node_id(struct LDKPublicKey a);
 
 /**
- * Constructs a new WriteableScore which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
+ * Utility method to constructs a new ShortChannelId-variant NextMessageHop
  */
-struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
+struct LDKNextMessageHop NextMessageHop_short_channel_id(uint64_t a);
 
 /**
- * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
+ * Generates a non-cryptographic 64-bit hash of the NextMessageHop.
  */
-MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
+uint64_t NextMessageHop_hash(const struct LDKNextMessageHop *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the MultiThreadedScoreLockRead, if is_owned is set and inner is non-NULL.
+ * Checks if two NextMessageHops contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-void MultiThreadedScoreLockRead_free(struct LDKMultiThreadedScoreLockRead this_obj);
+bool NextMessageHop_eq(const struct LDKNextMessageHop *NONNULL_PTR a, const struct LDKNextMessageHop *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the MultiThreadedScoreLockWrite, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the MessageForwardNode, if is_owned is set and inner is non-NULL.
  */
-void MultiThreadedScoreLockWrite_free(struct LDKMultiThreadedScoreLockWrite this_obj);
+void MessageForwardNode_free(struct LDKMessageForwardNode this_obj);
 
 /**
- * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
+ * This node's pubkey.
  */
-struct LDKScoreLookUp MultiThreadedScoreLockRead_as_ScoreLookUp(const struct LDKMultiThreadedScoreLockRead *NONNULL_PTR this_arg);
+struct LDKPublicKey MessageForwardNode_get_node_id(const struct LDKMessageForwardNode *NONNULL_PTR this_ptr);
 
 /**
- * Serialize the MultiThreadedScoreLockWrite object into a byte array which can be read by MultiThreadedScoreLockWrite_read
+ * This node's pubkey.
  */
-struct LDKCVec_u8Z MultiThreadedScoreLockWrite_write(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR obj);
+void MessageForwardNode_set_node_id(struct LDKMessageForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
+ * The channel between `node_id` and the next hop. If set, the constructed [`BlindedHop`]'s
+ * `encrypted_payload` will use this instead of the next [`MessageForwardNode::node_id`] for a
+ * more compact representation.
  */
-struct LDKScoreUpdate MultiThreadedScoreLockWrite_as_ScoreUpdate(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR this_arg);
+struct LDKCOption_u64Z MessageForwardNode_get_short_channel_id(const struct LDKMessageForwardNode *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
+ * The channel between `node_id` and the next hop. If set, the constructed [`BlindedHop`]'s
+ * `encrypted_payload` will use this instead of the next [`MessageForwardNode::node_id`] for a
+ * more compact representation.
  */
-void ChannelUsage_free(struct LDKChannelUsage this_obj);
+void MessageForwardNode_set_short_channel_id(struct LDKMessageForwardNode *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
 
 /**
- * The amount to send through the channel, denominated in millisatoshis.
+ * Constructs a new MessageForwardNode given each field
  */
-uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKMessageForwardNode MessageForwardNode_new(struct LDKPublicKey node_id_arg, struct LDKCOption_u64Z short_channel_id_arg);
 
 /**
- * The amount to send through the channel, denominated in millisatoshis.
+ * Creates a copy of the MessageForwardNode
  */
-void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKMessageForwardNode MessageForwardNode_clone(const struct LDKMessageForwardNode *NONNULL_PTR orig);
 
 /**
- * Total amount, denominated in millisatoshis, already allocated to send through the channel
- * as part of a multi-path payment.
+ * Generates a non-cryptographic 64-bit hash of the MessageForwardNode.
  */
-uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
+uint64_t MessageForwardNode_hash(const struct LDKMessageForwardNode *NONNULL_PTR o);
 
 /**
- * Total amount, denominated in millisatoshis, already allocated to send through the channel
- * as part of a multi-path payment.
+ * Checks if two MessageForwardNodes 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 ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
+bool MessageForwardNode_eq(const struct LDKMessageForwardNode *NONNULL_PTR a, const struct LDKMessageForwardNode *NONNULL_PTR b);
 
 /**
- * The effective capacity of the channel.
+ * Frees any resources used by the MessageContext
  */
-struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
+void MessageContext_free(struct LDKMessageContext this_ptr);
 
 /**
- * The effective capacity of the channel.
+ * Creates a copy of the MessageContext
  */
-void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
+struct LDKMessageContext MessageContext_clone(const struct LDKMessageContext *NONNULL_PTR orig);
 
 /**
- * Constructs a new ChannelUsage given each field
+ * Utility method to constructs a new Offers-variant MessageContext
  */
-MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
+struct LDKMessageContext MessageContext_offers(struct LDKOffersContext a);
 
 /**
- * Creates a copy of the ChannelUsage
+ * Utility method to constructs a new Custom-variant MessageContext
  */
-struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
+struct LDKMessageContext MessageContext_custom(struct LDKCVec_u8Z a);
 
 /**
- * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the OffersContext
  */
-void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
+void OffersContext_free(struct LDKOffersContext this_ptr);
 
 /**
- * Creates a copy of the FixedPenaltyScorer
+ * Creates a copy of the OffersContext
  */
-struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
+struct LDKOffersContext OffersContext_clone(const struct LDKOffersContext *NONNULL_PTR orig);
 
 /**
- * Creates a new scorer using `penalty_msat`.
+ * Utility method to constructs a new InvoiceRequest-variant OffersContext
  */
-MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
+struct LDKOffersContext OffersContext_invoice_request(struct LDKNonce nonce);
 
 /**
- * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
+ * Utility method to constructs a new OutboundPayment-variant OffersContext
  */
-struct LDKScoreLookUp FixedPenaltyScorer_as_ScoreLookUp(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
+struct LDKOffersContext OffersContext_outbound_payment(struct LDKThirtyTwoBytes payment_id, struct LDKNonce nonce, struct LDKThirtyTwoBytes hmac);
 
 /**
- * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
+ * Utility method to constructs a new InboundPayment-variant OffersContext
  */
-struct LDKScoreUpdate FixedPenaltyScorer_as_ScoreUpdate(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
+struct LDKOffersContext OffersContext_inbound_payment(struct LDKThirtyTwoBytes payment_hash);
 
 /**
- * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
+ * Checks if two OffersContexts contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
+bool OffersContext_eq(const struct LDKOffersContext *NONNULL_PTR a, const struct LDKOffersContext *NONNULL_PTR b);
 
 /**
- * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
+ * Serialize the MessageContext object into a byte array which can be read by MessageContext_read
  */
-struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
+struct LDKCVec_u8Z MessageContext_write(const struct LDKMessageContext *NONNULL_PTR obj);
 
 /**
- * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
+ * Read a MessageContext from a byte array, created by MessageContext_write
  */
-void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
+struct LDKCResult_MessageContextDecodeErrorZ MessageContext_read(struct LDKu8slice ser);
 
 /**
- * Frees any resources used by the ProbabilisticScoringFeeParameters, if is_owned is set and inner is non-NULL.
+ * Serialize the OffersContext object into a byte array which can be read by OffersContext_read
  */
-void ProbabilisticScoringFeeParameters_free(struct LDKProbabilisticScoringFeeParameters this_obj);
+struct LDKCVec_u8Z OffersContext_write(const struct LDKOffersContext *NONNULL_PTR obj);
 
 /**
- * A fixed penalty in msats to apply to each channel.
- *
- * Default value: 500 msat
+ * Read a OffersContext from a byte array, created by OffersContext_write
  */
-uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
+struct LDKCResult_OffersContextDecodeErrorZ OffersContext_read(struct LDKu8slice ser);
 
 /**
- * A fixed penalty in msats to apply to each channel.
- *
- * Default value: 500 msat
+ * Frees any resources used by the FundingInfo
  */
-void ProbabilisticScoringFeeParameters_set_base_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
+void FundingInfo_free(struct LDKFundingInfo this_ptr);
 
 /**
- * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
- * applied to each channel, in excess of the [`base_penalty_msat`].
- *
- * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
- * fees plus penalty) for large payments. The penalty is computed as the product of this
- * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
- * amount plus the amount of any other HTLCs flowing we sent over the same channel).
- *
- * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
- *
- * Default value: 8,192 msat
- *
- * [`base_penalty_msat`]: Self::base_penalty_msat
+ * Creates a copy of the FundingInfo
  */
-uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
+struct LDKFundingInfo FundingInfo_clone(const struct LDKFundingInfo *NONNULL_PTR orig);
 
 /**
- * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
- * applied to each channel, in excess of the [`base_penalty_msat`].
- *
- * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
- * fees plus penalty) for large payments. The penalty is computed as the product of this
- * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
- * amount plus the amount of any other HTLCs flowing we sent over the same channel).
- *
- * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
- *
- * Default value: 8,192 msat
- *
- * [`base_penalty_msat`]: Self::base_penalty_msat
+ * Utility method to constructs a new Tx-variant FundingInfo
  */
-void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKFundingInfo FundingInfo_tx(struct LDKTransaction transaction);
 
 /**
- * A multiplier used in conjunction with the negative `log10` of the channel's success
- * probability for a payment, as determined by our latest estimates of the channel's
- * liquidity, to determine the liquidity penalty.
- *
- * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
- * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
- * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
- * lower bounding the success probability to `0.01`) when the amount falls within the
- * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
- * result in a `u64::max_value` penalty, however.
- *
- * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
- *
- * Default value: 30,000 msat
- *
- * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
+ * Utility method to constructs a new OutPoint-variant FundingInfo
  */
-uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
+struct LDKFundingInfo FundingInfo_out_point(struct LDKOutPoint outpoint);
 
 /**
- * A multiplier used in conjunction with the negative `log10` of the channel's success
- * probability for a payment, as determined by our latest estimates of the channel's
- * liquidity, to determine the liquidity penalty.
- *
- * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
- * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
- * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
- * lower bounding the success probability to `0.01`) when the amount falls within the
- * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
- * result in a `u64::max_value` penalty, however.
- *
- * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
- *
- * Default value: 30,000 msat
- *
- * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
+ * Checks if two FundingInfos contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
+bool FundingInfo_eq(const struct LDKFundingInfo *NONNULL_PTR a, const struct LDKFundingInfo *NONNULL_PTR b);
 
 /**
- * A multiplier used in conjunction with the total amount flowing over a channel and the
- * negative `log10` of the channel's success probability for the payment, as determined by our
- * latest estimates of the channel's liquidity, to determine the amount penalty.
- *
- * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
- * fees plus penalty) for large payments. The penalty is computed as the product of this
- * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
- * `log10` of the success probability.
- *
- * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
- *
- * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
- * the amount will result in a penalty of the multiplier. And, as the success probability
- * decreases, the negative `log10` weighting will increase dramatically. For higher success
- * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
- * fall below `1`.
- *
- * Default value: 192 msat
+ * Serialize the FundingInfo object into a byte array which can be read by FundingInfo_read
  */
-uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z FundingInfo_write(const struct LDKFundingInfo *NONNULL_PTR obj);
 
 /**
- * A multiplier used in conjunction with the total amount flowing over a channel and the
- * negative `log10` of the channel's success probability for the payment, as determined by our
- * latest estimates of the channel's liquidity, to determine the amount penalty.
- *
- * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
- * fees plus penalty) for large payments. The penalty is computed as the product of this
- * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
- * `log10` of the success probability.
- *
- * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
- *
- * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
- * the amount will result in a penalty of the multiplier. And, as the success probability
- * decreases, the negative `log10` weighting will increase dramatically. For higher success
- * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
- * fall below `1`.
- *
- * Default value: 192 msat
+ * Read a FundingInfo from a byte array, created by FundingInfo_write
  */
-void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKCResult_FundingInfoDecodeErrorZ FundingInfo_read(struct LDKu8slice ser);
 
 /**
- * A multiplier used in conjunction with the negative `log10` of the channel's success
- * probability for the payment, as determined based on the history of our estimates of the
- * channel's available liquidity, to determine a penalty.
- *
- * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
- * only our latest estimate for the current liquidity available in the channel, it estimates
- * success probability based on the estimated liquidity available in the channel through
- * history. Specifically, every time we update our liquidity bounds on a given channel, we
- * track which of several buckets those bounds fall into, exponentially decaying the
- * probability of each bucket as new samples are added.
- *
- * Default value: 10,000 msat
- *
- * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
+ * Frees any resources used by the PaymentPurpose
  */
-uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
+void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
 
 /**
- * A multiplier used in conjunction with the negative `log10` of the channel's success
- * probability for the payment, as determined based on the history of our estimates of the
- * channel's available liquidity, to determine a penalty.
- *
- * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
- * only our latest estimate for the current liquidity available in the channel, it estimates
- * success probability based on the estimated liquidity available in the channel through
- * history. Specifically, every time we update our liquidity bounds on a given channel, we
- * track which of several buckets those bounds fall into, exponentially decaying the
- * probability of each bucket as new samples are added.
- *
- * Default value: 10,000 msat
- *
- * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
+ * Creates a copy of the PaymentPurpose
  */
-void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
 
 /**
- * A multiplier used in conjunction with the total amount flowing over a channel and the
- * negative `log10` of the channel's success probability for the payment, as determined based
- * on the history of our estimates of the channel's available liquidity, to determine a
- * penalty.
- *
- * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
- * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
- * of the amount flowing over this channel, weighted by the negative `log10` of the success
- * probability.
- *
- * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
- * of using only our latest estimate for the current liquidity available in the channel, it
- * estimates success probability based on the estimated liquidity available in the channel
- * through history. Specifically, every time we update our liquidity bounds on a given
- * channel, we track which of several buckets those bounds fall into, exponentially decaying
- * the probability of each bucket as new samples are added.
- *
- * Default value: 64 msat
- *
- * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
+ * Utility method to constructs a new Bolt11InvoicePayment-variant PaymentPurpose
  */
-uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
+struct LDKPaymentPurpose PaymentPurpose_bolt11_invoice_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret);
 
 /**
- * A multiplier used in conjunction with the total amount flowing over a channel and the
- * negative `log10` of the channel's success probability for the payment, as determined based
- * on the history of our estimates of the channel's available liquidity, to determine a
- * penalty.
- *
- * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
- * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
- * of the amount flowing over this channel, weighted by the negative `log10` of the success
- * probability.
- *
- * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
- * of using only our latest estimate for the current liquidity available in the channel, it
- * estimates success probability based on the estimated liquidity available in the channel
- * through history. Specifically, every time we update our liquidity bounds on a given
- * channel, we track which of several buckets those bounds fall into, exponentially decaying
- * the probability of each bucket as new samples are added.
- *
- * Default value: 64 msat
- *
- * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
+ * Utility method to constructs a new Bolt12OfferPayment-variant PaymentPurpose
  */
-void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKPaymentPurpose PaymentPurpose_bolt12_offer_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12OfferContext payment_context);
 
 /**
- * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
- * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
- * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
- * as this makes balance discovery attacks harder to execute, thereby creating an incentive
- * to restrict `htlc_maximum_msat` and improve privacy.
- *
- * Default value: 250 msat
+ * Utility method to constructs a new Bolt12RefundPayment-variant PaymentPurpose
  */
-uint64_t ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
+struct LDKPaymentPurpose PaymentPurpose_bolt12_refund_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12RefundContext payment_context);
 
 /**
- * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
- * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
- * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
- * as this makes balance discovery attacks harder to execute, thereby creating an incentive
- * to restrict `htlc_maximum_msat` and improve privacy.
- *
- * Default value: 250 msat
+ * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
  */
-void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
 
 /**
- * This penalty is applied when the total amount flowing over a channel exceeds our current
- * estimate of the channel's available liquidity. The total amount is the amount of the
- * current HTLC plus any HTLCs which we've sent over the same channel.
- *
- * Note that in this case all other penalties, including the
- * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
- * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
- * applicable, are still included in the overall penalty.
- *
- * If you wish to avoid creating paths with such channels entirely, setting this to a value of
- * `u64::max_value()` will guarantee that.
- *
- * Default value: 1_0000_0000_000 msat (1 Bitcoin)
- *
- * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
- * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
- * [`base_penalty_msat`]: Self::base_penalty_msat
- * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
+ * Checks if two PaymentPurposes contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-uint64_t ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
+bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
 
 /**
- * This penalty is applied when the total amount flowing over a channel exceeds our current
- * estimate of the channel's available liquidity. The total amount is the amount of the
- * current HTLC plus any HTLCs which we've sent over the same channel.
- *
- * Note that in this case all other penalties, including the
- * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
- * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
- * applicable, are still included in the overall penalty.
- *
- * If you wish to avoid creating paths with such channels entirely, setting this to a value of
- * `u64::max_value()` will guarantee that.
- *
- * Default value: 1_0000_0000_000 msat (1 Bitcoin)
- *
- * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
- * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
- * [`base_penalty_msat`]: Self::base_penalty_msat
- * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
+ * Returns the preimage for this payment, if it is known.
  */
-void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
+MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ PaymentPurpose_preimage(const struct LDKPaymentPurpose *NONNULL_PTR this_arg);
 
 /**
- * In order to calculate most of the scores above, we must first convert a lower and upper
- * bound on the available liquidity in a channel into the probability that we think a payment
- * will succeed. That probability is derived from a Probability Density Function for where we
- * think the liquidity in a channel likely lies, given such bounds.
- *
- * If this flag is set, that PDF is simply a constant - we assume that the actual available
- * liquidity in a channel is just as likely to be at any point between our lower and upper
- * bounds.
- *
- * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
- * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
- * matches experimental results - most routing nodes do not aggressively rebalance their
- * channels and flows in the network are often unbalanced, leaving liquidity usually
- * unavailable.
- *
- * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
- * of floating-point multiplications in the hottest routing code, which may lead to routing
- * performance degradation on some machines.
- *
- * Default value: false
+ * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
  */
-bool ProbabilisticScoringFeeParameters_get_linear_success_probability(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
 
 /**
- * In order to calculate most of the scores above, we must first convert a lower and upper
- * bound on the available liquidity in a channel into the probability that we think a payment
- * will succeed. That probability is derived from a Probability Density Function for where we
- * think the liquidity in a channel likely lies, given such bounds.
- *
- * If this flag is set, that PDF is simply a constant - we assume that the actual available
- * liquidity in a channel is just as likely to be at any point between our lower and upper
- * bounds.
- *
- * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
- * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
- * matches experimental results - most routing nodes do not aggressively rebalance their
- * channels and flows in the network are often unbalanced, leaving liquidity usually
- * unavailable.
- *
- * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
- * of floating-point multiplications in the hottest routing code, which may lead to routing
- * performance degradation on some machines.
- *
- * Default value: false
+ * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
  */
-void ProbabilisticScoringFeeParameters_set_linear_success_probability(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, bool val);
+struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
 
 /**
- * Creates a copy of the ProbabilisticScoringFeeParameters
+ * Frees any resources used by the ClaimedHTLC, if is_owned is set and inner is non-NULL.
  */
-struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_clone(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR orig);
+void ClaimedHTLC_free(struct LDKClaimedHTLC this_obj);
 
 /**
- * Creates a "default" ProbabilisticScoringFeeParameters. See struct and individual field documentaiton for details on which values are used.
+ * The `channel_id` of the channel over which the HTLC was received.
  */
-MUST_USE_RES struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_default(void);
+struct LDKChannelId ClaimedHTLC_get_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
 
 /**
- * Marks the node with the given `node_id` as banned,
- * i.e it will be avoided during path finding.
+ * The `channel_id` of the channel over which the HTLC was received.
  */
-void ProbabilisticScoringFeeParameters_add_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
+void ClaimedHTLC_set_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
 
 /**
- * Marks all nodes in the given list as banned, i.e.,
- * they will be avoided during path finding.
+ * The `user_channel_id` of the channel over which the HTLC was received. This is the value
+ * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
+ * [`ChannelManager::accept_inbound_channel`] for inbound channels if
+ * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
+ * `user_channel_id` will be randomized for an inbound channel.
+ *
+ * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
+ * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
+ * was not actually claimed until after upgrading.)
+ *
+ * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
  */
-void ProbabilisticScoringFeeParameters_add_banned_from_list(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
+struct LDKU128 ClaimedHTLC_get_user_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
 
 /**
- * Removes the node with the given `node_id` from the list of nodes to avoid.
+ * The `user_channel_id` of the channel over which the HTLC was received. This is the value
+ * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
+ * [`ChannelManager::accept_inbound_channel`] for inbound channels if
+ * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
+ * `user_channel_id` will be randomized for an inbound channel.
+ *
+ * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
+ * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
+ * was not actually claimed until after upgrading.)
+ *
+ * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
  */
-void ProbabilisticScoringFeeParameters_remove_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
+void ClaimedHTLC_set_user_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKU128 val);
 
 /**
- * Sets a manual penalty for the given node.
+ * The block height at which this HTLC expires.
  */
-void ProbabilisticScoringFeeParameters_set_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
+uint32_t ClaimedHTLC_get_cltv_expiry(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
 
 /**
- * Removes the node with the given `node_id` from the list of manual penalties.
+ * The block height at which this HTLC expires.
  */
-void ProbabilisticScoringFeeParameters_remove_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
+void ClaimedHTLC_set_cltv_expiry(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Clears the list of manual penalties that are applied during path finding.
+ * The amount (in msats) of this part of an MPP.
  */
-void ProbabilisticScoringFeeParameters_clear_manual_penalties(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg);
+uint64_t ClaimedHTLC_get_value_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the ProbabilisticScoringDecayParameters, if is_owned is set and inner is non-NULL.
+ * The amount (in msats) of this part of an MPP.
  */
-void ProbabilisticScoringDecayParameters_free(struct LDKProbabilisticScoringDecayParameters this_obj);
+void ClaimedHTLC_set_value_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
- * tracking can simply live on with increasingly stale data. Instead, when a channel has not
- * seen a liquidity estimate update for this amount of time, the historical datapoints are
- * decayed by half.
- * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
- *
- * Note that after 16 or more half lives all historical data will be completely gone.
- *
- * Default value: 14 days
+ * The extra fee our counterparty skimmed off the top of this HTLC, if any.
  *
- * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
+ * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
+ * 0.0.119.
  */
-uint64_t ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
+uint64_t ClaimedHTLC_get_counterparty_skimmed_fee_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
 
 /**
- * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
- * tracking can simply live on with increasingly stale data. Instead, when a channel has not
- * seen a liquidity estimate update for this amount of time, the historical datapoints are
- * decayed by half.
- * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
- *
- * Note that after 16 or more half lives all historical data will be completely gone.
- *
- * Default value: 14 days
+ * The extra fee our counterparty skimmed off the top of this HTLC, if any.
  *
- * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
+ * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
+ * 0.0.119.
  */
-void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
+void ClaimedHTLC_set_counterparty_skimmed_fee_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
- * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
- * the available liquidity is halved and the upper-bound moves half-way to the channel's total
- * capacity.
- *
- * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
- * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
- * struct documentation for more info on the way the liquidity bounds are used.
- *
- * For example, if the channel's capacity is 1 million sats, and the current upper and lower
- * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
- * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
- *
- * Default value: 6 hours
- *
- * # Note
- *
- * When built with the `no-std` feature, time will never elapse. Therefore, the channel
- * liquidity knowledge will never decay except when the bounds cross.
+ * Constructs a new ClaimedHTLC given each field
  */
-uint64_t ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKClaimedHTLC ClaimedHTLC_new(struct LDKChannelId channel_id_arg, struct LDKU128 user_channel_id_arg, uint32_t cltv_expiry_arg, uint64_t value_msat_arg, uint64_t counterparty_skimmed_fee_msat_arg);
 
 /**
- * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
- * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
- * the available liquidity is halved and the upper-bound moves half-way to the channel's total
- * capacity.
- *
- * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
- * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
- * struct documentation for more info on the way the liquidity bounds are used.
- *
- * For example, if the channel's capacity is 1 million sats, and the current upper and lower
- * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
- * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
- *
- * Default value: 6 hours
- *
- * # Note
- *
- * When built with the `no-std` feature, time will never elapse. Therefore, the channel
- * liquidity knowledge will never decay except when the bounds cross.
+ * Creates a copy of the ClaimedHTLC
  */
-void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKClaimedHTLC ClaimedHTLC_clone(const struct LDKClaimedHTLC *NONNULL_PTR orig);
 
 /**
- * Constructs a new ProbabilisticScoringDecayParameters given each field
+ * Checks if two ClaimedHTLCs 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.
  */
-MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_new(uint64_t historical_no_updates_half_life_arg, uint64_t liquidity_offset_half_life_arg);
+bool ClaimedHTLC_eq(const struct LDKClaimedHTLC *NONNULL_PTR a, const struct LDKClaimedHTLC *NONNULL_PTR b);
 
 /**
- * Creates a copy of the ProbabilisticScoringDecayParameters
+ * Serialize the ClaimedHTLC object into a byte array which can be read by ClaimedHTLC_read
  */
-struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_clone(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR orig);
+struct LDKCVec_u8Z ClaimedHTLC_write(const struct LDKClaimedHTLC *NONNULL_PTR obj);
 
 /**
- * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used.
+ * Read a ClaimedHTLC from a byte array, created by ClaimedHTLC_write
  */
-MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_default(void);
+struct LDKCResult_ClaimedHTLCDecodeErrorZ ClaimedHTLC_read(struct LDKu8slice ser);
 
 /**
- * Creates a new scorer using the given scoring parameters for sending payments from a node
- * through a network graph.
+ * Frees any resources used by the PathFailure
  */
-MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringDecayParameters decay_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
+void PathFailure_free(struct LDKPathFailure this_ptr);
 
 /**
- * Dump the contents of this scorer into the configured logger.
- *
- * Note that this writes roughly one line per channel for which we have a liquidity estimate,
- * which may be a substantial amount of log output.
+ * Creates a copy of the PathFailure
  */
-void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
+struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
 
 /**
- * Query the estimated minimum and maximum liquidity available for sending a payment over the
- * channel with `scid` towards the given `target` node.
+ * Utility method to constructs a new InitialSend-variant PathFailure
  */
-MUST_USE_RES struct LDKCOption_C2Tuple_u64u64ZZ ProbabilisticScorer_estimated_channel_liquidity_range(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target);
+struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
 
 /**
- * Query the historical estimated minimum and maximum liquidity available for sending a
- * payment over the channel with `scid` towards the given `target` node.
- *
- * Returns two sets of 32 buckets. The first set describes the lower-bound liquidity history,
- * the second set describes the upper-bound liquidity history. Each bucket describes the
- * relative frequency at which we've seen a liquidity bound in the bucket's range relative to
- * the channel's total capacity, on an arbitrary scale. Because the values are slowly decayed,
- * more recent data points are weighted more heavily than older datapoints.
- *
- * Note that the range of each bucket varies by its location to provide more granular results
- * at the edges of a channel's capacity, where it is more likely to sit.
- *
- * When scoring, the estimated probability that an upper-/lower-bound lies in a given bucket
- * is calculated by dividing that bucket's value with the total value of all buckets.
- *
- * For example, using a lower bucket count for illustrative purposes, a value of
- * `[0, 0, 0, ..., 0, 32]` indicates that we believe the probability of a bound being very
- * close to the channel's capacity to be 100%, and have never (recently) seen it in any other
- * bucket. A value of `[31, 0, 0, ..., 0, 0, 32]` indicates we've seen the bound being both
- * in the top and bottom bucket, and roughly with similar (recent) frequency.
- *
- * Because the datapoints are decayed slowly over time, values will eventually return to
- * `Some(([0; 32], [0; 32]))` or `None` if no data remains for a channel.
- *
- * In order to fetch a single success probability from the buckets provided here, as used in
- * the scoring model, see [`Self::historical_estimated_payment_success_probability`].
+ * Utility method to constructs a new OnPath-variant PathFailure
  */
-MUST_USE_RES struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target);
+struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
 
 /**
- * Query the probability of payment success sending the given `amount_msat` over the channel
- * with `scid` towards the given `target` node, based on the historical estimated liquidity
- * bounds.
- *
- * These are the same bounds as returned by
- * [`Self::historical_estimated_channel_liquidity_probabilities`] (but not those returned by
- * [`Self::estimated_channel_liquidity_range`]).
+ * Checks if two PathFailures contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-MUST_USE_RES struct LDKCOption_f64Z ProbabilisticScorer_historical_estimated_payment_success_probability(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target, uint64_t amount_msat, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR params);
+bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
 
 /**
- * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
+ * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
  */
-struct LDKScoreLookUp ProbabilisticScorer_as_ScoreLookUp(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
 
 /**
- * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
+ * Read a PathFailure from a byte array, created by PathFailure_write
  */
-struct LDKScoreUpdate ProbabilisticScorer_as_ScoreUpdate(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
+struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
 
 /**
- * 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
+ * Frees any resources used by the ClosureReason
  */
-struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
+void ClosureReason_free(struct LDKClosureReason this_ptr);
 
 /**
- * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
+ * Creates a copy of the ClosureReason
  */
-struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
+struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
 
 /**
- * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
+ * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
  */
-struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringDecayParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
+struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg);
 
 /**
- * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
+ * Utility method to constructs a new HolderForceClosed-variant ClosureReason
  */
-void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
+struct LDKClosureReason ClosureReason_holder_force_closed(struct LDKCOption_boolZ broadcasted_latest_txn);
 
 /**
- * The outpoint which is spendable.
+ * Utility method to constructs a new LegacyCooperativeClosure-variant ClosureReason
  */
-struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+struct LDKClosureReason ClosureReason_legacy_cooperative_closure(void);
 
 /**
- * The outpoint which is spendable.
+ * Utility method to constructs a new CounterpartyInitiatedCooperativeClosure-variant ClosureReason
  */
-void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+struct LDKClosureReason ClosureReason_counterparty_initiated_cooperative_closure(void);
 
 /**
- * Per commitment point to derive the delayed payment key by key holder.
+ * Utility method to constructs a new LocallyInitiatedCooperativeClosure-variant ClosureReason
  */
-struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+struct LDKClosureReason ClosureReason_locally_initiated_cooperative_closure(void);
 
 /**
- * Per commitment point to derive the delayed payment key by key holder.
+ * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
  */
-void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
 
 /**
- * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
- * the witness_script.
+ * Utility method to constructs a new FundingTimedOut-variant ClosureReason
  */
-uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+struct LDKClosureReason ClosureReason_funding_timed_out(void);
 
 /**
- * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
- * the witness_script.
+ * Utility method to constructs a new ProcessingError-variant ClosureReason
  */
-void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
+struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
 
 /**
- * The output which is referenced by the given outpoint.
+ * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
  */
-struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+struct LDKClosureReason ClosureReason_disconnected_peer(void);
 
 /**
- * The output which is referenced by the given outpoint.
+ * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
  */
-void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
+struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
 
 /**
- * The revocation point specific to the commitment transaction which was broadcast. Used to
- * derive the witnessScript for this output.
+ * Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason
  */
-struct LDKRevocationKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+struct LDKClosureReason ClosureReason_counterparty_coop_closed_unfunded_channel(void);
 
 /**
- * The revocation point specific to the commitment transaction which was broadcast. Used to
- * derive the witnessScript for this output.
+ * Utility method to constructs a new FundingBatchClosure-variant ClosureReason
  */
-void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
+struct LDKClosureReason ClosureReason_funding_batch_closure(void);
 
 /**
- * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
- * This may be useful in re-deriving keys used in the channel to spend the output.
+ * Utility method to constructs a new HTLCsTimedOut-variant ClosureReason
  */
-const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
+struct LDKClosureReason ClosureReason_htlcs_timed_out(void);
 
 /**
- * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
- * This may be useful in re-deriving keys used in the channel to spend the output.
+ * Utility method to constructs a new PeerFeerateTooLow-variant ClosureReason
  */
-void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKClosureReason ClosureReason_peer_feerate_too_low(uint32_t peer_feerate_sat_per_kw, uint32_t required_feerate_sat_per_kw);
 
 /**
- * The value of the channel which this output originated from, possibly indirectly.
+ * Checks if two ClosureReasons contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
 
 /**
- * The value of the channel which this output originated from, possibly indirectly.
+ * Get the string representation of a ClosureReason object
  */
-void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKStr ClosureReason_to_str(const struct LDKClosureReason *NONNULL_PTR o);
 
 /**
- * The channel public keys and other parameters needed to generate a spending transaction or
- * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`].
- *
- * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
  */
-struct LDKChannelTransactionParameters DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
 
 /**
- * The channel public keys and other parameters needed to generate a spending transaction or
- * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`].
- *
- * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later.
- *
- * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Read a ClosureReason from a byte array, created by ClosureReason_write
  */
-void DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
+struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
 
 /**
- * Constructs a new DelayedPaymentOutputDescriptor given each field
- *
- * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Frees any resources used by the HTLCDestination
  */
-MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKRevocationKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg, struct LDKChannelTransactionParameters channel_transaction_parameters_arg);
+void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
 
 /**
- * Creates a copy of the DelayedPaymentOutputDescriptor
+ * Creates a copy of the HTLCDestination
  */
-struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
+struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the DelayedPaymentOutputDescriptor.
+ * Utility method to constructs a new NextHopChannel-variant HTLCDestination
  */
-uint64_t DelayedPaymentOutputDescriptor_hash(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR o);
+struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKChannelId channel_id);
 
 /**
- * Checks if two DelayedPaymentOutputDescriptors 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.
+ * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
  */
-bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
+struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
 
 /**
- * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
+ * Utility method to constructs a new InvalidForward-variant HTLCDestination
  */
-struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
+struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
 
 /**
- * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
+ * Utility method to constructs a new InvalidOnion-variant HTLCDestination
  */
-struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
+struct LDKHTLCDestination HTLCDestination_invalid_onion(void);
 
 /**
- * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
+ * Utility method to constructs a new FailedPayment-variant HTLCDestination
  */
-void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
+struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
 
 /**
- * The outpoint which is spendable.
+ * Checks if two HTLCDestinations contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
 
 /**
- * The outpoint which is spendable.
+ * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
  */
-void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
 
 /**
- * The output which is referenced by the given outpoint.
+ * Read a HTLCDestination from a byte array, created by HTLCDestination_write
  */
-struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
 
 /**
- * The output which is referenced by the given outpoint.
+ * Creates a copy of the PaymentFailureReason
  */
-void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
+enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig);
 
 /**
- * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
- * This may be useful in re-deriving keys used in the channel to spend the output.
+ * Utility method to constructs a new RecipientRejected-variant PaymentFailureReason
  */
-const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
+enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void);
 
 /**
- * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
- * This may be useful in re-deriving keys used in the channel to spend the output.
+ * Utility method to constructs a new UserAbandoned-variant PaymentFailureReason
  */
-void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void);
 
 /**
- * The value of the channel which this transactions spends.
+ * Utility method to constructs a new RetriesExhausted-variant PaymentFailureReason
  */
-uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void);
 
 /**
- * The value of the channel which this transactions spends.
+ * Utility method to constructs a new PaymentExpired-variant PaymentFailureReason
  */
-void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
+enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void);
 
 /**
- * The necessary channel parameters that need to be provided to the re-derived signer through
- * [`ChannelSigner::provide_channel_parameters`].
- *
- * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Utility method to constructs a new RouteNotFound-variant PaymentFailureReason
  */
-struct LDKChannelTransactionParameters StaticPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void);
 
 /**
- * The necessary channel parameters that need to be provided to the re-derived signer through
- * [`ChannelSigner::provide_channel_parameters`].
- *
- * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
- *
- * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Utility method to constructs a new UnexpectedError-variant PaymentFailureReason
  */
-void StaticPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
+enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void);
 
 /**
- * Constructs a new StaticPaymentOutputDescriptor given each field
- *
- * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Utility method to constructs a new UnknownRequiredFeatures-variant PaymentFailureReason
  */
-MUST_USE_RES struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg, struct LDKChannelTransactionParameters channel_transaction_parameters_arg);
+enum LDKPaymentFailureReason PaymentFailureReason_unknown_required_features(void);
 
 /**
- * Creates a copy of the StaticPaymentOutputDescriptor
+ * Utility method to constructs a new InvoiceRequestExpired-variant PaymentFailureReason
  */
-struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
+enum LDKPaymentFailureReason PaymentFailureReason_invoice_request_expired(void);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the StaticPaymentOutputDescriptor.
+ * Utility method to constructs a new InvoiceRequestRejected-variant PaymentFailureReason
  */
-uint64_t StaticPaymentOutputDescriptor_hash(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR o);
+enum LDKPaymentFailureReason PaymentFailureReason_invoice_request_rejected(void);
 
 /**
- * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
+ * Checks if two PaymentFailureReasons 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 StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
+bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b);
 
 /**
- * Returns the `witness_script` of the spendable output.
- *
- * Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that
- * originated from an anchor outputs channel, as they take the form of a P2WSH script.
+ * Serialize the PaymentFailureReason object into a byte array which can be read by PaymentFailureReason_read
  */
-MUST_USE_RES struct LDKCOption_CVec_u8ZZ StaticPaymentOutputDescriptor_witness_script(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
+struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj);
 
 /**
- * The maximum length a well-formed witness spending one of these should have.
- * Note: If you have the grind_signatures feature enabled, this will be at least 1 byte
- * shorter.
+ * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write
  */
-MUST_USE_RES uint64_t StaticPaymentOutputDescriptor_max_witness_length(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
+struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser);
 
 /**
- * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
+ * Frees any resources used by the Event
  */
-struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
+void Event_free(struct LDKEvent this_ptr);
 
 /**
- * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
+ * Creates a copy of the Event
  */
-struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
+struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the SpendableOutputDescriptor
+ * Utility method to constructs a new FundingGenerationReady-variant Event
  */
-void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
+struct LDKEvent Event_funding_generation_ready(struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, struct LDKU128 user_channel_id);
 
 /**
- * Creates a copy of the SpendableOutputDescriptor
+ * Utility method to constructs a new FundingTxBroadcastSafe-variant Event
  */
-struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
+struct LDKEvent Event_funding_tx_broadcast_safe(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKOutPoint funding_txo, struct LDKPublicKey counterparty_node_id, struct LDKChannelId former_temporary_channel_id);
 
 /**
- * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
+ * Utility method to constructs a new PaymentClaimable-variant Event
  */
-struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output, struct LDKThirtyTwoBytes channel_keys_id);
+struct LDKEvent Event_payment_claimable(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields onion_fields, uint64_t amount_msat, uint64_t counterparty_skimmed_fee_msat, struct LDKPaymentPurpose purpose, struct LDKChannelId via_channel_id, struct LDKCOption_U128Z via_user_channel_id, struct LDKCOption_u32Z claim_deadline);
 
 /**
- * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
+ * Utility method to constructs a new PaymentClaimed-variant Event
  */
-struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
+struct LDKEvent Event_payment_claimed(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose, struct LDKCVec_ClaimedHTLCZ htlcs, struct LDKCOption_u64Z sender_intended_total_msat, struct LDKRecipientOnionFields onion_fields);
 
 /**
- * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
+ * Utility method to constructs a new ConnectionNeeded-variant Event
  */
-struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
+struct LDKEvent Event_connection_needed(struct LDKPublicKey node_id, struct LDKCVec_SocketAddressZ addresses);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the SpendableOutputDescriptor.
+ * Utility method to constructs a new InvoiceReceived-variant Event
  */
-uint64_t SpendableOutputDescriptor_hash(const struct LDKSpendableOutputDescriptor *NONNULL_PTR o);
+struct LDKEvent Event_invoice_received(struct LDKThirtyTwoBytes payment_id, struct LDKBolt12Invoice invoice, struct LDKCOption_OffersContextZ context, struct LDKResponder responder);
 
 /**
- * Checks if two SpendableOutputDescriptors contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Utility method to constructs a new PaymentSent-variant Event
  */
-bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
+struct LDKEvent Event_payment_sent(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
 
 /**
- * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
+ * Utility method to constructs a new PaymentFailed-variant Event
  */
-struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
+struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKCOption_PaymentFailureReasonZ reason);
 
 /**
- * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
+ * Utility method to constructs a new PaymentPathSuccessful-variant Event
  */
-struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
+struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKPath path);
 
 /**
- * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to
- * the given outputs, plus an output to the given change destination (if sufficient
- * change value remains). The PSBT will have a feerate, at least, of the given value.
- *
- * The `locktime` argument is used to set the transaction's locktime. If `None`, the
- * transaction will have a locktime of 0. It it recommended to set this to the current block
- * height to avoid fee sniping, unless you have some specific reason to use a different
- * locktime.
- *
- * Returns the PSBT and expected max transaction weight.
- *
- * Returns `Err(())` if the output value is greater than the input value minus required fee,
- * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
- * does not match the one we can spend.
- *
- * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
+ * Utility method to constructs a new PaymentPathFailed-variant Event
  */
-MUST_USE_RES struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ SpendableOutputDescriptor_create_spendable_outputs_psbt(struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
+struct LDKEvent Event_payment_path_failed(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_hash, bool payment_failed_permanently, struct LDKPathFailure failure, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
 
 /**
- * Frees any resources used by the ChannelDerivationParameters, if is_owned is set and inner is non-NULL.
+ * Utility method to constructs a new ProbeSuccessful-variant Event
  */
-void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
+struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
 
 /**
- * The value in satoshis of the channel we're attempting to spend the anchor output of.
+ * Utility method to constructs a new ProbeFailed-variant Event
  */
-uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
+struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
 
 /**
- * The value in satoshis of the channel we're attempting to spend the anchor output of.
+ * Utility method to constructs a new PendingHTLCsForwardable-variant Event
  */
-void ChannelDerivationParameters_set_value_satoshis(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
 
 /**
- * The unique identifier to re-derive the signer for the associated channel.
+ * Utility method to constructs a new HTLCIntercepted-variant Event
  */
-const uint8_t (*ChannelDerivationParameters_get_keys_id(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr))[32];
+struct LDKEvent Event_htlcintercepted(struct LDKThirtyTwoBytes intercept_id, uint64_t requested_next_hop_scid, struct LDKThirtyTwoBytes payment_hash, uint64_t inbound_amount_msat, uint64_t expected_outbound_amount_msat);
 
 /**
- * The unique identifier to re-derive the signer for the associated channel.
+ * Utility method to constructs a new SpendableOutputs-variant Event
  */
-void ChannelDerivationParameters_set_keys_id(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKChannelId channel_id);
 
 /**
- * The necessary channel parameters that need to be provided to the re-derived signer through
- * [`ChannelSigner::provide_channel_parameters`].
+ * Utility method to constructs a new PaymentForwarded-variant Event
  */
-struct LDKChannelTransactionParameters ChannelDerivationParameters_get_transaction_parameters(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
+struct LDKEvent Event_payment_forwarded(struct LDKChannelId prev_channel_id, struct LDKChannelId next_channel_id, struct LDKCOption_U128Z prev_user_channel_id, struct LDKCOption_U128Z next_user_channel_id, struct LDKCOption_u64Z total_fee_earned_msat, struct LDKCOption_u64Z skimmed_fee_msat, bool claim_from_onchain_tx, struct LDKCOption_u64Z outbound_amount_forwarded_msat);
 
 /**
- * The necessary channel parameters that need to be provided to the re-derived signer through
- * [`ChannelSigner::provide_channel_parameters`].
+ * Utility method to constructs a new ChannelPending-variant Event
  */
-void ChannelDerivationParameters_set_transaction_parameters(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
+struct LDKEvent Event_channel_pending(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKChannelId former_temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding_txo, struct LDKChannelTypeFeatures channel_type);
 
 /**
- * Constructs a new ChannelDerivationParameters given each field
+ * Utility method to constructs a new ChannelReady-variant Event
  */
-MUST_USE_RES struct LDKChannelDerivationParameters ChannelDerivationParameters_new(uint64_t value_satoshis_arg, struct LDKThirtyTwoBytes keys_id_arg, struct LDKChannelTransactionParameters transaction_parameters_arg);
+struct LDKEvent Event_channel_ready(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
 
 /**
- * Creates a copy of the ChannelDerivationParameters
+ * Utility method to constructs a new ChannelClosed-variant Event
  */
-struct LDKChannelDerivationParameters ChannelDerivationParameters_clone(const struct LDKChannelDerivationParameters *NONNULL_PTR orig);
+struct LDKEvent Event_channel_closed(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u64Z channel_capacity_sats, struct LDKOutPoint channel_funding_txo);
 
 /**
- * Checks if two ChannelDerivationParameterss 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.
+ * Utility method to constructs a new DiscardFunding-variant Event
  */
-bool ChannelDerivationParameters_eq(const struct LDKChannelDerivationParameters *NONNULL_PTR a, const struct LDKChannelDerivationParameters *NONNULL_PTR b);
+struct LDKEvent Event_discard_funding(struct LDKChannelId channel_id, struct LDKFundingInfo funding_info);
 
 /**
- * Serialize the ChannelDerivationParameters object into a byte array which can be read by ChannelDerivationParameters_read
+ * Utility method to constructs a new OpenChannelRequest-variant Event
+ */
+struct LDKEvent Event_open_channel_request(struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type, bool is_announced, struct LDKChannelParameters params);
+
+/**
+ * Utility method to constructs a new HTLCHandlingFailed-variant Event
  */
-struct LDKCVec_u8Z ChannelDerivationParameters_write(const struct LDKChannelDerivationParameters *NONNULL_PTR obj);
+struct LDKEvent Event_htlchandling_failed(struct LDKChannelId prev_channel_id, struct LDKHTLCDestination failed_next_destination);
 
 /**
- * Read a ChannelDerivationParameters from a byte array, created by ChannelDerivationParameters_write
+ * Utility method to constructs a new BumpTransaction-variant Event
  */
-struct LDKCResult_ChannelDerivationParametersDecodeErrorZ ChannelDerivationParameters_read(struct LDKu8slice ser);
+struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a);
 
 /**
- * Frees any resources used by the HTLCDescriptor, if is_owned is set and inner is non-NULL.
+ * Utility method to constructs a new OnionMessageIntercepted-variant Event
  */
-void HTLCDescriptor_free(struct LDKHTLCDescriptor this_obj);
+struct LDKEvent Event_onion_message_intercepted(struct LDKPublicKey peer_node_id, struct LDKOnionMessage message);
 
 /**
- * The parameters required to derive the signer for the HTLC input.
+ * Utility method to constructs a new OnionMessagePeerConnected-variant Event
  */
-struct LDKChannelDerivationParameters HTLCDescriptor_get_channel_derivation_parameters(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
+struct LDKEvent Event_onion_message_peer_connected(struct LDKPublicKey peer_node_id);
 
 /**
- * The parameters required to derive the signer for the HTLC input.
+ * Checks if two Events contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
+bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
 
 /**
- * The txid of the commitment transaction in which the HTLC output lives.
+ * Serialize the Event object into a byte array which can be read by Event_read
  */
-const uint8_t (*HTLCDescriptor_get_commitment_txid(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr))[32];
+struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
 
 /**
- * The txid of the commitment transaction in which the HTLC output lives.
+ * Read a Event from a byte array, created by Event_write
  */
-void HTLCDescriptor_set_commitment_txid(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
 
 /**
- * The number of the commitment transaction in which the HTLC output lives.
+ * Frees any resources used by the MessageSendEvent
  */
-uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
+void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
 
 /**
- * The number of the commitment transaction in which the HTLC output lives.
+ * Creates a copy of the MessageSendEvent
  */
-void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
 
 /**
- * The key tweak corresponding to the number of the commitment transaction in which the HTLC
- * output lives. This tweak is applied to all the basepoints for both parties in the channel to
- * arrive at unique keys per commitment.
- *
- * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
+ * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
  */
-struct LDKPublicKey HTLCDescriptor_get_per_commitment_point(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
+struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
 
 /**
- * The key tweak corresponding to the number of the commitment transaction in which the HTLC
- * output lives. This tweak is applied to all the basepoints for both parties in the channel to
- * arrive at unique keys per commitment.
- *
- * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
+ * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
  */
-void HTLCDescriptor_set_per_commitment_point(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+struct LDKMessageSendEvent MessageSendEvent_send_accept_channel_v2(struct LDKPublicKey node_id, struct LDKAcceptChannelV2 msg);
 
 /**
- * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
- * originating from a channel supporting anchor outputs, otherwise it is the channel's
- * negotiated feerate at the time the commitment transaction was built.
+ * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
  */
-uint32_t HTLCDescriptor_get_feerate_per_kw(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
+struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
 
 /**
- * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
- * originating from a channel supporting anchor outputs, otherwise it is the channel's
- * negotiated feerate at the time the commitment transaction was built.
+ * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
  */
-void HTLCDescriptor_set_feerate_per_kw(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKMessageSendEvent MessageSendEvent_send_open_channel_v2(struct LDKPublicKey node_id, struct LDKOpenChannelV2 msg);
 
 /**
- * The details of the HTLC as it appears in the commitment transaction.
+ * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
  */
-struct LDKHTLCOutputInCommitment HTLCDescriptor_get_htlc(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
+struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
 
 /**
- * The details of the HTLC as it appears in the commitment transaction.
+ * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
  */
-void HTLCDescriptor_set_htlc(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKHTLCOutputInCommitment val);
+struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
 
 /**
- * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
- * taken.
+ * Utility method to constructs a new SendStfu-variant MessageSendEvent
  */
-struct LDKCOption_ThirtyTwoBytesZ HTLCDescriptor_get_preimage(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
+struct LDKMessageSendEvent MessageSendEvent_send_stfu(struct LDKPublicKey node_id, struct LDKStfu msg);
 
 /**
- * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
- * taken.
+ * Utility method to constructs a new SendSpliceInit-variant MessageSendEvent
  */
-void HTLCDescriptor_set_preimage(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
+struct LDKMessageSendEvent MessageSendEvent_send_splice_init(struct LDKPublicKey node_id, struct LDKSpliceInit msg);
 
 /**
- * The counterparty's signature required to spend the HTLC output.
+ * Utility method to constructs a new SendSpliceAck-variant MessageSendEvent
  */
-struct LDKECDSASignature HTLCDescriptor_get_counterparty_sig(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
+struct LDKMessageSendEvent MessageSendEvent_send_splice_ack(struct LDKPublicKey node_id, struct LDKSpliceAck msg);
 
 /**
- * The counterparty's signature required to spend the HTLC output.
+ * Utility method to constructs a new SendSpliceLocked-variant MessageSendEvent
  */
-void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+struct LDKMessageSendEvent MessageSendEvent_send_splice_locked(struct LDKPublicKey node_id, struct LDKSpliceLocked msg);
 
 /**
- * Constructs a new HTLCDescriptor given each field
+ * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
  */
-MUST_USE_RES struct LDKHTLCDescriptor HTLCDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKThirtyTwoBytes commitment_txid_arg, uint64_t per_commitment_number_arg, struct LDKPublicKey per_commitment_point_arg, uint32_t feerate_per_kw_arg, struct LDKHTLCOutputInCommitment htlc_arg, struct LDKCOption_ThirtyTwoBytesZ preimage_arg, struct LDKECDSASignature counterparty_sig_arg);
+struct LDKMessageSendEvent MessageSendEvent_send_tx_add_input(struct LDKPublicKey node_id, struct LDKTxAddInput msg);
 
 /**
- * Creates a copy of the HTLCDescriptor
+ * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
  */
-struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig);
+struct LDKMessageSendEvent MessageSendEvent_send_tx_add_output(struct LDKPublicKey node_id, struct LDKTxAddOutput msg);
 
 /**
- * Checks if two HTLCDescriptors 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.
+ * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
  */
-bool HTLCDescriptor_eq(const struct LDKHTLCDescriptor *NONNULL_PTR a, const struct LDKHTLCDescriptor *NONNULL_PTR b);
+struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_input(struct LDKPublicKey node_id, struct LDKTxRemoveInput msg);
 
 /**
- * Serialize the HTLCDescriptor object into a byte array which can be read by HTLCDescriptor_read
+ * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
  */
-struct LDKCVec_u8Z HTLCDescriptor_write(const struct LDKHTLCDescriptor *NONNULL_PTR obj);
+struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_output(struct LDKPublicKey node_id, struct LDKTxRemoveOutput msg);
 
 /**
- * Read a HTLCDescriptor from a byte array, created by HTLCDescriptor_write
+ * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
  */
-struct LDKCResult_HTLCDescriptorDecodeErrorZ HTLCDescriptor_read(struct LDKu8slice ser);
+struct LDKMessageSendEvent MessageSendEvent_send_tx_complete(struct LDKPublicKey node_id, struct LDKTxComplete msg);
 
 /**
- * Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
- * being spent by the HTLC input in the HTLC transaction.
+ * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
  */
-MUST_USE_RES struct LDKOutPoint HTLCDescriptor_outpoint(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
+struct LDKMessageSendEvent MessageSendEvent_send_tx_signatures(struct LDKPublicKey node_id, struct LDKTxSignatures msg);
 
 /**
- * Returns the UTXO to be spent by the HTLC input, which can be obtained via
- * [`Self::unsigned_tx_input`].
+ * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
  */
-MUST_USE_RES struct LDKTxOut HTLCDescriptor_previous_utxo(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
+struct LDKMessageSendEvent MessageSendEvent_send_tx_init_rbf(struct LDKPublicKey node_id, struct LDKTxInitRbf msg);
 
 /**
- * Returns the unsigned transaction input spending the HTLC output in the commitment
- * transaction.
+ * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
  */
-MUST_USE_RES struct LDKTxIn HTLCDescriptor_unsigned_tx_input(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
+struct LDKMessageSendEvent MessageSendEvent_send_tx_ack_rbf(struct LDKPublicKey node_id, struct LDKTxAckRbf msg);
 
 /**
- * Returns the delayed output created as a result of spending the HTLC output in the commitment
- * transaction.
+ * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
  */
-MUST_USE_RES struct LDKTxOut HTLCDescriptor_tx_output(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
+struct LDKMessageSendEvent MessageSendEvent_send_tx_abort(struct LDKPublicKey node_id, struct LDKTxAbort msg);
 
 /**
- * Returns the witness script of the HTLC output in the commitment transaction.
+ * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
  */
-MUST_USE_RES struct LDKCVec_u8Z HTLCDescriptor_witness_script(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
+struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
 
 /**
- * Returns the fully signed witness required to spend the HTLC output in the commitment
- * transaction.
+ * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
  */
-MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature, struct LDKu8slice witness_script);
+struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
 
 /**
- * Derives the channel signer required to sign the HTLC input.
+ * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
  */
-MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
+struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
 
 /**
- * Calls the free function if one is set
+ * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
  */
-void ChannelSigner_free(struct LDKChannelSigner this_ptr);
+struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
 
 /**
- * Creates a copy of the Recipient
+ * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
  */
-enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
+struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
 
 /**
- * Utility method to constructs a new Node-variant Recipient
+ * Utility method to constructs a new SendShutdown-variant MessageSendEvent
  */
-enum LDKRecipient Recipient_node(void);
+struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
 
 /**
- * Utility method to constructs a new PhantomNode-variant Recipient
+ * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
  */
-enum LDKRecipient Recipient_phantom_node(void);
+struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
 
 /**
- * Calls the free function if one is set
+ * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
  */
-void EntropySource_free(struct LDKEntropySource this_ptr);
+struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
 
 /**
- * Calls the free function if one is set
+ * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
  */
-void NodeSigner_free(struct LDKNodeSigner this_ptr);
+struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
 
 /**
- * Calls the free function if one is set
+ * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
  */
-void OutputSpender_free(struct LDKOutputSpender this_ptr);
+struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
 
 /**
- * Calls the free function if one is set
+ * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
  */
-void SignerProvider_free(struct LDKSignerProvider this_ptr);
+struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
 
 /**
- * Calls the free function if one is set
+ * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
  */
-void ChangeDestinationSource_free(struct LDKChangeDestinationSource this_ptr);
+struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
 
 /**
- * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
+ * Utility method to constructs a new HandleError-variant MessageSendEvent
  */
-void InMemorySigner_free(struct LDKInMemorySigner this_obj);
+struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
 
 /**
- * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
- * holder's anchor output in a commitment transaction, if one is present.
+ * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
  */
-const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
 
 /**
- * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
- * holder's anchor output in a commitment transaction, if one is present.
+ * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
  */
-void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
 
 /**
- * Holder secret key for blinded revocation pubkey.
+ * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
  */
-const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
 
 /**
- * Holder secret key for blinded revocation pubkey.
+ * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
  */
-void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
 
 /**
- * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
+ * Calls the free function if one is set
  */
-const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
 
 /**
- * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
+ * Calls the free function if one is set
  */
-void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+void EventsProvider_free(struct LDKEventsProvider this_ptr);
 
 /**
- * Holder secret key used in an HTLC transaction.
+ * Frees any resources used by the ReplayEvent, if is_owned is set and inner is non-NULL.
  */
-const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+void ReplayEvent_free(struct LDKReplayEvent this_obj);
 
 /**
- * Holder secret key used in an HTLC transaction.
+ * Constructs a new ReplayEvent given each field
  */
-void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+MUST_USE_RES struct LDKReplayEvent ReplayEvent_new(void);
 
 /**
- * Holder HTLC secret key used in commitment transaction HTLC outputs.
+ * Creates a copy of the ReplayEvent
  */
-const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+struct LDKReplayEvent ReplayEvent_clone(const struct LDKReplayEvent *NONNULL_PTR orig);
 
 /**
- * Holder HTLC secret key used in commitment transaction HTLC outputs.
+ * Calls the free function if one is set
  */
-void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+void EventHandler_free(struct LDKEventHandler this_ptr);
 
 /**
- * Commitment seed.
+ * Frees any resources used by the AnchorDescriptor, if is_owned is set and inner is non-NULL.
  */
-const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj);
 
 /**
- * Commitment seed.
+ * The parameters required to derive the signer for the anchor input.
  */
-void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKChannelDerivationParameters AnchorDescriptor_get_channel_derivation_parameters(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the InMemorySigner
+ * The parameters required to derive the signer for the anchor input.
  */
-struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
+void AnchorDescriptor_set_channel_derivation_parameters(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
 
 /**
- * Creates a new [`InMemorySigner`].
+ * The transaction input's outpoint corresponding to the commitment transaction's anchor
+ * output.
  */
-MUST_USE_RES struct LDKInMemorySigner InMemorySigner_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id, struct LDKThirtyTwoBytes rand_bytes_unique_start);
+struct LDKOutPoint AnchorDescriptor_get_outpoint(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
 
 /**
- * Returns the counterparty's pubkeys.
- *
- * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
- * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * The transaction input's outpoint corresponding to the commitment transaction's anchor
+ * output.
  */
-MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+void AnchorDescriptor_set_outpoint(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
 
 /**
- * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
- * transactions, i.e., the amount of time that we have to wait to recover our funds if we
- * broadcast a transaction.
- *
- * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
- * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
+ * Constructs a new AnchorDescriptor given each field
  */
-MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKAnchorDescriptor AnchorDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKOutPoint outpoint_arg);
 
 /**
- * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
- * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
- * if they broadcast a transaction.
- *
- * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
- * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
+ * Creates a copy of the AnchorDescriptor
  */
-MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+struct LDKAnchorDescriptor AnchorDescriptor_clone(const struct LDKAnchorDescriptor *NONNULL_PTR orig);
 
 /**
- * Returns whether the holder is the initiator.
- *
- * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
- * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
+ * Checks if two AnchorDescriptors 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.
  */
-MUST_USE_RES struct LDKCOption_boolZ InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+bool AnchorDescriptor_eq(const struct LDKAnchorDescriptor *NONNULL_PTR a, const struct LDKAnchorDescriptor *NONNULL_PTR b);
 
 /**
- * Funding outpoint
- *
- * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
- * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Returns the UTXO to be spent by the anchor input, which can be obtained via
+ * [`Self::unsigned_tx_input`].
  */
-MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKTxOut AnchorDescriptor_previous_utxo(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
 
 /**
- * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
- * building transactions.
- *
- * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
- * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Returns the unsigned transaction input spending the anchor output in the commitment
+ * transaction.
  */
-MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKTxIn AnchorDescriptor_unsigned_tx_input(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
 
 /**
- * Returns the channel type features of the channel parameters. Should be helpful for
- * determining a channel's category, i. e. legacy/anchors/taproot/etc.
- *
- * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
- * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Returns the witness script of the anchor output in the commitment transaction.
  */
-MUST_USE_RES struct LDKChannelTypeFeatures InMemorySigner_channel_type_features(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCVec_u8Z AnchorDescriptor_witness_script(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
 
 /**
- * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
- * by `descriptor`, returning the witness stack for the input.
- *
- * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
- * is not spending the outpoint described by [`descriptor.outpoint`],
- * or if an output descriptor `script_pubkey` does not match the one we can spend.
- *
- * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
+ * Returns the fully signed witness required to spend the anchor output in the commitment
+ * transaction.
  */
-MUST_USE_RES struct LDKCResult_WitnessNoneZ InMemorySigner_sign_counterparty_payment_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor);
+MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature);
 
 /**
- * Sign the single input of `spend_tx` at index `input_idx` which spends the output
- * described by `descriptor`, returning the witness stack for the input.
- *
- * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
- * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
- * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
- * `script_pubkey` does not match the one we can spend.
- *
- * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
- * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
+ * Derives the channel signer required to sign the anchor input.
  */
-MUST_USE_RES struct LDKCResult_WitnessNoneZ InMemorySigner_sign_dynamic_p2wsh_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor);
+MUST_USE_RES struct LDKEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
 
 /**
- * Constructs a new EntropySource which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
+ * Frees any resources used by the BumpTransactionEvent
  */
-struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr);
 
 /**
- * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
+ * Creates a copy of the BumpTransactionEvent
  */
-struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig);
 
 /**
- * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
+ * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent
  */
-struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+struct LDKBumpTransactionEvent BumpTransactionEvent_channel_close(struct LDKChannelId channel_id, struct LDKPublicKey counterparty_node_id, struct LDKThirtyTwoBytes claim_id, uint32_t package_target_feerate_sat_per_1000_weight, struct LDKTransaction commitment_tx, uint64_t commitment_tx_fee_satoshis, struct LDKAnchorDescriptor anchor_descriptor, struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs);
 
 /**
- * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is
+ * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent
  */
-struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+struct LDKBumpTransactionEvent BumpTransactionEvent_htlcresolution(struct LDKChannelId channel_id, struct LDKPublicKey counterparty_node_id, struct LDKThirtyTwoBytes claim_id, uint32_t target_feerate_sat_per_1000_weight, struct LDKCVec_HTLCDescriptorZ htlc_descriptors, uint32_t tx_lock_time);
 
 /**
- * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
+ * Checks if two BumpTransactionEvents contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
  */
-struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
+bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b);
 
 /**
- * Read a InMemorySigner from a byte array, created by InMemorySigner_write
+ * Frees any resources used by the Input, if is_owned is set and inner is non-NULL.
  */
-struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg);
+void Input_free(struct LDKInput this_obj);
 
 /**
- * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
+ * The unique identifier of the input.
  */
-void KeysManager_free(struct LDKKeysManager this_obj);
+struct LDKOutPoint Input_get_outpoint(const struct LDKInput *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
- * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
- * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
- * without a doubt, be unique to this instance. ie if you start multiple times with the same
- * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
- * is to simply use the current time (with very high precision).
- *
- * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
- * obviously, `starting_time` should be unique every time you reload the library - it is only
- * used to generate new ephemeral key data (which will be stored by the individual channel if
- * necessary).
- *
- * Note that the seed is required to recover certain on-chain funds independent of
- * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
- * for any channel, and some on-chain during-closing funds.
- *
- * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
+ * The unique identifier of the input.
  */
-MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
+void Input_set_outpoint(struct LDKInput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
 
 /**
- * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
+ * The UTXO being spent by the input.
  */
-MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
+struct LDKTxOut Input_get_previous_utxo(const struct LDKInput *NONNULL_PTR this_ptr);
 
 /**
- * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
+ * The UTXO being spent by the input.
  */
-MUST_USE_RES struct LDKInMemorySigner KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]);
+void Input_set_previous_utxo(struct LDKInput *NONNULL_PTR this_ptr, struct LDKTxOut val);
 
 /**
- * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s.
- * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there
- * are no other inputs that need signing.
- *
- * Returns `Err(())` if the PSBT is missing a descriptor or if we fail to sign.
- *
- * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
- * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
+ * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
+ * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
+ * script.
  */
-MUST_USE_RES struct LDKCResult_CVec_u8ZNoneZ KeysManager_sign_spendable_outputs_psbt(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_u8Z psbt);
+uint64_t Input_get_satisfaction_weight(const struct LDKInput *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new EntropySource which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
+ * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
+ * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
+ * script.
  */
-struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
+void Input_set_satisfaction_weight(struct LDKInput *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Constructs a new NodeSigner which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
+ * Constructs a new Input given each field
  */
-struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKInput Input_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut previous_utxo_arg, uint64_t satisfaction_weight_arg);
 
 /**
- * Constructs a new OutputSpender which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is
+ * Creates a copy of the Input
  */
-struct LDKOutputSpender KeysManager_as_OutputSpender(const struct LDKKeysManager *NONNULL_PTR this_arg);
+struct LDKInput Input_clone(const struct LDKInput *NONNULL_PTR orig);
 
 /**
- * Constructs a new SignerProvider which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
+ * Generates a non-cryptographic 64-bit hash of the Input.
  */
-struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
+uint64_t Input_hash(const struct LDKInput *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
+ * Checks if two Inputs 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 PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
+bool Input_eq(const struct LDKInput *NONNULL_PTR a, const struct LDKInput *NONNULL_PTR b);
 
 /**
- * Constructs a new EntropySource which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
+ * Frees any resources used by the Utxo, if is_owned is set and inner is non-NULL.
  */
-struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
+void Utxo_free(struct LDKUtxo this_obj);
 
 /**
- * Constructs a new NodeSigner which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
+ * The unique identifier of the output.
  */
-struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
+struct LDKOutPoint Utxo_get_outpoint(const struct LDKUtxo *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new OutputSpender which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is
+ * The unique identifier of the output.
  */
-struct LDKOutputSpender PhantomKeysManager_as_OutputSpender(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
+void Utxo_set_outpoint(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKOutPoint val);
 
 /**
- * Constructs a new SignerProvider which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
+ * The output to spend.
  */
-struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
+struct LDKTxOut Utxo_get_output(const struct LDKUtxo *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
- * that is shared across all nodes that intend to participate in [phantom node payments]
- * together.
- *
- * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
- * `starting_time_nanos`.
- *
- * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
- * same across restarts, or else inbound payments may fail.
- *
- * [phantom node payments]: PhantomKeysManager
+ * The output to spend.
  */
-MUST_USE_RES struct LDKPhantomKeysManager PhantomKeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos, const uint8_t (*cross_node_seed)[32]);
+void Utxo_set_output(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKTxOut val);
 
 /**
- * See [`KeysManager::derive_channel_keys`] for documentation on this method.
+ * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
+ * with their lengths included, required to satisfy the output's script. The weight consumed by
+ * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
  */
-MUST_USE_RES struct LDKInMemorySigner PhantomKeysManager_derive_channel_keys(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]);
+uint64_t Utxo_get_satisfaction_weight(const struct LDKUtxo *NONNULL_PTR this_ptr);
 
 /**
- * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
+ * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
+ * with their lengths included, required to satisfy the output's script. The weight consumed by
+ * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
  */
-MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
+void Utxo_set_satisfaction_weight(struct LDKUtxo *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
- * last-hop onion data, etc.
+ * Constructs a new Utxo given each field
  */
-MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKUtxo Utxo_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, uint64_t satisfaction_weight_arg);
 
 /**
- * Frees any resources used by the RandomBytes, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the Utxo
  */
-void RandomBytes_free(struct LDKRandomBytes this_obj);
+struct LDKUtxo Utxo_clone(const struct LDKUtxo *NONNULL_PTR orig);
 
 /**
- * Creates a new instance using the given seed.
+ * Generates a non-cryptographic 64-bit hash of the Utxo.
  */
-MUST_USE_RES struct LDKRandomBytes RandomBytes_new(struct LDKThirtyTwoBytes seed);
+uint64_t Utxo_hash(const struct LDKUtxo *NONNULL_PTR o);
 
 /**
- * Constructs a new EntropySource which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
+ * Checks if two Utxos 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 LDKEntropySource RandomBytes_as_EntropySource(const struct LDKRandomBytes *NONNULL_PTR this_arg);
+bool Utxo_eq(const struct LDKUtxo *NONNULL_PTR a, const struct LDKUtxo *NONNULL_PTR b);
 
 /**
- * Calls the free function if one is set
+ * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.
  */
-void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
+MUST_USE_RES struct LDKUtxo Utxo_new_p2pkh(struct LDKOutPoint outpoint, uint64_t value, const uint8_t (*pubkey_hash)[20]);
 
 /**
- * Creates a copy of a WriteableEcdsaChannelSigner
+ * Frees any resources used by the CoinSelection, if is_owned is set and inner is non-NULL.
  */
-struct LDKWriteableEcdsaChannelSigner WriteableEcdsaChannelSigner_clone(const struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR orig);
+void CoinSelection_free(struct LDKCoinSelection this_obj);
 
 /**
- * Calls the free function if one is set
+ * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
+ * requiring additional fees.
  */
-void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr);
+struct LDKCVec_UtxoZ CoinSelection_get_confirmed_utxos(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
+ * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
+ * requiring additional fees.
  */
-void OnionMessenger_free(struct LDKOnionMessenger this_obj);
+void CoinSelection_set_confirmed_utxos(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCVec_UtxoZ val);
 
 /**
- * Calls the free function if one is set
+ * An additional output tracking whether any change remained after coin selection. This output
+ * should always have a value above dust for its given `script_pubkey`. It should not be
+ * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
+ * not met. This implies no other party should be able to spend it except us.
  */
-void MessageRouter_free(struct LDKMessageRouter this_ptr);
+struct LDKCOption_TxOutZ CoinSelection_get_change_output(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the DefaultMessageRouter, if is_owned is set and inner is non-NULL.
+ * An additional output tracking whether any change remained after coin selection. This output
+ * should always have a value above dust for its given `script_pubkey`. It should not be
+ * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
+ * not met. This implies no other party should be able to spend it except us.
  */
-void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj);
+void CoinSelection_set_change_output(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCOption_TxOutZ val);
 
 /**
- * Creates a [`DefaultMessageRouter`] using the given [`NetworkGraph`].
+ * Constructs a new CoinSelection given each field
  */
-MUST_USE_RES struct LDKDefaultMessageRouter DefaultMessageRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKEntropySource entropy_source);
+MUST_USE_RES struct LDKCoinSelection CoinSelection_new(struct LDKCVec_UtxoZ confirmed_utxos_arg, struct LDKCOption_TxOutZ change_output_arg);
 
 /**
- * Constructs a new MessageRouter which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
+ * Creates a copy of the CoinSelection
  */
-struct LDKMessageRouter DefaultMessageRouter_as_MessageRouter(const struct LDKDefaultMessageRouter *NONNULL_PTR this_arg);
+struct LDKCoinSelection CoinSelection_clone(const struct LDKCoinSelection *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the OnionMessagePath, if is_owned is set and inner is non-NULL.
+ * Calls the free function if one is set
  */
-void OnionMessagePath_free(struct LDKOnionMessagePath this_obj);
+void CoinSelectionSource_free(struct LDKCoinSelectionSource this_ptr);
 
 /**
- * Nodes on the path between the sender and the destination.
- *
- * Returns a copy of the field.
+ * Calls the free function if one is set
  */
-struct LDKCVec_PublicKeyZ OnionMessagePath_get_intermediate_nodes(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
+void WalletSource_free(struct LDKWalletSource this_ptr);
 
 /**
- * Nodes on the path between the sender and the destination.
+ * Frees any resources used by the Wallet, if is_owned is set and inner is non-NULL.
  */
-void OnionMessagePath_set_intermediate_nodes(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCVec_PublicKeyZ val);
+void Wallet_free(struct LDKWallet this_obj);
 
 /**
- * The recipient of the message.
+ * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation
+ * of [`CoinSelectionSource`].
  */
-struct LDKDestination OnionMessagePath_get_destination(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKWallet Wallet_new(struct LDKWalletSource source, struct LDKLogger logger);
 
 /**
- * The recipient of the message.
+ * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is
  */
-void OnionMessagePath_set_destination(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKDestination val);
+struct LDKCoinSelectionSource Wallet_as_CoinSelectionSource(const struct LDKWallet *NONNULL_PTR this_arg);
 
 /**
- * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
- *
- * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
- * this to initiate such a connection.
- *
- * Returns a copy of the field.
+ * Frees any resources used by the BumpTransactionEventHandler, if is_owned is set and inner is non-NULL.
  */
-struct LDKCOption_CVec_SocketAddressZZ OnionMessagePath_get_first_node_addresses(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
+void BumpTransactionEventHandler_free(struct LDKBumpTransactionEventHandler this_obj);
 
 /**
- * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
+ * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
  *
- * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
- * this to initiate such a connection.
+ * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
  */
-void OnionMessagePath_set_first_node_addresses(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCOption_CVec_SocketAddressZZ val);
+MUST_USE_RES struct LDKBumpTransactionEventHandler BumpTransactionEventHandler_new(struct LDKBroadcasterInterface broadcaster, struct LDKCoinSelectionSource utxo_source, struct LDKSignerProvider signer_provider, struct LDKLogger logger);
 
 /**
- * Constructs a new OnionMessagePath given each field
+ * Handles all variants of [`BumpTransactionEvent`].
  */
-MUST_USE_RES struct LDKOnionMessagePath OnionMessagePath_new(struct LDKCVec_PublicKeyZ intermediate_nodes_arg, struct LDKDestination destination_arg, struct LDKCOption_CVec_SocketAddressZZ first_node_addresses_arg);
+void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event);
 
 /**
- * Creates a copy of the OnionMessagePath
+ * Checks if two InitFeaturess 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 LDKOnionMessagePath OnionMessagePath_clone(const struct LDKOnionMessagePath *NONNULL_PTR orig);
+bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
 
 /**
- * Returns the first node in the path.
- *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Checks if two NodeFeaturess 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.
  */
-MUST_USE_RES struct LDKPublicKey OnionMessagePath_first_node(const struct LDKOnionMessagePath *NONNULL_PTR this_arg);
+bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the Destination
+ * Checks if two ChannelFeaturess 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 Destination_free(struct LDKDestination this_ptr);
+bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
 
 /**
- * Creates a copy of the Destination
+ * Checks if two Bolt11InvoiceFeaturess 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 LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
+bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b);
 
 /**
- * Utility method to constructs a new Node-variant Destination
+ * Checks if two OfferFeaturess 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 LDKDestination Destination_node(struct LDKPublicKey a);
+bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
 
 /**
- * Utility method to constructs a new BlindedPath-variant Destination
+ * Checks if two InvoiceRequestFeaturess 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 LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
+bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Destination.
+ * Checks if two Bolt12InvoiceFeaturess 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.
  */
-uint64_t Destination_hash(const struct LDKDestination *NONNULL_PTR o);
+bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
 
 /**
- * Checks if two Destinations contain equal inner contents.
+ * Checks if two BlindedHopFeaturess 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 Destination_eq(const struct LDKDestination *NONNULL_PTR a, const struct LDKDestination *NONNULL_PTR b);
+bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
 
 /**
- * Attempts to resolve the [`IntroductionNode::DirectedShortChannelId`] of a
- * [`Destination::BlindedPath`] to a [`IntroductionNode::NodeId`], if applicable, using the
- * provided [`ReadOnlyNetworkGraph`].
+ * Checks if two ChannelTypeFeaturess 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 Destination_resolve(struct LDKDestination *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
+bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the SendSuccess
+ * Creates a copy of the InitFeatures
  */
-void SendSuccess_free(struct LDKSendSuccess this_ptr);
+struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
 
 /**
- * Creates a copy of the SendSuccess
+ * Creates a copy of the NodeFeatures
  */
-struct LDKSendSuccess SendSuccess_clone(const struct LDKSendSuccess *NONNULL_PTR orig);
+struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
 
 /**
- * Utility method to constructs a new Buffered-variant SendSuccess
+ * Creates a copy of the ChannelFeatures
  */
-struct LDKSendSuccess SendSuccess_buffered(void);
+struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
 
 /**
- * Utility method to constructs a new BufferedAwaitingConnection-variant SendSuccess
+ * Creates a copy of the Bolt11InvoiceFeatures
  */
-struct LDKSendSuccess SendSuccess_buffered_awaiting_connection(struct LDKPublicKey a);
+struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the SendSuccess.
+ * Creates a copy of the OfferFeatures
  */
-uint64_t SendSuccess_hash(const struct LDKSendSuccess *NONNULL_PTR o);
+struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
 
 /**
- * Checks if two SendSuccesss contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Creates a copy of the InvoiceRequestFeatures
  */
-bool SendSuccess_eq(const struct LDKSendSuccess *NONNULL_PTR a, const struct LDKSendSuccess *NONNULL_PTR b);
+struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the SendError
+ * Creates a copy of the Bolt12InvoiceFeatures
  */
-void SendError_free(struct LDKSendError this_ptr);
+struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
 
 /**
- * Creates a copy of the SendError
+ * Creates a copy of the BlindedHopFeatures
  */
-struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
+struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
 
 /**
- * Utility method to constructs a new Secp256k1-variant SendError
+ * Creates a copy of the ChannelTypeFeatures
  */
-struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
+struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
 
 /**
- * Utility method to constructs a new TooBigPacket-variant SendError
+ * Generates a non-cryptographic 64-bit hash of the InitFeatures.
  */
-struct LDKSendError SendError_too_big_packet(void);
+uint64_t InitFeatures_hash(const struct LDKInitFeatures *NONNULL_PTR o);
 
 /**
- * Utility method to constructs a new TooFewBlindedHops-variant SendError
+ * Generates a non-cryptographic 64-bit hash of the NodeFeatures.
  */
-struct LDKSendError SendError_too_few_blinded_hops(void);
+uint64_t NodeFeatures_hash(const struct LDKNodeFeatures *NONNULL_PTR o);
 
 /**
- * Utility method to constructs a new InvalidFirstHop-variant SendError
+ * Generates a non-cryptographic 64-bit hash of the ChannelFeatures.
  */
-struct LDKSendError SendError_invalid_first_hop(struct LDKPublicKey a);
+uint64_t ChannelFeatures_hash(const struct LDKChannelFeatures *NONNULL_PTR o);
 
 /**
- * Utility method to constructs a new PathNotFound-variant SendError
+ * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceFeatures.
  */
-struct LDKSendError SendError_path_not_found(void);
+uint64_t Bolt11InvoiceFeatures_hash(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR o);
 
 /**
- * Utility method to constructs a new InvalidMessage-variant SendError
+ * Generates a non-cryptographic 64-bit hash of the OfferFeatures.
  */
-struct LDKSendError SendError_invalid_message(void);
+uint64_t OfferFeatures_hash(const struct LDKOfferFeatures *NONNULL_PTR o);
 
 /**
- * Utility method to constructs a new BufferFull-variant SendError
+ * Generates a non-cryptographic 64-bit hash of the InvoiceRequestFeatures.
  */
-struct LDKSendError SendError_buffer_full(void);
+uint64_t InvoiceRequestFeatures_hash(const struct LDKInvoiceRequestFeatures *NONNULL_PTR o);
 
 /**
- * Utility method to constructs a new GetNodeIdFailed-variant SendError
+ * Generates a non-cryptographic 64-bit hash of the Bolt12InvoiceFeatures.
  */
-struct LDKSendError SendError_get_node_id_failed(void);
+uint64_t Bolt12InvoiceFeatures_hash(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR o);
 
 /**
- * Utility method to constructs a new UnresolvedIntroductionNode-variant SendError
+ * Generates a non-cryptographic 64-bit hash of the BlindedHopFeatures.
  */
-struct LDKSendError SendError_unresolved_introduction_node(void);
+uint64_t BlindedHopFeatures_hash(const struct LDKBlindedHopFeatures *NONNULL_PTR o);
 
 /**
- * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
+ * Generates a non-cryptographic 64-bit hash of the ChannelTypeFeatures.
  */
-struct LDKSendError SendError_blinded_path_advance_failed(void);
+uint64_t ChannelTypeFeatures_hash(const struct LDKChannelTypeFeatures *NONNULL_PTR o);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the SendError.
+ * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
  */
-uint64_t SendError_hash(const struct LDKSendError *NONNULL_PTR o);
+void InitFeatures_free(struct LDKInitFeatures this_obj);
 
 /**
- * Checks if two SendErrors contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
  */
-bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
+void NodeFeatures_free(struct LDKNodeFeatures this_obj);
 
 /**
- * Calls the free function if one is set
+ * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
  */
-void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
+void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
 
 /**
- * Frees any resources used by the PeeledOnion
+ * Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
  */
-void PeeledOnion_free(struct LDKPeeledOnion this_ptr);
+void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj);
 
 /**
- * Creates a copy of the PeeledOnion
+ * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
  */
-struct LDKPeeledOnion PeeledOnion_clone(const struct LDKPeeledOnion *NONNULL_PTR orig);
+void OfferFeatures_free(struct LDKOfferFeatures this_obj);
 
 /**
- * Utility method to constructs a new Forward-variant PeeledOnion
+ * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
  */
-struct LDKPeeledOnion PeeledOnion_forward(struct LDKNextMessageHop a, struct LDKOnionMessage b);
+void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
 
 /**
- * Utility method to constructs a new Receive-variant PeeledOnion
+ * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
  */
-struct LDKPeeledOnion PeeledOnion_receive(struct LDKParsedOnionMessageContents a, struct LDKThirtyTwoBytes b, struct LDKBlindedPath c);
+void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
 
 /**
- * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
- * `path`, first calling [`Destination::resolve`] on `path.destination` with the given
- * [`ReadOnlyNetworkGraph`].
- *
- * Returns the node id of the peer to send the message to, the message itself, and any addresses
- * needed to connect to the first node.
- *
- * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
  */
-struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message_resolving_destination(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedPath reply_path);
+void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
 
 /**
- * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
- * `path`.
- *
- * Returns the node id of the peer to send the message to, the message itself, and any addresses
- * needed to connect to the first node.
- *
- * Returns [`SendError::UnresolvedIntroductionNode`] if:
- * - `destination` contains a blinded path with an [`IntroductionNode::DirectedShortChannelId`],
- * - unless it can be resolved by [`NodeIdLookUp::next_node_id`].
- * Use [`create_onion_message_resolving_destination`] instead to resolve the introduction node
- * first with a [`ReadOnlyNetworkGraph`].
- *
- * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
  */
-struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedPath reply_path);
+void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
 
 /**
- * Decode one layer of an incoming [`OnionMessage`].
+ * Getting a route for a keysend payment to a private node requires providing the payee's
+ * features (since they were not announced in a node announcement). However, keysend payments
+ * don't have an invoice to pull the payee's features from, so this method is provided for use
+ * when a [`Bolt11InvoiceFeatures`] is required in a route.
  *
- * Returns either the next layer of the onion for forwarding or the decrypted content for the
- * receiver.
+ * MPP keysend is not widely supported yet, so we parameterize support to allow the user to
+ * choose whether their router should find multi-part routes.
  */
-struct LDKCResult_PeeledOnionNoneZ peel_onion_message(const struct LDKOnionMessage *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
+MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_for_keysend(bool allow_mpp);
 
 /**
- * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
- * their respective handlers.
+ * Constructs a ChannelTypeFeatures with only static_remotekey set
  */
-MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKNodeIdLookUp node_id_lookup, struct LDKMessageRouter message_router, struct LDKOffersMessageHandler offers_handler, struct LDKCustomOnionMessageHandler custom_handler);
+MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_only_static_remote_key(void);
 
 /**
- * Sends an [`OnionMessage`] with the given `contents` to `destination`.
- *
- * See [`OnionMessenger`] for example usage.
- *
- * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Constructs a ChannelTypeFeatures with anchors support
  */
-MUST_USE_RES struct LDKCResult_SendSuccessSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessageContents contents, struct LDKDestination destination, struct LDKBlindedPath reply_path);
+MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_anchors_zero_htlc_fee_and_dependencies(void);
 
 /**
- * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
+ * Create a blank Features with no features set
  */
-struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
 
 /**
- * Calls the free function if one is set
+ * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order
+ * from most on-the-wire encodings.
  */
-void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr);
+MUST_USE_RES struct LDKu8slice InitFeatures_le_flags(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the OffersMessage
+ * Returns true if this `Features` has any optional flags set
  */
-void OffersMessage_free(struct LDKOffersMessage this_ptr);
+MUST_USE_RES bool InitFeatures_supports_any_optional_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the OffersMessage
+ * Returns true if this `Features` object contains required features unknown by `other`.
  */
-struct LDKOffersMessage OffersMessage_clone(const struct LDKOffersMessage *NONNULL_PTR orig);
+MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other);
 
 /**
- * Utility method to constructs a new InvoiceRequest-variant OffersMessage
+ * Returns the set of required features unknown by `other`, as their bit position.
  */
-struct LDKOffersMessage OffersMessage_invoice_request(struct LDKInvoiceRequest a);
+MUST_USE_RES struct LDKCVec_u64Z InitFeatures_required_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other);
 
 /**
- * Utility method to constructs a new Invoice-variant OffersMessage
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
  */
-struct LDKOffersMessage OffersMessage_invoice(struct LDKBolt12Invoice a);
+MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new InvoiceError-variant OffersMessage
+ * Returns true if this `Features` supports any bits which we do not know of
  */
-struct LDKOffersMessage OffersMessage_invoice_error(struct LDKInvoiceError a);
+MUST_USE_RES bool InitFeatures_supports_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Returns whether `tlv_type` corresponds to a TLV record for Offers.
+ * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
+ *
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
+ *
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-MUST_USE_RES bool OffersMessage_is_known_type(uint64_t tlv_type);
+MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
+ * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-struct LDKOnionMessageContents OffersMessage_as_OnionMessageContents(const struct LDKOffersMessage *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read
+ * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-struct LDKCVec_u8Z OffersMessage_write(const struct LDKOffersMessage *NONNULL_PTR obj);
+MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Read a OffersMessage from a byte array, created by OffersMessage_write
+ * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-struct LDKCResult_OffersMessageDecodeErrorZ OffersMessage_read(struct LDKu8slice ser, uint64_t arg_a, const struct LDKLogger *NONNULL_PTR arg_b);
+MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Frees any resources used by the Packet, if is_owned is set and inner is non-NULL.
+ * Create a blank Features with no features set
  */
-void Packet_free(struct LDKPacket this_obj);
+MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
 
 /**
- * Bolt 04 version number
+ * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order
+ * from most on-the-wire encodings.
  */
-uint8_t Packet_get_version(const struct LDKPacket *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKu8slice NodeFeatures_le_flags(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Bolt 04 version number
+ * Returns true if this `Features` has any optional flags set
  */
-void Packet_set_version(struct LDKPacket *NONNULL_PTR this_ptr, uint8_t val);
+MUST_USE_RES bool NodeFeatures_supports_any_optional_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
+ * Returns true if this `Features` object contains required features unknown by `other`.
  */
-struct LDKPublicKey Packet_get_public_key(const struct LDKPacket *NONNULL_PTR this_ptr);
+MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other);
 
 /**
- * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
+ * Returns the set of required features unknown by `other`, as their bit position.
  */
-void Packet_set_public_key(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+MUST_USE_RES struct LDKCVec_u64Z NodeFeatures_required_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other);
 
 /**
- * Encrypted payload for the next hop
- *
- * Returns a copy of the field.
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
  */
-struct LDKCVec_u8Z Packet_get_hop_data(const struct LDKPacket *NONNULL_PTR this_ptr);
+MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Encrypted payload for the next hop
+ * Returns true if this `Features` supports any bits which we do not know of
  */
-void Packet_set_hop_data(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+MUST_USE_RES bool NodeFeatures_supports_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * HMAC to verify the integrity of hop_data
+ * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
+ *
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
+ *
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-const uint8_t (*Packet_get_hmac(const struct LDKPacket *NONNULL_PTR this_ptr))[32];
+MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * HMAC to verify the integrity of hop_data
+ * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-void Packet_set_hmac(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Constructs a new Packet given each field
+ * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-MUST_USE_RES struct LDKPacket Packet_new(uint8_t version_arg, struct LDKPublicKey public_key_arg, struct LDKCVec_u8Z hop_data_arg, struct LDKThirtyTwoBytes hmac_arg);
+MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Creates a copy of the Packet
+ * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-struct LDKPacket Packet_clone(const struct LDKPacket *NONNULL_PTR orig);
+MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Packet.
+ * Create a blank Features with no features set
  */
-uint64_t Packet_hash(const struct LDKPacket *NONNULL_PTR o);
+MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
 
 /**
- * Checks if two Packets 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.
+ * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order
+ * from most on-the-wire encodings.
  */
-bool Packet_eq(const struct LDKPacket *NONNULL_PTR a, const struct LDKPacket *NONNULL_PTR b);
+MUST_USE_RES struct LDKu8slice ChannelFeatures_le_flags(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the Packet object into a byte array which can be read by Packet_read
+ * Returns true if this `Features` has any optional flags set
  */
-struct LDKCVec_u8Z Packet_write(const struct LDKPacket *NONNULL_PTR obj);
+MUST_USE_RES bool ChannelFeatures_supports_any_optional_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the ParsedOnionMessageContents
+ * Returns true if this `Features` object contains required features unknown by `other`.
  */
-void ParsedOnionMessageContents_free(struct LDKParsedOnionMessageContents this_ptr);
+MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other);
 
 /**
- * Creates a copy of the ParsedOnionMessageContents
+ * Returns the set of required features unknown by `other`, as their bit position.
  */
-struct LDKParsedOnionMessageContents ParsedOnionMessageContents_clone(const struct LDKParsedOnionMessageContents *NONNULL_PTR orig);
+MUST_USE_RES struct LDKCVec_u64Z ChannelFeatures_required_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other);
 
 /**
- * Utility method to constructs a new Offers-variant ParsedOnionMessageContents
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
  */
-struct LDKParsedOnionMessageContents ParsedOnionMessageContents_offers(struct LDKOffersMessage a);
+MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new Custom-variant ParsedOnionMessageContents
+ * Returns true if this `Features` supports any bits which we do not know of
  */
-struct LDKParsedOnionMessageContents ParsedOnionMessageContents_custom(struct LDKOnionMessageContents a);
+MUST_USE_RES bool ChannelFeatures_supports_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
+ * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
+ *
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
+ *
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-struct LDKOnionMessageContents ParsedOnionMessageContents_as_OnionMessageContents(const struct LDKParsedOnionMessageContents *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Serialize the ParsedOnionMessageContents object into a byte array which can be read by ParsedOnionMessageContents_read
+ * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-struct LDKCVec_u8Z ParsedOnionMessageContents_write(const struct LDKParsedOnionMessageContents *NONNULL_PTR obj);
+MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Creates a copy of a OnionMessageContents
+ * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-struct LDKOnionMessageContents OnionMessageContents_clone(const struct LDKOnionMessageContents *NONNULL_PTR orig);
+MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Calls the free function if one is set
+ * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
+MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Frees any resources used by the NextMessageHop
+ * Create a blank Features with no features set
  */
-void NextMessageHop_free(struct LDKNextMessageHop this_ptr);
+MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void);
 
 /**
- * Creates a copy of the NextMessageHop
+ * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order
+ * from most on-the-wire encodings.
  */
-struct LDKNextMessageHop NextMessageHop_clone(const struct LDKNextMessageHop *NONNULL_PTR orig);
+MUST_USE_RES struct LDKu8slice Bolt11InvoiceFeatures_le_flags(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new NodeId-variant NextMessageHop
+ * Returns true if this `Features` has any optional flags set
  */
-struct LDKNextMessageHop NextMessageHop_node_id(struct LDKPublicKey a);
+MUST_USE_RES bool Bolt11InvoiceFeatures_supports_any_optional_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new ShortChannelId-variant NextMessageHop
+ * Returns true if this `Features` object contains required features unknown by `other`.
  */
-struct LDKNextMessageHop NextMessageHop_short_channel_id(uint64_t a);
+MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the NextMessageHop.
+ * Returns the set of required features unknown by `other`, as their bit position.
  */
-uint64_t NextMessageHop_hash(const struct LDKNextMessageHop *NONNULL_PTR o);
+MUST_USE_RES struct LDKCVec_u64Z Bolt11InvoiceFeatures_required_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other);
 
 /**
- * Checks if two NextMessageHops contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
  */
-bool NextMessageHop_eq(const struct LDKNextMessageHop *NONNULL_PTR a, const struct LDKNextMessageHop *NONNULL_PTR b);
+MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
+ * Returns true if this `Features` supports any bits which we do not know of
  */
-void BlindedPath_free(struct LDKBlindedPath this_obj);
+MUST_USE_RES bool Bolt11InvoiceFeatures_supports_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * To send to a blinded path, the sender first finds a route to the unblinded
- * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion
- * message or payment's next hop and forward it along.
+ * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
  *
- * [`encrypted_payload`]: BlindedHop::encrypted_payload
- */
-struct LDKIntroductionNode BlindedPath_get_introduction_node(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
-
-/**
- * To send to a blinded path, the sender first finds a route to the unblinded
- * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion
- * message or payment's next hop and forward it along.
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
  *
- * [`encrypted_payload`]: BlindedHop::encrypted_payload
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-void BlindedPath_set_introduction_node(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKIntroductionNode val);
+MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
- * message or payment.
+ * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
  *
- * [`encrypted_payload`]: BlindedHop::encrypted_payload
- */
-struct LDKPublicKey BlindedPath_get_blinding_point(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
-
-/**
- * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
- * message or payment.
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
  *
- * [`encrypted_payload`]: BlindedHop::encrypted_payload
- */
-void BlindedPath_set_blinding_point(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
-
-/**
- * The hops composing the blinded path.
- */
-struct LDKCVec_BlindedHopZ BlindedPath_get_blinded_hops(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
-
-/**
- * The hops composing the blinded path.
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-void BlindedPath_set_blinded_hops(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
+MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Constructs a new BlindedPath given each field
+ * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-MUST_USE_RES struct LDKBlindedPath BlindedPath_new(struct LDKIntroductionNode introduction_node_arg, struct LDKPublicKey blinding_point_arg, struct LDKCVec_BlindedHopZ blinded_hops_arg);
+MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Creates a copy of the BlindedPath
+ * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
+MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the BlindedPath.
+ * Create a blank Features with no features set
  */
-uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o);
+MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
 
 /**
- * Checks if two BlindedPaths 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.
+ * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order
+ * from most on-the-wire encodings.
  */
-bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b);
+MUST_USE_RES struct LDKu8slice OfferFeatures_le_flags(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the IntroductionNode
+ * Returns true if this `Features` has any optional flags set
  */
-void IntroductionNode_free(struct LDKIntroductionNode this_ptr);
+MUST_USE_RES bool OfferFeatures_supports_any_optional_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the IntroductionNode
+ * Returns true if this `Features` object contains required features unknown by `other`.
  */
-struct LDKIntroductionNode IntroductionNode_clone(const struct LDKIntroductionNode *NONNULL_PTR orig);
+MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other);
 
 /**
- * Utility method to constructs a new NodeId-variant IntroductionNode
+ * Returns the set of required features unknown by `other`, as their bit position.
  */
-struct LDKIntroductionNode IntroductionNode_node_id(struct LDKPublicKey a);
+MUST_USE_RES struct LDKCVec_u64Z OfferFeatures_required_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other);
 
 /**
- * Utility method to constructs a new DirectedShortChannelId-variant IntroductionNode
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
  */
-struct LDKIntroductionNode IntroductionNode_directed_short_channel_id(enum LDKDirection a, uint64_t b);
+MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the IntroductionNode.
+ * Returns true if this `Features` supports any bits which we do not know of
  */
-uint64_t IntroductionNode_hash(const struct LDKIntroductionNode *NONNULL_PTR o);
+MUST_USE_RES bool OfferFeatures_supports_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
 
 /**
- * Checks if two IntroductionNodes contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
+ *
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
+ *
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-bool IntroductionNode_eq(const struct LDKIntroductionNode *NONNULL_PTR a, const struct LDKIntroductionNode *NONNULL_PTR b);
+MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Creates a copy of the Direction
+ * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-enum LDKDirection Direction_clone(const enum LDKDirection *NONNULL_PTR orig);
+MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Utility method to constructs a new NodeOne-variant Direction
+ * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-enum LDKDirection Direction_node_one(void);
+MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Utility method to constructs a new NodeTwo-variant Direction
+ * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-enum LDKDirection Direction_node_two(void);
+MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Direction.
+ * Create a blank Features with no features set
  */
-uint64_t Direction_hash(const enum LDKDirection *NONNULL_PTR o);
+MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
 
 /**
- * Checks if two Directions contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order
+ * from most on-the-wire encodings.
  */
-bool Direction_eq(const enum LDKDirection *NONNULL_PTR a, const enum LDKDirection *NONNULL_PTR b);
+MUST_USE_RES struct LDKu8slice InvoiceRequestFeatures_le_flags(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
 
 /**
- * Calls the free function if one is set
+ * Returns true if this `Features` has any optional flags set
  */
-void NodeIdLookUp_free(struct LDKNodeIdLookUp this_ptr);
+MUST_USE_RES bool InvoiceRequestFeatures_supports_any_optional_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the EmptyNodeIdLookUp, if is_owned is set and inner is non-NULL.
+ * Returns true if this `Features` object contains required features unknown by `other`.
  */
-void EmptyNodeIdLookUp_free(struct LDKEmptyNodeIdLookUp this_obj);
+MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other);
 
 /**
- * Constructs a new EmptyNodeIdLookUp given each field
+ * Returns the set of required features unknown by `other`, as their bit position.
  */
-MUST_USE_RES struct LDKEmptyNodeIdLookUp EmptyNodeIdLookUp_new(void);
+MUST_USE_RES struct LDKCVec_u64Z InvoiceRequestFeatures_required_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other);
 
 /**
- * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
  */
-struct LDKNodeIdLookUp EmptyNodeIdLookUp_as_NodeIdLookUp(const struct LDKEmptyNodeIdLookUp *NONNULL_PTR this_arg);
+MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
+ * Returns true if this `Features` supports any bits which we do not know of
  */
-void BlindedHop_free(struct LDKBlindedHop this_obj);
+MUST_USE_RES bool InvoiceRequestFeatures_supports_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
 
 /**
- * The blinded node id of this hop in a [`BlindedPath`].
+ * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
+ *
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
+ *
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-struct LDKPublicKey BlindedHop_get_blinded_node_id(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * The blinded node id of this hop in a [`BlindedPath`].
+ * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-void BlindedHop_set_blinded_node_id(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * The encrypted payload intended for this hop in a [`BlindedPath`].
+ * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
  *
- * Returns a copy of the field.
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-struct LDKCVec_u8Z BlindedHop_get_encrypted_payload(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * The encrypted payload intended for this hop in a [`BlindedPath`].
+ * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-void BlindedHop_set_encrypted_payload(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Constructs a new BlindedHop given each field
+ * Create a blank Features with no features set
  */
-MUST_USE_RES struct LDKBlindedHop BlindedHop_new(struct LDKPublicKey blinded_node_id_arg, struct LDKCVec_u8Z encrypted_payload_arg);
+MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
 
 /**
- * Creates a copy of the BlindedHop
+ * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order
+ * from most on-the-wire encodings.
  */
-struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
+MUST_USE_RES struct LDKu8slice Bolt12InvoiceFeatures_le_flags(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the BlindedHop.
+ * Returns true if this `Features` has any optional flags set
  */
-uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o);
+MUST_USE_RES bool Bolt12InvoiceFeatures_supports_any_optional_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Checks if two BlindedHops 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.
+ * Returns true if this `Features` object contains required features unknown by `other`.
  */
-bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b);
+MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other);
 
 /**
- * Create a one-hop blinded path for a message.
+ * Returns the set of required features unknown by `other`, as their bit position.
  */
-MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_one_hop_for_message(struct LDKPublicKey recipient_node_id, struct LDKEntropySource entropy_source);
+MUST_USE_RES struct LDKCVec_u64Z Bolt12InvoiceFeatures_required_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other);
 
 /**
- * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node
- * pubkey in `node_pks` will be the destination node.
- *
- * Errors if no hops are provided or if `node_pk`(s) are invalid.
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
  */
-MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, struct LDKEntropySource entropy_source);
+MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Create a one-hop blinded path for a payment.
+ * Returns true if this `Features` supports any bits which we do not know of
  */
-MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_one_hop_for_payment(struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint16_t min_final_cltv_expiry_delta, struct LDKEntropySource entropy_source);
+MUST_USE_RES bool Bolt12InvoiceFeatures_supports_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Create a blinded path for a payment, to be forwarded along `intermediate_nodes`.
+ * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
  *
- * Errors if:
- * * a provided node id is invalid
- * * [`BlindedPayInfo`] calculation results in an integer overflow
- * * any unknown features are required in the provided [`ForwardTlvs`]
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
  *
- * [`ForwardTlvs`]: crate::blinded_path::payment::ForwardTlvs
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_new_for_payment(struct LDKCVec_ForwardNodeZ intermediate_nodes, struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint64_t htlc_maximum_msat, uint16_t min_final_cltv_expiry_delta, struct LDKEntropySource entropy_source);
+MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Returns the introduction [`NodeId`] of the blinded path, if it is publicly reachable (i.e.,
- * it is found in the network graph).
+ * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
  *
- * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-MUST_USE_RES struct LDKNodeId BlindedPath_public_introduction_node_id(const struct LDKBlindedPath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
+MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
+ * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
+MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Read a BlindedPath from a byte array, created by BlindedPath_write
+ * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
+ * Create a blank Features with no features set
  */
-struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
+MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
 
 /**
- * Read a BlindedHop from a byte array, created by BlindedHop_write
+ * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order
+ * from most on-the-wire encodings.
  */
-struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKu8slice BlindedHopFeatures_le_flags(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the ForwardNode, if is_owned is set and inner is non-NULL.
+ * Returns true if this `Features` has any optional flags set
  */
-void ForwardNode_free(struct LDKForwardNode this_obj);
+MUST_USE_RES bool BlindedHopFeatures_supports_any_optional_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
 
 /**
- * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
- * used for [`BlindedPayInfo`] construction.
+ * Returns true if this `Features` object contains required features unknown by `other`.
  */
-struct LDKForwardTlvs ForwardNode_get_tlvs(const struct LDKForwardNode *NONNULL_PTR this_ptr);
+MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other);
 
 /**
- * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
- * used for [`BlindedPayInfo`] construction.
+ * Returns the set of required features unknown by `other`, as their bit position.
  */
-void ForwardNode_set_tlvs(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val);
+MUST_USE_RES struct LDKCVec_u64Z BlindedHopFeatures_required_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other);
 
 /**
- * This node's pubkey.
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
  */
-struct LDKPublicKey ForwardNode_get_node_id(const struct LDKForwardNode *NONNULL_PTR this_ptr);
+MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
 
 /**
- * This node's pubkey.
+ * Returns true if this `Features` supports any bits which we do not know of
  */
-void ForwardNode_set_node_id(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+MUST_USE_RES bool BlindedHopFeatures_supports_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
 
 /**
- * The maximum value, in msat, that may be accepted by this node.
+ * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
+ *
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
+ *
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-uint64_t ForwardNode_get_htlc_maximum_msat(const struct LDKForwardNode *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * The maximum value, in msat, that may be accepted by this node.
+ * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-void ForwardNode_set_htlc_maximum_msat(struct LDKForwardNode *NONNULL_PTR this_ptr, uint64_t val);
+MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Constructs a new ForwardNode given each field
+ * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-MUST_USE_RES struct LDKForwardNode ForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg);
+MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Creates a copy of the ForwardNode
+ * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-struct LDKForwardNode ForwardNode_clone(const struct LDKForwardNode *NONNULL_PTR orig);
+MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Frees any resources used by the ForwardTlvs, if is_owned is set and inner is non-NULL.
+ * Create a blank Features with no features set
  */
-void ForwardTlvs_free(struct LDKForwardTlvs this_obj);
+MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
 
 /**
- * The short channel id this payment should be forwarded out over.
+ * Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order
+ * from most on-the-wire encodings.
  */
-uint64_t ForwardTlvs_get_short_channel_id(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKu8slice ChannelTypeFeatures_le_flags(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * The short channel id this payment should be forwarded out over.
+ * Returns true if this `Features` has any optional flags set
  */
-void ForwardTlvs_set_short_channel_id(struct LDKForwardTlvs *NONNULL_PTR this_ptr, uint64_t val);
+MUST_USE_RES bool ChannelTypeFeatures_supports_any_optional_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Payment parameters for relaying over [`Self::short_channel_id`].
+ * Returns true if this `Features` object contains required features unknown by `other`.
  */
-struct LDKPaymentRelay ForwardTlvs_get_payment_relay(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
+MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other);
 
 /**
- * Payment parameters for relaying over [`Self::short_channel_id`].
+ * Returns the set of required features unknown by `other`, as their bit position.
  */
-void ForwardTlvs_set_payment_relay(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentRelay val);
+MUST_USE_RES struct LDKCVec_u64Z ChannelTypeFeatures_required_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other);
 
 /**
- * Payment constraints for relaying over [`Self::short_channel_id`].
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
  */
-struct LDKPaymentConstraints ForwardTlvs_get_payment_constraints(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
+MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Payment constraints for relaying over [`Self::short_channel_id`].
+ * Returns true if this `Features` supports any bits which we do not know of
  */
-void ForwardTlvs_set_payment_constraints(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
+MUST_USE_RES bool ChannelTypeFeatures_supports_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Supported and required features when relaying a payment onion containing this object's
- * corresponding [`BlindedHop::encrypted_payload`].
+ * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
  *
- * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
- */
-struct LDKBlindedHopFeatures ForwardTlvs_get_features(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
-
-/**
- * Supported and required features when relaying a payment onion containing this object's
- * corresponding [`BlindedHop::encrypted_payload`].
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
  *
- * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-void ForwardTlvs_set_features(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
+MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Constructs a new ForwardTlvs given each field
+ * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+ * by [BOLT 9].
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
  */
-MUST_USE_RES struct LDKForwardTlvs ForwardTlvs_new(uint64_t short_channel_id_arg, struct LDKPaymentRelay payment_relay_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKBlindedHopFeatures features_arg);
+MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Creates a copy of the ForwardTlvs
+ * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+ * be set instead (i.e., `bit - 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-struct LDKForwardTlvs ForwardTlvs_clone(const struct LDKForwardTlvs *NONNULL_PTR orig);
+MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Frees any resources used by the ReceiveTlvs, if is_owned is set and inner is non-NULL.
+ * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
+ * by [bLIP 2] or if it is a known `T` feature.
+ *
+ * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+ * set instead (i.e., `bit + 1`).
+ *
+ * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
  */
-void ReceiveTlvs_free(struct LDKReceiveTlvs this_obj);
+MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
 
 /**
- * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
+ * Unsets the `upfront_shutdown_script` feature
  */
-const uint8_t (*ReceiveTlvs_get_payment_secret(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr))[32];
+MUST_USE_RES struct LDKInitFeatures InitFeatures_clear_upfront_shutdown_script(struct LDKInitFeatures this_arg);
 
 /**
- * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
+ * Unsets the `upfront_shutdown_script` feature
  */
-void ReceiveTlvs_set_payment_secret(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+MUST_USE_RES struct LDKNodeFeatures NodeFeatures_clear_upfront_shutdown_script(struct LDKNodeFeatures this_arg);
 
 /**
- * Constraints for the receiver of this payment.
+ * Unsets the `shutdown_anysegwit` feature
  */
-struct LDKPaymentConstraints ReceiveTlvs_get_payment_constraints(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKInitFeatures InitFeatures_clear_shutdown_anysegwit(struct LDKInitFeatures this_arg);
 
 /**
- * Constraints for the receiver of this payment.
+ * Unsets the `shutdown_anysegwit` feature
  */
-void ReceiveTlvs_set_payment_constraints(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
+MUST_USE_RES struct LDKNodeFeatures NodeFeatures_clear_shutdown_anysegwit(struct LDKNodeFeatures this_arg);
 
 /**
- * Context for the receiver of this payment.
+ * Unsets the `wumbo` feature
  */
-struct LDKPaymentContext ReceiveTlvs_get_payment_context(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKInitFeatures InitFeatures_clear_wumbo(struct LDKInitFeatures this_arg);
 
 /**
- * Context for the receiver of this payment.
+ * Unsets the `wumbo` feature
  */
-void ReceiveTlvs_set_payment_context(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentContext val);
+MUST_USE_RES struct LDKNodeFeatures NodeFeatures_clear_wumbo(struct LDKNodeFeatures this_arg);
 
 /**
- * Constructs a new ReceiveTlvs given each field
+ * Unsets the `scid_privacy` feature
  */
-MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKPaymentContext payment_context_arg);
+void InitFeatures_clear_scid_privacy(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the ReceiveTlvs
+ * Unsets the `scid_privacy` feature
  */
-struct LDKReceiveTlvs ReceiveTlvs_clone(const struct LDKReceiveTlvs *NONNULL_PTR orig);
+void NodeFeatures_clear_scid_privacy(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the PaymentRelay, if is_owned is set and inner is non-NULL.
+ * Unsets the `scid_privacy` feature
  */
-void PaymentRelay_free(struct LDKPaymentRelay this_obj);
+void ChannelTypeFeatures_clear_scid_privacy(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
+ * Unsets the `anchors_zero_fee_htlc_tx` feature
  */
-uint16_t PaymentRelay_get_cltv_expiry_delta(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
+void InitFeatures_clear_anchors_zero_fee_htlc_tx(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
+ * Unsets the `anchors_zero_fee_htlc_tx` feature
  */
-void PaymentRelay_set_cltv_expiry_delta(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint16_t val);
+void NodeFeatures_clear_anchors_zero_fee_htlc_tx(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
- * this [`BlindedHop`], (i.e., 10,000 is 1%).
+ * Unsets the `anchors_zero_fee_htlc_tx` feature
  */
-uint32_t PaymentRelay_get_fee_proportional_millionths(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
+void ChannelTypeFeatures_clear_anchors_zero_fee_htlc_tx(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
- * this [`BlindedHop`], (i.e., 10,000 is 1%).
+ * Unsets the `route_blinding` feature
  */
-void PaymentRelay_set_fee_proportional_millionths(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
+void InitFeatures_clear_route_blinding(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
+ * Unsets the `route_blinding` feature
  */
-uint32_t PaymentRelay_get_fee_base_msat(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
+void NodeFeatures_clear_route_blinding(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
+ * Set this feature as optional.
  */
-void PaymentRelay_set_fee_base_msat(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
+void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new PaymentRelay given each field
+ * Set this feature as required.
  */
-MUST_USE_RES struct LDKPaymentRelay PaymentRelay_new(uint16_t cltv_expiry_delta_arg, uint32_t fee_proportional_millionths_arg, uint32_t fee_base_msat_arg);
+void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the PaymentRelay
+ * Checks if this feature is supported.
  */
-struct LDKPaymentRelay PaymentRelay_clone(const struct LDKPaymentRelay *NONNULL_PTR orig);
+MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the PaymentConstraints, if is_owned is set and inner is non-NULL.
+ * Set this feature as optional.
  */
-void PaymentConstraints_free(struct LDKPaymentConstraints this_obj);
+void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
+ * Set this feature as required.
  */
-uint32_t PaymentConstraints_get_max_cltv_expiry(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
+void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
+ * Checks if this feature is supported.
  */
-void PaymentConstraints_set_max_cltv_expiry(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint32_t val);
+MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * The minimum value, in msat, that may be accepted by the node corresponding to this
- * [`BlindedHop`].
+ * Checks if this feature is required.
  */
-uint64_t PaymentConstraints_get_htlc_minimum_msat(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
+MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * The minimum value, in msat, that may be accepted by the node corresponding to this
- * [`BlindedHop`].
+ * Checks if this feature is required.
  */
-void PaymentConstraints_set_htlc_minimum_msat(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint64_t val);
+MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new PaymentConstraints given each field
+ * Set this feature as optional.
  */
-MUST_USE_RES struct LDKPaymentConstraints PaymentConstraints_new(uint32_t max_cltv_expiry_arg, uint64_t htlc_minimum_msat_arg);
+void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the PaymentConstraints
+ * Set this feature as required.
  */
-struct LDKPaymentConstraints PaymentConstraints_clone(const struct LDKPaymentConstraints *NONNULL_PTR orig);
+void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the PaymentContext
+ * Checks if this feature is supported.
  */
-void PaymentContext_free(struct LDKPaymentContext this_ptr);
+MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the PaymentContext
+ * Set this feature as optional.
  */
-struct LDKPaymentContext PaymentContext_clone(const struct LDKPaymentContext *NONNULL_PTR orig);
+void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new Unknown-variant PaymentContext
+ * Set this feature as required.
  */
-struct LDKPaymentContext PaymentContext_unknown(struct LDKUnknownPaymentContext a);
+void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new Bolt12Offer-variant PaymentContext
+ * Checks if this feature is supported.
  */
-struct LDKPaymentContext PaymentContext_bolt12_offer(struct LDKBolt12OfferContext a);
+MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new Bolt12Refund-variant PaymentContext
+ * Set this feature as optional.
  */
-struct LDKPaymentContext PaymentContext_bolt12_refund(struct LDKBolt12RefundContext a);
+void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Checks if two PaymentContexts contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Set this feature as required.
  */
-bool PaymentContext_eq(const struct LDKPaymentContext *NONNULL_PTR a, const struct LDKPaymentContext *NONNULL_PTR b);
+void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the UnknownPaymentContext, if is_owned is set and inner is non-NULL.
+ * Checks if this feature is supported.
  */
-void UnknownPaymentContext_free(struct LDKUnknownPaymentContext this_obj);
+MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the UnknownPaymentContext
+ * Checks if this feature is required.
  */
-struct LDKUnknownPaymentContext UnknownPaymentContext_clone(const struct LDKUnknownPaymentContext *NONNULL_PTR orig);
+MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Checks if two UnknownPaymentContexts 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 this feature is required.
  */
-bool UnknownPaymentContext_eq(const struct LDKUnknownPaymentContext *NONNULL_PTR a, const struct LDKUnknownPaymentContext *NONNULL_PTR b);
+MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the Bolt12OfferContext, if is_owned is set and inner is non-NULL.
+ * Set this feature as optional.
  */
-void Bolt12OfferContext_free(struct LDKBolt12OfferContext this_obj);
+void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * The identifier of the [`Offer`].
- *
- * [`Offer`]: crate::offers::offer::Offer
+ * Set this feature as required.
  */
-struct LDKOfferId Bolt12OfferContext_get_offer_id(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr);
+void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * The identifier of the [`Offer`].
- *
- * [`Offer`]: crate::offers::offer::Offer
+ * Checks if this feature is supported.
  */
-void Bolt12OfferContext_set_offer_id(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKOfferId val);
+MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`].
- *
- * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * Set this feature as optional.
  */
-struct LDKInvoiceRequestFields Bolt12OfferContext_get_invoice_request(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr);
+void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`].
- *
- * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
- * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * Set this feature as required.
  */
-void Bolt12OfferContext_set_invoice_request(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKInvoiceRequestFields val);
+void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new Bolt12OfferContext given each field
+ * Checks if this feature is supported.
  */
-MUST_USE_RES struct LDKBolt12OfferContext Bolt12OfferContext_new(struct LDKOfferId offer_id_arg, struct LDKInvoiceRequestFields invoice_request_arg);
+MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the Bolt12OfferContext
+ * Checks if this feature is required.
  */
-struct LDKBolt12OfferContext Bolt12OfferContext_clone(const struct LDKBolt12OfferContext *NONNULL_PTR orig);
+MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Checks if two Bolt12OfferContexts 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 this feature is required.
  */
-bool Bolt12OfferContext_eq(const struct LDKBolt12OfferContext *NONNULL_PTR a, const struct LDKBolt12OfferContext *NONNULL_PTR b);
+MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the Bolt12RefundContext, if is_owned is set and inner is non-NULL.
+ * Set this feature as optional.
  */
-void Bolt12RefundContext_free(struct LDKBolt12RefundContext this_obj);
+void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new Bolt12RefundContext given each field
+ * Set this feature as required.
  */
-MUST_USE_RES struct LDKBolt12RefundContext Bolt12RefundContext_new(void);
+void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the Bolt12RefundContext
+ * Checks if this feature is supported.
  */
-struct LDKBolt12RefundContext Bolt12RefundContext_clone(const struct LDKBolt12RefundContext *NONNULL_PTR orig);
+MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Checks if two Bolt12RefundContexts 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.
+ * Set this feature as optional.
  */
-bool Bolt12RefundContext_eq(const struct LDKBolt12RefundContext *NONNULL_PTR a, const struct LDKBolt12RefundContext *NONNULL_PTR b);
+void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the ForwardTlvs object into a byte array which can be read by ForwardTlvs_read
+ * Set this feature as required.
  */
-struct LDKCVec_u8Z ForwardTlvs_write(const struct LDKForwardTlvs *NONNULL_PTR obj);
+void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the ReceiveTlvs object into a byte array which can be read by ReceiveTlvs_read
+ * Checks if this feature is supported.
  */
-struct LDKCVec_u8Z ReceiveTlvs_write(const struct LDKReceiveTlvs *NONNULL_PTR obj);
+MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the PaymentRelay object into a byte array which can be read by PaymentRelay_read
+ * Set this feature as optional.
  */
-struct LDKCVec_u8Z PaymentRelay_write(const struct LDKPaymentRelay *NONNULL_PTR obj);
+void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Read a PaymentRelay from a byte array, created by PaymentRelay_write
+ * Set this feature as required.
  */
-struct LDKCResult_PaymentRelayDecodeErrorZ PaymentRelay_read(struct LDKu8slice ser);
+void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the PaymentConstraints object into a byte array which can be read by PaymentConstraints_read
+ * Checks if this feature is supported.
  */
-struct LDKCVec_u8Z PaymentConstraints_write(const struct LDKPaymentConstraints *NONNULL_PTR obj);
+MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Read a PaymentConstraints from a byte array, created by PaymentConstraints_write
+ * Checks if this feature is required.
  */
-struct LDKCResult_PaymentConstraintsDecodeErrorZ PaymentConstraints_read(struct LDKu8slice ser);
+MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the PaymentContext object into a byte array which can be read by PaymentContext_read
+ * Checks if this feature is required.
  */
-struct LDKCVec_u8Z PaymentContext_write(const struct LDKPaymentContext *NONNULL_PTR obj);
+MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Read a PaymentContext from a byte array, created by PaymentContext_write
+ * Checks if this feature is required.
  */
-struct LDKCResult_PaymentContextDecodeErrorZ PaymentContext_read(struct LDKu8slice ser);
+MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the UnknownPaymentContext object into a byte array which can be read by UnknownPaymentContext_read
+ * Set this feature as optional.
  */
-struct LDKCVec_u8Z UnknownPaymentContext_write(const struct LDKUnknownPaymentContext *NONNULL_PTR obj);
+void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Read a UnknownPaymentContext from a byte array, created by UnknownPaymentContext_write
+ * Set this feature as required.
  */
-struct LDKCResult_UnknownPaymentContextDecodeErrorZ UnknownPaymentContext_read(struct LDKu8slice ser);
+void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the Bolt12OfferContext object into a byte array which can be read by Bolt12OfferContext_read
+ * Checks if this feature is supported.
  */
-struct LDKCVec_u8Z Bolt12OfferContext_write(const struct LDKBolt12OfferContext *NONNULL_PTR obj);
+MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Read a Bolt12OfferContext from a byte array, created by Bolt12OfferContext_write
+ * Set this feature as optional.
  */
-struct LDKCResult_Bolt12OfferContextDecodeErrorZ Bolt12OfferContext_read(struct LDKu8slice ser);
+void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the Bolt12RefundContext object into a byte array which can be read by Bolt12RefundContext_read
+ * Set this feature as required.
  */
-struct LDKCVec_u8Z Bolt12RefundContext_write(const struct LDKBolt12RefundContext *NONNULL_PTR obj);
+void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Read a Bolt12RefundContext from a byte array, created by Bolt12RefundContext_write
+ * Checks if this feature is supported.
  */
-struct LDKCResult_Bolt12RefundContextDecodeErrorZ Bolt12RefundContext_read(struct LDKu8slice ser);
+MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the PaymentPurpose
+ * Set this feature as optional.
  */
-void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
+void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the PaymentPurpose
+ * Set this feature as required.
  */
-struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
+void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new Bolt11InvoicePayment-variant PaymentPurpose
+ * Checks if this feature is supported.
  */
-struct LDKPaymentPurpose PaymentPurpose_bolt11_invoice_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret);
+MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new Bolt12OfferPayment-variant PaymentPurpose
+ * Checks if this feature is required.
  */
-struct LDKPaymentPurpose PaymentPurpose_bolt12_offer_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12OfferContext payment_context);
+MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new Bolt12RefundPayment-variant PaymentPurpose
+ * Checks if this feature is required.
  */
-struct LDKPaymentPurpose PaymentPurpose_bolt12_refund_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12RefundContext payment_context);
+MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
+ * Checks if this feature is required.
  */
-struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
+MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Checks if two PaymentPurposes contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Set this feature as optional.
  */
-bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
+void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Returns the preimage for this payment, if it is known.
+ * Set this feature as required.
  */
-MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ PaymentPurpose_preimage(const struct LDKPaymentPurpose *NONNULL_PTR this_arg);
+void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
+ * Checks if this feature is supported.
  */
-struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
+MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
+ * Set this feature as optional.
  */
-struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
+void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the ClaimedHTLC, if is_owned is set and inner is non-NULL.
+ * Set this feature as required.
  */
-void ClaimedHTLC_free(struct LDKClaimedHTLC this_obj);
+void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * The `channel_id` of the channel over which the HTLC was received.
+ * Checks if this feature is supported.
  */
-struct LDKChannelId ClaimedHTLC_get_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
+MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * The `channel_id` of the channel over which the HTLC was received.
+ * Set this feature as optional.
  */
-void ClaimedHTLC_set_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
+void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * The `user_channel_id` of the channel over which the HTLC was received. This is the value
- * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
- * [`ChannelManager::accept_inbound_channel`] for inbound channels if
- * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
- * `user_channel_id` will be randomized for an inbound channel.
- *
- * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
- * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
- * was not actually claimed until after upgrading.)
- *
- * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
- * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
- * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+ * Set this feature as required.
  */
-struct LDKU128 ClaimedHTLC_get_user_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
+void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * The `user_channel_id` of the channel over which the HTLC was received. This is the value
- * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
- * [`ChannelManager::accept_inbound_channel`] for inbound channels if
- * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
- * `user_channel_id` will be randomized for an inbound channel.
- *
- * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
- * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
- * was not actually claimed until after upgrading.)
- *
- * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
- * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
- * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+ * Checks if this feature is supported.
  */
-void ClaimedHTLC_set_user_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKU128 val);
+MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * The block height at which this HTLC expires.
+ * Checks if this feature is required.
  */
-uint32_t ClaimedHTLC_get_cltv_expiry(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
+MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * The block height at which this HTLC expires.
+ * Checks if this feature is required.
  */
-void ClaimedHTLC_set_cltv_expiry(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint32_t val);
+MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * The amount (in msats) of this part of an MPP.
+ * Checks if this feature is required.
  */
-uint64_t ClaimedHTLC_get_value_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
+MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * The amount (in msats) of this part of an MPP.
+ * Set this feature as optional.
  */
-void ClaimedHTLC_set_value_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
+void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * The extra fee our counterparty skimmed off the top of this HTLC, if any.
- *
- * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
- * 0.0.119.
+ * Set this feature as required.
  */
-uint64_t ClaimedHTLC_get_counterparty_skimmed_fee_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
+void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * The extra fee our counterparty skimmed off the top of this HTLC, if any.
- *
- * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
- * 0.0.119.
+ * Checks if this feature is supported.
  */
-void ClaimedHTLC_set_counterparty_skimmed_fee_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
+MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new ClaimedHTLC given each field
+ * Set this feature as optional.
  */
-MUST_USE_RES struct LDKClaimedHTLC ClaimedHTLC_new(struct LDKChannelId channel_id_arg, struct LDKU128 user_channel_id_arg, uint32_t cltv_expiry_arg, uint64_t value_msat_arg, uint64_t counterparty_skimmed_fee_msat_arg);
+void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the ClaimedHTLC
+ * Set this feature as required.
  */
-struct LDKClaimedHTLC ClaimedHTLC_clone(const struct LDKClaimedHTLC *NONNULL_PTR orig);
+void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Checks if two ClaimedHTLCs 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 this feature is supported.
  */
-bool ClaimedHTLC_eq(const struct LDKClaimedHTLC *NONNULL_PTR a, const struct LDKClaimedHTLC *NONNULL_PTR b);
+MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the ClaimedHTLC object into a byte array which can be read by ClaimedHTLC_read
+ * Set this feature as optional.
  */
-struct LDKCVec_u8Z ClaimedHTLC_write(const struct LDKClaimedHTLC *NONNULL_PTR obj);
+void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Read a ClaimedHTLC from a byte array, created by ClaimedHTLC_write
+ * Set this feature as required.
  */
-struct LDKCResult_ClaimedHTLCDecodeErrorZ ClaimedHTLC_read(struct LDKu8slice ser);
+void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the PathFailure
+ * Checks if this feature is supported.
  */
-void PathFailure_free(struct LDKPathFailure this_ptr);
+MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the PathFailure
+ * Set this feature as optional.
  */
-struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
+void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new InitialSend-variant PathFailure
+ * Set this feature as required.
  */
-struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
+void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new OnPath-variant PathFailure
+ * Checks if this feature is supported.
  */
-struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
+MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Checks if two PathFailures contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Checks if this feature is required.
  */
-bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
+MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
+ * Checks if this feature is required.
  */
-struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
+MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Read a PathFailure from a byte array, created by PathFailure_write
+ * Checks if this feature is required.
  */
-struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
+MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the ClosureReason
+ * Checks if this feature is required.
  */
-void ClosureReason_free(struct LDKClosureReason this_ptr);
+MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the ClosureReason
+ * Set this feature as optional.
  */
-struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
+void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
+ * Set this feature as required.
  */
-struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg);
+void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new HolderForceClosed-variant ClosureReason
+ * Checks if this feature is supported.
  */
-struct LDKClosureReason ClosureReason_holder_force_closed(void);
+MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new LegacyCooperativeClosure-variant ClosureReason
+ * Set this feature as optional.
  */
-struct LDKClosureReason ClosureReason_legacy_cooperative_closure(void);
+void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new CounterpartyInitiatedCooperativeClosure-variant ClosureReason
+ * Set this feature as required.
  */
-struct LDKClosureReason ClosureReason_counterparty_initiated_cooperative_closure(void);
+void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new LocallyInitiatedCooperativeClosure-variant ClosureReason
+ * Checks if this feature is supported.
  */
-struct LDKClosureReason ClosureReason_locally_initiated_cooperative_closure(void);
+MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
+ * Checks if this feature is required.
  */
-struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
+MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new FundingTimedOut-variant ClosureReason
+ * Checks if this feature is required.
  */
-struct LDKClosureReason ClosureReason_funding_timed_out(void);
+MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new ProcessingError-variant ClosureReason
+ * Set this feature as optional.
  */
-struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
+void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
+ * Set this feature as required.
  */
-struct LDKClosureReason ClosureReason_disconnected_peer(void);
+void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
+ * Checks if this feature is supported.
  */
-struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
+MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason
+ * Set this feature as optional.
  */
-struct LDKClosureReason ClosureReason_counterparty_coop_closed_unfunded_channel(void);
+void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new FundingBatchClosure-variant ClosureReason
+ * Set this feature as required.
  */
-struct LDKClosureReason ClosureReason_funding_batch_closure(void);
+void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new HTLCsTimedOut-variant ClosureReason
+ * Checks if this feature is supported.
  */
-struct LDKClosureReason ClosureReason_htlcs_timed_out(void);
+MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Checks if two ClosureReasons contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Set this feature as optional.
  */
-bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
+void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
+ * Set this feature as required.
  */
-struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
+void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Read a ClosureReason from a byte array, created by ClosureReason_write
+ * Checks if this feature is supported.
  */
-struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
+MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the HTLCDestination
+ * Checks if this feature is required.
  */
-void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
+MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the HTLCDestination
+ * Checks if this feature is required.
  */
-struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
+MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new NextHopChannel-variant HTLCDestination
+ * Checks if this feature is required.
  */
-struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKChannelId channel_id);
+MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
+ * Set this feature as optional.
  */
-struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
+void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new InvalidForward-variant HTLCDestination
+ * Set this feature as required.
  */
-struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
+void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new InvalidOnion-variant HTLCDestination
+ * Checks if this feature is supported.
  */
-struct LDKHTLCDestination HTLCDestination_invalid_onion(void);
+MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new FailedPayment-variant HTLCDestination
+ * Set this feature as optional.
  */
-struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
+void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Checks if two HTLCDestinations contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Set this feature as required.
  */
-bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
+void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
+ * Checks if this feature is supported.
  */
-struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
+MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Read a HTLCDestination from a byte array, created by HTLCDestination_write
+ * Set this feature as optional.
  */
-struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
+void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the PaymentFailureReason
+ * Set this feature as required.
  */
-enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig);
+void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new RecipientRejected-variant PaymentFailureReason
+ * Checks if this feature is supported.
  */
-enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void);
+MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new UserAbandoned-variant PaymentFailureReason
+ * Checks if this feature is required.
  */
-enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void);
+MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new RetriesExhausted-variant PaymentFailureReason
+ * Checks if this feature is required.
  */
-enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void);
+MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new PaymentExpired-variant PaymentFailureReason
+ * Checks if this feature is required.
  */
-enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void);
+MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new RouteNotFound-variant PaymentFailureReason
+ * Set this feature as optional.
  */
-enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void);
+void InitFeatures_set_route_blinding_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new UnexpectedError-variant PaymentFailureReason
+ * Set this feature as required.
  */
-enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void);
+void InitFeatures_set_route_blinding_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Checks if two PaymentFailureReasons contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Checks if this feature is supported.
  */
-bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b);
+MUST_USE_RES bool InitFeatures_supports_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the PaymentFailureReason object into a byte array which can be read by PaymentFailureReason_read
+ * Set this feature as optional.
  */
-struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj);
+void NodeFeatures_set_route_blinding_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write
+ * Set this feature as required.
  */
-struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser);
+void NodeFeatures_set_route_blinding_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the Event
+ * Checks if this feature is supported.
  */
-void Event_free(struct LDKEvent this_ptr);
+MUST_USE_RES bool NodeFeatures_supports_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the Event
+ * Checks if this feature is required.
  */
-struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
+MUST_USE_RES bool InitFeatures_requires_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new FundingGenerationReady-variant Event
+ * Checks if this feature is required.
  */
-struct LDKEvent Event_funding_generation_ready(struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, struct LDKU128 user_channel_id);
+MUST_USE_RES bool NodeFeatures_requires_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new PaymentClaimable-variant Event
+ * Set this feature as optional.
  */
-struct LDKEvent Event_payment_claimable(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields onion_fields, uint64_t amount_msat, uint64_t counterparty_skimmed_fee_msat, struct LDKPaymentPurpose purpose, struct LDKChannelId via_channel_id, struct LDKCOption_U128Z via_user_channel_id, struct LDKCOption_u32Z claim_deadline);
+void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new PaymentClaimed-variant Event
+ * Set this feature as required.
  */
-struct LDKEvent Event_payment_claimed(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose, struct LDKCVec_ClaimedHTLCZ htlcs, struct LDKCOption_u64Z sender_intended_total_msat);
+void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new ConnectionNeeded-variant Event
+ * Checks if this feature is supported.
  */
-struct LDKEvent Event_connection_needed(struct LDKPublicKey node_id, struct LDKCVec_SocketAddressZ addresses);
+MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new InvoiceRequestFailed-variant Event
+ * Set this feature as optional.
  */
-struct LDKEvent Event_invoice_request_failed(struct LDKThirtyTwoBytes payment_id);
+void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new PaymentSent-variant Event
+ * Set this feature as required.
  */
-struct LDKEvent Event_payment_sent(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
+void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new PaymentFailed-variant Event
+ * Checks if this feature is supported.
  */
-struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason);
+MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new PaymentPathSuccessful-variant Event
+ * Checks if this feature is required.
  */
-struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKPath path);
+MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new PaymentPathFailed-variant Event
+ * Checks if this feature is required.
  */
-struct LDKEvent Event_payment_path_failed(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_hash, bool payment_failed_permanently, struct LDKPathFailure failure, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
+MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new ProbeSuccessful-variant Event
+ * Set this feature as optional.
  */
-struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
+void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new ProbeFailed-variant Event
+ * Set this feature as required.
  */
-struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
+void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new PendingHTLCsForwardable-variant Event
+ * Checks if this feature is supported.
  */
-struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
+MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new HTLCIntercepted-variant Event
+ * Set this feature as optional.
  */
-struct LDKEvent Event_htlcintercepted(struct LDKThirtyTwoBytes intercept_id, uint64_t requested_next_hop_scid, struct LDKThirtyTwoBytes payment_hash, uint64_t inbound_amount_msat, uint64_t expected_outbound_amount_msat);
+void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SpendableOutputs-variant Event
+ * Set this feature as required.
  */
-struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKChannelId channel_id);
+void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new PaymentForwarded-variant Event
+ * Checks if this feature is supported.
  */
-struct LDKEvent Event_payment_forwarded(struct LDKChannelId prev_channel_id, struct LDKChannelId next_channel_id, struct LDKCOption_U128Z prev_user_channel_id, struct LDKCOption_U128Z next_user_channel_id, struct LDKCOption_u64Z total_fee_earned_msat, struct LDKCOption_u64Z skimmed_fee_msat, bool claim_from_onchain_tx, struct LDKCOption_u64Z outbound_amount_forwarded_msat);
+MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new ChannelPending-variant Event
+ * Set this feature as optional.
  */
-struct LDKEvent Event_channel_pending(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKChannelId former_temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding_txo, struct LDKChannelTypeFeatures channel_type);
+void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new ChannelReady-variant Event
+ * Set this feature as required.
  */
-struct LDKEvent Event_channel_ready(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
+void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new ChannelClosed-variant Event
+ * Checks if this feature is supported.
  */
-struct LDKEvent Event_channel_closed(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u64Z channel_capacity_sats, struct LDKOutPoint channel_funding_txo);
+MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new DiscardFunding-variant Event
+ * Checks if this feature is required.
  */
-struct LDKEvent Event_discard_funding(struct LDKChannelId channel_id, struct LDKTransaction transaction);
+MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new OpenChannelRequest-variant Event
+ * Checks if this feature is required.
  */
-struct LDKEvent Event_open_channel_request(struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type);
+MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new HTLCHandlingFailed-variant Event
+ * Checks if this feature is required.
  */
-struct LDKEvent Event_htlchandling_failed(struct LDKChannelId prev_channel_id, struct LDKHTLCDestination failed_next_destination);
+MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new BumpTransaction-variant Event
+ * Set this feature as optional.
  */
-struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a);
+void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Checks if two Events contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Set this feature as required.
  */
-bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
+void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Serialize the Event object into a byte array which can be read by Event_read
+ * Checks if this feature is supported.
  */
-struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
+MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Read a Event from a byte array, created by Event_write
+ * Set this feature as optional.
  */
-struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
+void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the MessageSendEvent
+ * Set this feature as required.
  */
-void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
+void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the MessageSendEvent
+ * Checks if this feature is supported.
  */
-struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
+MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
+ * Checks if this feature is required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
+MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
+ * Checks if this feature is required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_accept_channel_v2(struct LDKPublicKey node_id, struct LDKAcceptChannelV2 msg);
+MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
+ * Set this feature as optional.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
+void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
+ * Set this feature as required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_open_channel_v2(struct LDKPublicKey node_id, struct LDKOpenChannelV2 msg);
+void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
+ * Checks if this feature is supported.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
+MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
+ * Set this feature as optional.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
+void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendStfu-variant MessageSendEvent
+ * Set this feature as required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_stfu(struct LDKPublicKey node_id, struct LDKStfu msg);
+void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendSplice-variant MessageSendEvent
+ * Checks if this feature is supported.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_splice(struct LDKPublicKey node_id, struct LDKSplice msg);
+MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendSpliceAck-variant MessageSendEvent
+ * Checks if this feature is required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_splice_ack(struct LDKPublicKey node_id, struct LDKSpliceAck msg);
+MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendSpliceLocked-variant MessageSendEvent
+ * Checks if this feature is required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_splice_locked(struct LDKPublicKey node_id, struct LDKSpliceLocked msg);
+MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
+ * Set this feature as optional.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_tx_add_input(struct LDKPublicKey node_id, struct LDKTxAddInput msg);
+void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
+ * Set this feature as required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_tx_add_output(struct LDKPublicKey node_id, struct LDKTxAddOutput msg);
+void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
+ * Checks if this feature is supported.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_input(struct LDKPublicKey node_id, struct LDKTxRemoveInput msg);
+MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
+ * Set this feature as optional.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_output(struct LDKPublicKey node_id, struct LDKTxRemoveOutput msg);
+void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
+ * Set this feature as required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_tx_complete(struct LDKPublicKey node_id, struct LDKTxComplete msg);
+void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
+ * Checks if this feature is supported.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_tx_signatures(struct LDKPublicKey node_id, struct LDKTxSignatures msg);
+MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
+ * Set this feature as optional.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_tx_init_rbf(struct LDKPublicKey node_id, struct LDKTxInitRbf msg);
+void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
+ * Set this feature as required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_tx_ack_rbf(struct LDKPublicKey node_id, struct LDKTxAckRbf msg);
+void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
+ * Checks if this feature is supported.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_tx_abort(struct LDKPublicKey node_id, struct LDKTxAbort msg);
+MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
+ * Checks if this feature is required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
+MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
+ * Checks if this feature is required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
+MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
+ * Checks if this feature is required.
  */
-struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
+MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
+ * Set this feature as optional.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
+void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
+ * Set this feature as required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
+void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendShutdown-variant MessageSendEvent
+ * Checks if this feature is supported.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
+MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
+ * Checks if this feature is required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
+MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
+ * Set this feature as optional.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
+void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
+ * Set this feature as required.
  */
-struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
+void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
+ * Checks if this feature is supported.
  */
-struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
+MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
+ * Set this feature as optional.
  */
-struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
+void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
+ * Set this feature as required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
+void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new HandleError-variant MessageSendEvent
+ * Checks if this feature is supported.
  */
-struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
+MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
+ * Set this feature as optional.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
+void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
+ * Set this feature as required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
+void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
+ * Checks if this feature is supported.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
+MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
+ * Checks if this feature is required.
  */
-struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
+MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Calls the free function if one is set
+ * Checks if this feature is required.
  */
-void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
+MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Calls the free function if one is set
+ * Checks if this feature is required.
  */
-void EventsProvider_free(struct LDKEventsProvider this_ptr);
+MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Calls the free function if one is set
+ * Set this feature as optional.
  */
-void EventHandler_free(struct LDKEventHandler this_ptr);
+void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the AnchorDescriptor, if is_owned is set and inner is non-NULL.
+ * Set this feature as required.
  */
-void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj);
+void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * The parameters required to derive the signer for the anchor input.
+ * Checks if this feature is supported.
  */
-struct LDKChannelDerivationParameters AnchorDescriptor_get_channel_derivation_parameters(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
+MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * The parameters required to derive the signer for the anchor input.
+ * Checks if this feature is required.
  */
-void AnchorDescriptor_set_channel_derivation_parameters(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
+MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * The transaction input's outpoint corresponding to the commitment transaction's anchor
- * output.
+ * Set this feature as optional.
  */
-struct LDKOutPoint AnchorDescriptor_get_outpoint(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
+void InitFeatures_set_trampoline_routing_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * The transaction input's outpoint corresponding to the commitment transaction's anchor
- * output.
+ * Set this feature as required.
  */
-void AnchorDescriptor_set_outpoint(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+void InitFeatures_set_trampoline_routing_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new AnchorDescriptor given each field
+ * Checks if this feature is supported.
  */
-MUST_USE_RES struct LDKAnchorDescriptor AnchorDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKOutPoint outpoint_arg);
+MUST_USE_RES bool InitFeatures_supports_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the AnchorDescriptor
+ * Set this feature as optional.
  */
-struct LDKAnchorDescriptor AnchorDescriptor_clone(const struct LDKAnchorDescriptor *NONNULL_PTR orig);
+void NodeFeatures_set_trampoline_routing_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Checks if two AnchorDescriptors 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.
+ * Set this feature as required.
  */
-bool AnchorDescriptor_eq(const struct LDKAnchorDescriptor *NONNULL_PTR a, const struct LDKAnchorDescriptor *NONNULL_PTR b);
+void NodeFeatures_set_trampoline_routing_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Returns the UTXO to be spent by the anchor input, which can be obtained via
- * [`Self::unsigned_tx_input`].
+ * Checks if this feature is supported.
  */
-MUST_USE_RES struct LDKTxOut AnchorDescriptor_previous_utxo(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
+MUST_USE_RES bool NodeFeatures_supports_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Returns the unsigned transaction input spending the anchor output in the commitment
- * transaction.
+ * Set this feature as optional.
  */
-MUST_USE_RES struct LDKTxIn AnchorDescriptor_unsigned_tx_input(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
+void Bolt11InvoiceFeatures_set_trampoline_routing_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Returns the witness script of the anchor output in the commitment transaction.
+ * Set this feature as required.
  */
-MUST_USE_RES struct LDKCVec_u8Z AnchorDescriptor_witness_script(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
+void Bolt11InvoiceFeatures_set_trampoline_routing_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Returns the fully signed witness required to spend the anchor output in the commitment
- * transaction.
+ * Checks if this feature is supported.
  */
-MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature);
+MUST_USE_RES bool Bolt11InvoiceFeatures_supports_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Derives the channel signer required to sign the anchor input.
+ * Checks if this feature is required.
  */
-MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
+MUST_USE_RES bool InitFeatures_requires_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the BumpTransactionEvent
+ * Checks if this feature is required.
  */
-void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr);
+MUST_USE_RES bool NodeFeatures_requires_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the BumpTransactionEvent
+ * Checks if this feature is required.
  */
-struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig);
+MUST_USE_RES bool Bolt11InvoiceFeatures_requires_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent
+ * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
  */
-struct LDKBumpTransactionEvent BumpTransactionEvent_channel_close(struct LDKChannelId channel_id, struct LDKPublicKey counterparty_node_id, struct LDKThirtyTwoBytes claim_id, uint32_t package_target_feerate_sat_per_1000_weight, struct LDKTransaction commitment_tx, uint64_t commitment_tx_fee_satoshis, struct LDKAnchorDescriptor anchor_descriptor, struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs);
+void RoutingFees_free(struct LDKRoutingFees this_obj);
 
 /**
- * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent
+ * Flat routing fee in millisatoshis.
  */
-struct LDKBumpTransactionEvent BumpTransactionEvent_htlcresolution(struct LDKChannelId channel_id, struct LDKPublicKey counterparty_node_id, struct LDKThirtyTwoBytes claim_id, uint32_t target_feerate_sat_per_1000_weight, struct LDKCVec_HTLCDescriptorZ htlc_descriptors, uint32_t tx_lock_time);
+uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two BumpTransactionEvents contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Flat routing fee in millisatoshis.
  */
-bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b);
+void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Frees any resources used by the Input, if is_owned is set and inner is non-NULL.
+ * Liquidity-based routing fee in millionths of a routed amount.
+ * In other words, 10000 is 1%.
  */
-void Input_free(struct LDKInput this_obj);
+uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
 
 /**
- * The unique identifier of the input.
+ * Liquidity-based routing fee in millionths of a routed amount.
+ * In other words, 10000 is 1%.
  */
-struct LDKOutPoint Input_get_outpoint(const struct LDKInput *NONNULL_PTR this_ptr);
+void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * The unique identifier of the input.
+ * Constructs a new RoutingFees given each field
  */
-void Input_set_outpoint(struct LDKInput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
 
 /**
- * The UTXO being spent by the input.
+ * Checks if two RoutingFeess 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 LDKTxOut Input_get_previous_utxo(const struct LDKInput *NONNULL_PTR this_ptr);
+bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
 
 /**
- * The UTXO being spent by the input.
+ * Creates a copy of the RoutingFees
  */
-void Input_set_previous_utxo(struct LDKInput *NONNULL_PTR this_ptr, struct LDKTxOut val);
+struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
 
 /**
- * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
- * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
- * script.
+ * Generates a non-cryptographic 64-bit hash of the RoutingFees.
  */
-uint64_t Input_get_satisfaction_weight(const struct LDKInput *NONNULL_PTR this_ptr);
+uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
 
 /**
- * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
- * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
- * script.
+ * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
  */
-void Input_set_satisfaction_weight(struct LDKInput *NONNULL_PTR this_ptr, uint64_t val);
+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 Input given each field
+ * Constructs a new RouteHint given each field
  */
-MUST_USE_RES struct LDKInput Input_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut previous_utxo_arg, uint64_t satisfaction_weight_arg);
+MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
 
 /**
- * Creates a copy of the Input
+ * Creates a copy of the RouteHint
  */
-struct LDKInput Input_clone(const struct LDKInput *NONNULL_PTR orig);
+struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Input.
+ * Generates a non-cryptographic 64-bit hash of the RouteHint.
  */
-uint64_t Input_hash(const struct LDKInput *NONNULL_PTR o);
+uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
 
 /**
- * Checks if two Inputs contain equal inner contents.
+ * 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 Input_eq(const struct LDKInput *NONNULL_PTR a, const struct LDKInput *NONNULL_PTR b);
+bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
 
 /**
- * Frees any resources used by the Utxo, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
  */
-void Utxo_free(struct LDKUtxo this_obj);
+void RouteHintHop_free(struct LDKRouteHintHop this_obj);
 
 /**
- * The unique identifier of the output.
+ * The node_id of the non-target end of the route
  */
-struct LDKOutPoint Utxo_get_outpoint(const struct LDKUtxo *NONNULL_PTR this_ptr);
+struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
 
 /**
- * The unique identifier of the output.
+ * The node_id of the non-target end of the route
  */
-void Utxo_set_outpoint(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * The output to spend.
+ * The short_channel_id of this channel
  */
-struct LDKTxOut Utxo_get_output(const struct LDKUtxo *NONNULL_PTR this_ptr);
+uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
 
 /**
- * The output to spend.
+ * The short_channel_id of this channel
  */
-void Utxo_set_output(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKTxOut val);
+void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
- * with their lengths included, required to satisfy the output's script. The weight consumed by
- * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
+ * The fees which must be paid to use this channel
  */
-uint64_t Utxo_get_satisfaction_weight(const struct LDKUtxo *NONNULL_PTR this_ptr);
+struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
 
 /**
- * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
- * with their lengths included, required to satisfy the output's script. The weight consumed by
- * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
+ * The fees which must be paid to use this channel
  */
-void Utxo_set_satisfaction_weight(struct LDKUtxo *NONNULL_PTR this_ptr, uint64_t val);
+void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
 
 /**
- * Constructs a new Utxo given each field
+ * The difference in CLTV values between this node and the next node.
  */
-MUST_USE_RES struct LDKUtxo Utxo_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, uint64_t satisfaction_weight_arg);
+uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the Utxo
+ * The difference in CLTV values between this node and the next node.
  */
-struct LDKUtxo Utxo_clone(const struct LDKUtxo *NONNULL_PTR orig);
+void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
- * Generates a non-cryptographic 64-bit hash of the Utxo.
+ * The minimum value, in msat, which must be relayed to the next hop.
  */
-uint64_t Utxo_hash(const struct LDKUtxo *NONNULL_PTR o);
+struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
 
 /**
- * Checks if two Utxos 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 minimum value, in msat, which must be relayed to the next hop.
  */
-bool Utxo_eq(const struct LDKUtxo *NONNULL_PTR a, const struct LDKUtxo *NONNULL_PTR b);
+void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
 
 /**
- * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.
+ * The maximum value in msat available for routing with a single HTLC.
  */
-MUST_USE_RES struct LDKUtxo Utxo_new_p2pkh(struct LDKOutPoint outpoint, uint64_t value, const uint8_t (*pubkey_hash)[20]);
+struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the CoinSelection, if is_owned is set and inner is non-NULL.
+ * The maximum value in msat available for routing with a single HTLC.
  */
-void CoinSelection_free(struct LDKCoinSelection this_obj);
+void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
 
 /**
- * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
- * requiring additional fees.
+ * Constructs a new RouteHintHop given each field
  */
-struct LDKCVec_UtxoZ CoinSelection_get_confirmed_utxos(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
+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);
 
 /**
- * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
- * requiring additional fees.
+ * Creates a copy of the RouteHintHop
  */
-void CoinSelection_set_confirmed_utxos(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCVec_UtxoZ val);
+struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
 
 /**
- * An additional output tracking whether any change remained after coin selection. This output
- * should always have a value above dust for its given `script_pubkey`. It should not be
- * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
- * not met. This implies no other party should be able to spend it except us.
+ * Generates a non-cryptographic 64-bit hash of the RouteHintHop.
  */
-struct LDKCOption_TxOutZ CoinSelection_get_change_output(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
+uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
 
 /**
- * An additional output tracking whether any change remained after coin selection. This output
- * should always have a value above dust for its given `script_pubkey`. It should not be
- * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
- * not met. This implies no other party should be able to spend it except us.
+ * 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.
  */
-void CoinSelection_set_change_output(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCOption_TxOutZ val);
+bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
 
 /**
- * Constructs a new CoinSelection given each field
+ * Frees any resources used by the UntrustedString, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKCoinSelection CoinSelection_new(struct LDKCVec_UtxoZ confirmed_utxos_arg, struct LDKCOption_TxOutZ change_output_arg);
+void UntrustedString_free(struct LDKUntrustedString this_obj);
 
-/**
- * Creates a copy of the CoinSelection
- */
-struct LDKCoinSelection CoinSelection_clone(const struct LDKCoinSelection *NONNULL_PTR orig);
+struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr);
+
+void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val);
 
 /**
- * Calls the free function if one is set
+ * Constructs a new UntrustedString given each field
  */
-void CoinSelectionSource_free(struct LDKCoinSelectionSource this_ptr);
+MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg);
 
 /**
- * Calls the free function if one is set
+ * Creates a copy of the UntrustedString
  */
-void WalletSource_free(struct LDKWalletSource this_ptr);
+struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the Wallet, if is_owned is set and inner is non-NULL.
+ * Checks if two UntrustedStrings 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 Wallet_free(struct LDKWallet this_obj);
+bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b);
 
 /**
- * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation
- * of [`CoinSelectionSource`].
+ * Generates a non-cryptographic 64-bit hash of the UntrustedString.
  */
-MUST_USE_RES struct LDKWallet Wallet_new(struct LDKWalletSource source, struct LDKLogger logger);
+uint64_t UntrustedString_hash(const struct LDKUntrustedString *NONNULL_PTR o);
 
 /**
- * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is
+ * Get the string representation of a UntrustedString object
  */
-struct LDKCoinSelectionSource Wallet_as_CoinSelectionSource(const struct LDKWallet *NONNULL_PTR this_arg);
+struct LDKStr UntrustedString_to_str(const struct LDKUntrustedString *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the BumpTransactionEventHandler, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
  */
-void BumpTransactionEventHandler_free(struct LDKBumpTransactionEventHandler this_obj);
+void PrintableString_free(struct LDKPrintableString this_obj);
+
+struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
+
+void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
 
 /**
- * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
- *
- * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
+ * Constructs a new PrintableString given each field
  */
-MUST_USE_RES struct LDKBumpTransactionEventHandler BumpTransactionEventHandler_new(struct LDKBroadcasterInterface broadcaster, struct LDKCoinSelectionSource utxo_source, struct LDKSignerProvider signer_provider, struct LDKLogger logger);
+MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
 
 /**
- * Handles all variants of [`BumpTransactionEvent`].
+ * Get the string representation of a PrintableString object
  */
-void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event);
+struct LDKStr PrintableString_to_str(const struct LDKPrintableString *NONNULL_PTR o);
 
 /**
  * Frees any resources used by the FilesystemStore, if is_owned is set and inner is non-NULL.
@@ -55562,7 +60208,7 @@ struct LDKGossipSync GossipSync_none(void);
  * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
  * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
  */
-MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, struct LDKGossipSync gossip_sync, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger, struct LDKCOption_WriteableScoreZ scorer);
+MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, const struct LDKOnionMessenger *NONNULL_PTR onion_messenger, struct LDKGossipSync gossip_sync, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger, struct LDKCOption_WriteableScoreZ scorer);
 
 /**
  * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
@@ -56110,6 +60756,15 @@ bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallba
  */
 void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj);
 
+struct LDKRecoverableSignature Bolt11InvoiceSignature_get_a(const struct LDKBolt11InvoiceSignature *NONNULL_PTR this_ptr);
+
+void Bolt11InvoiceSignature_set_a(struct LDKBolt11InvoiceSignature *NONNULL_PTR this_ptr, struct LDKRecoverableSignature val);
+
+/**
+ * Constructs a new Bolt11InvoiceSignature given each field
+ */
+MUST_USE_RES struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_new(struct LDKRecoverableSignature a_arg);
+
 /**
  * Creates a copy of the Bolt11InvoiceSignature
  */
@@ -56439,8 +61094,8 @@ MUST_USE_RES enum LDKCurrency Bolt11Invoice_currency(const struct LDKBolt11Invoi
 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_amount_milli_satoshis(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
 
 /**
- * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
- * returns [`CreationError::DescriptionTooLong`] otherwise
+ * Creates a new `Description` if `description` is at most 1023 * 5 bits (i.e., 639 bytes)
+ * long, and returns [`CreationError::DescriptionTooLong`] otherwise.
  *
  * Please note that single characters may use more than one byte due to UTF8 encoding.
  */
@@ -56451,6 +61106,11 @@ MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct
  */
 MUST_USE_RES struct LDKUntrustedString Description_into_inner(struct LDKDescription this_arg);
 
+/**
+ * Get a reference to the underlying description [`UntrustedString`]
+ */
+MUST_USE_RES struct LDKUntrustedString Description_as_inner(const struct LDKDescription *NONNULL_PTR this_arg);
+
 /**
  * Get the string representation of a Description object
  */
@@ -56629,184 +61289,6 @@ bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a,
  */
 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
 
-/**
- * Builds the necessary parameters to pay or pre-flight probe the given zero-amount
- * [`Bolt11Invoice`] using [`ChannelManager::send_payment`] or
- * [`ChannelManager::send_preflight_probes`].
- *
- * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
- * same [`PaymentHash`] has never been paid before.
- *
- * Will always succeed unless the invoice has an amount specified, in which case
- * [`payment_parameters_from_invoice`] should be used.
- *
- * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
- * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
- */
-struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_zero_amount_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat);
-
-/**
- * Builds the necessary parameters to pay or pre-flight probe the given [`Bolt11Invoice`] using
- * [`ChannelManager::send_payment`] or [`ChannelManager::send_preflight_probes`].
- *
- * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
- * same [`PaymentHash`] has never been paid before.
- *
- * Will always succeed unless the invoice has no amount specified, in which case
- * [`payment_parameters_from_zero_amount_invoice`] should be used.
- *
- * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
- * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
- */
-struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice);
-
-/**
- * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
- * See [`PhantomKeysManager`] for more information on phantom node payments.
- *
- * `phantom_route_hints` parameter:
- * * Contains channel info for all nodes participating in the phantom invoice
- * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
- *   participating node
- * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
- *   updated when a channel becomes disabled or closes
- * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
- *   may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
- *   down
- *
- * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
- * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
- * If `None` is provided for `payment_hash`, then one will be created.
- *
- * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
- * in excess of the current time.
- *
- * `duration_since_epoch` is the current time since epoch in seconds.
- *
- * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
- * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
- * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
- * confirmations during routing.
- *
- * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
- * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
- * requirement).
- *
- * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
- * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
- * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
- * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
- * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
- * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
- *
- * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
- * available and the current time is supplied by the caller.
- */
-struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch);
-
-/**
- * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
- * See [`PhantomKeysManager`] for more information on phantom node payments.
- *
- * `phantom_route_hints` parameter:
- * * Contains channel info for all nodes participating in the phantom invoice
- * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
- *   participating node
- * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
- *   updated when a channel becomes disabled or closes
- * * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum
- *   of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected
- *   in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node
- *   until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as
- *   desired, but note that some nodes will be trimmed if more than 3 nodes are provided.
- *
- * `description_hash` is a SHA-256 hash of the description text
- *
- * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
- * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
- * If `None` is provided for `payment_hash`, then one will be created.
- *
- * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
- * in excess of the current time.
- *
- * `duration_since_epoch` is the current time since epoch in seconds.
- *
- * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
- * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
- * requirement).
- *
- * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
- * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
- * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
- * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
- * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
- *
- * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
- * available and the current time is supplied by the caller.
- */
-struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKCOption_ThirtyTwoBytesZ payment_hash, uint32_t invoice_expiry_delta_secs, struct LDKSha256 description_hash, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch);
-
-/**
- * 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
- * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
- * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
- * that the payment secret is valid when the invoice is paid.
- *
- * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
- * in excess of the current time.
- *
- * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
- * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
- * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
- * confirmations during routing.
- *
- * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
- */
-struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
-
-/**
- * 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
- * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
- * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
- * that the payment secret is valid when the invoice is paid.
- * Use this variant if you want to pass the `description_hash` to the invoice.
- *
- * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
- * in excess of the current time.
- *
- * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
- * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
- * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
- * confirmations during routing.
- *
- * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
- */
-struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
-
-/**
- * See [`create_invoice_from_channelmanager_with_description_hash`]
- * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
- * available and the current time is supplied by the caller.
- */
-struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
-
-/**
- * See [`create_invoice_from_channelmanager`]
- * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
- * available and the current time is supplied by the caller.
- */
-struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
-
-/**
- * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
- * This version allows for providing a custom [`PaymentHash`] for the invoice.
- * This may be useful if you're building an on-chain swap or involving another protocol where
- * the payment hash is also involved outside the scope of lightning.
- */
-struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
-
 /**
  * Read a SiPrefix object from a string
  */