+ * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_RouteHintHopDecodeErrorZ;
+
+/**
+ * Some information provided on receipt of payment depends on whether the payment received is a
+ * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
+ */
+typedef enum LDKPaymentPurpose_Tag {
+ /**
+ * Information for receiving a payment that we generated an invoice for.
+ */
+ LDKPaymentPurpose_InvoicePayment,
+ /**
+ * Because this is a spontaneous payment, the payer generated their own preimage rather than us
+ * (the payee) providing a preimage.
+ */
+ LDKPaymentPurpose_SpontaneousPayment,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKPaymentPurpose_Sentinel,
+} LDKPaymentPurpose_Tag;
+
+typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
+ /**
+ * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
+ * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
+ * [`ChannelManager::claim_funds`].
+ *
+ * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
+ * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKThirtyTwoBytes payment_preimage;
+ /**
+ * The \"payment secret\". This authenticates the sender to the recipient, preventing a
+ * number of deanonymization attacks during the routing process.
+ * It is provided here for your reference, however its accuracy is enforced directly by
+ * [`ChannelManager`] using the values you previously provided to
+ * [`ChannelManager::create_inbound_payment`] or
+ * [`ChannelManager::create_inbound_payment_for_hash`].
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
+ * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
+ */
+ struct LDKThirtyTwoBytes payment_secret;
+} LDKPaymentPurpose_LDKInvoicePayment_Body;
+
+typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
+ LDKPaymentPurpose_Tag tag;
+ union {
+ LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
+ struct {
+ struct LDKThirtyTwoBytes spontaneous_payment;
+ };
+ };
+} LDKPaymentPurpose;
+
+/**
+ * The contents of CResult_PaymentPurposeDecodeErrorZ
+ */
+typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKPaymentPurpose *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_PaymentPurposeDecodeErrorZPtr;
+
+/**
+ * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::util::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
+ /**
+ * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_PaymentPurposeDecodeErrorZ;
+
+/**
+ * The reason the channel was closed. See individual variants more details.
+ */
+typedef enum LDKClosureReason_Tag {
+ /**
+ * Closure generated from receiving a peer error message.
+ *
+ * Our counterparty may have broadcasted their latest commitment state, and we have
+ * as well.
+ */
+ LDKClosureReason_CounterpartyForceClosed,
+ /**
+ * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
+ *
+ * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
+ */
+ LDKClosureReason_HolderForceClosed,
+ /**
+ * The channel was closed after negotiating a cooperative close and we've now broadcasted
+ * the cooperative close transaction. Note the shutdown may have been initiated by us.
+ */
+ LDKClosureReason_CooperativeClosure,
+ /**
+ * A commitment transaction was confirmed on chain, closing the channel. Most likely this
+ * commitment transaction came from our counterparty, but it may also have come from
+ * a copy of our own `ChannelMonitor`.
+ */
+ LDKClosureReason_CommitmentTxConfirmed,
+ /**
+ * The funding transaction failed to confirm in a timely manner on an inbound channel.
+ */
+ LDKClosureReason_FundingTimedOut,
+ /**
+ * Closure generated from processing an event, likely a HTLC forward/relay/reception.
+ */
+ LDKClosureReason_ProcessingError,
+ /**
+ * The peer disconnected prior to funding completing. In this case the spec mandates that we
+ * forget the channel entirely - we can attempt again if the peer reconnects.
+ *
+ * This includes cases where we restarted prior to funding completion, including prior to the
+ * initial [`ChannelMonitor`] persistence completing.
+ *
+ * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
+ * peer because of mutual incompatibility between us and our channel counterparty.
+ *
+ * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
+ */
+ LDKClosureReason_DisconnectedPeer,
+ /**
+ * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
+ * the [`ChannelManager`] deserialized.
+ *
+ * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ */
+ LDKClosureReason_OutdatedChannelManager,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKClosureReason_Sentinel,
+} LDKClosureReason_Tag;
+
+typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
+ /**
+ * The error which the peer sent us.
+ *
+ * The string should be sanitized before it is used (e.g emitted to logs
+ * or printed to stdout). Otherwise, a well crafted error message may exploit
+ * a security vulnerability in the terminal emulator or the logging subsystem.
+ */
+ struct LDKStr peer_msg;
+} LDKClosureReason_LDKCounterpartyForceClosed_Body;
+
+typedef struct LDKClosureReason_LDKProcessingError_Body {
+ /**
+ * A developer-readable error message which we generated.
+ */
+ struct LDKStr err;
+} LDKClosureReason_LDKProcessingError_Body;
+
+typedef struct MUST_USE_STRUCT LDKClosureReason {
+ LDKClosureReason_Tag tag;
+ union {
+ LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
+ LDKClosureReason_LDKProcessingError_Body processing_error;
+ };
+} LDKClosureReason;
+
+/**
+ * An enum which can either contain a crate::lightning::util::events::ClosureReason or not
+ */
+typedef enum LDKCOption_ClosureReasonZ_Tag {
+ /**
+ * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::util::events::ClosureReason
+ */
+ LDKCOption_ClosureReasonZ_Some,
+ /**
+ * When we're in this state, this COption_ClosureReasonZ contains nothing
+ */
+ LDKCOption_ClosureReasonZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_ClosureReasonZ_Sentinel,
+} LDKCOption_ClosureReasonZ_Tag;
+
+typedef struct LDKCOption_ClosureReasonZ {
+ LDKCOption_ClosureReasonZ_Tag tag;
+ union {
+ struct {
+ struct LDKClosureReason some;
+ };
+ };
+} LDKCOption_ClosureReasonZ;
+
+/**
+ * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
+ */
+typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCOption_ClosureReasonZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
+
+/**
+ * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
+ /**
+ * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_COption_ClosureReasonZDecodeErrorZ;
+
+/**
+ * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
+ */
+typedef enum LDKHTLCDestination_Tag {
+ /**
+ * We tried forwarding to a channel but failed to do so. An example of such an instance is when
+ * there is insufficient capacity in our outbound channel.
+ */
+ LDKHTLCDestination_NextHopChannel,
+ /**
+ * Scenario where we are unsure of the next node to forward the HTLC to.
+ */
+ LDKHTLCDestination_UnknownNextHop,
+ /**
+ * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
+ * intercept HTLC.
+ */
+ LDKHTLCDestination_InvalidForward,
+ /**
+ * 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
+ * * Expected MPP amount to claim does not equal HTLC total
+ * * Claimable amount does not match expected amount
+ */
+ LDKHTLCDestination_FailedPayment,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKHTLCDestination_Sentinel,
+} LDKHTLCDestination_Tag;
+
+typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
+ /**
+ * The `node_id` of the next node. For backwards compatibility, this field is
+ * marked as optional, versions prior to 0.0.110 may not always be able to provide
+ * counterparty node information.
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The outgoing `channel_id` between us and the next node.
+ */
+ struct LDKThirtyTwoBytes channel_id;
+} LDKHTLCDestination_LDKNextHopChannel_Body;
+
+typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
+ /**
+ * Short channel id we are requesting to forward an HTLC to.
+ */
+ uint64_t requested_forward_scid;
+} LDKHTLCDestination_LDKUnknownNextHop_Body;
+
+typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
+ /**
+ * Short channel id we are requesting to forward an HTLC to.
+ */
+ uint64_t requested_forward_scid;
+} LDKHTLCDestination_LDKInvalidForward_Body;
+
+typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
+ /**
+ * The payment hash of the payment we attempted to process.
+ */
+ struct LDKThirtyTwoBytes payment_hash;
+} LDKHTLCDestination_LDKFailedPayment_Body;
+
+typedef struct MUST_USE_STRUCT LDKHTLCDestination {
+ LDKHTLCDestination_Tag tag;
+ union {
+ LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
+ LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
+ LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
+ LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
+ };
+} LDKHTLCDestination;
+
+/**
+ * An enum which can either contain a crate::lightning::util::events::HTLCDestination or not
+ */
+typedef enum LDKCOption_HTLCDestinationZ_Tag {
+ /**
+ * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::util::events::HTLCDestination
+ */
+ LDKCOption_HTLCDestinationZ_Some,
+ /**
+ * When we're in this state, this COption_HTLCDestinationZ contains nothing
+ */
+ LDKCOption_HTLCDestinationZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_HTLCDestinationZ_Sentinel,
+} LDKCOption_HTLCDestinationZ_Tag;
+
+typedef struct LDKCOption_HTLCDestinationZ {
+ LDKCOption_HTLCDestinationZ_Tag tag;
+ union {
+ struct {
+ struct LDKHTLCDestination some;
+ };
+ };
+} LDKCOption_HTLCDestinationZ;
+
+/**
+ * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
+ */
+typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCOption_HTLCDestinationZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
+
+/**
+ * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
+ /**
+ * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
+
+/**
+ * An enum which can either contain a crate::c_types::U128 or not
+ */
+typedef enum LDKCOption_u128Z_Tag {
+ /**
+ * When we're in this state, this COption_u128Z contains a crate::c_types::U128
+ */
+ LDKCOption_u128Z_Some,
+ /**
+ * When we're in this state, this COption_u128Z contains nothing
+ */
+ LDKCOption_u128Z_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_u128Z_Sentinel,
+} LDKCOption_u128Z_Tag;
+
+typedef struct LDKCOption_u128Z {
+ LDKCOption_u128Z_Tag tag;
+ union {
+ struct {
+ struct LDKU128 some;
+ };
+ };
+} LDKCOption_u128Z;
+
+
+
+/**
+ * A channel_update message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKChannelUpdate {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeChannelUpdate *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKChannelUpdate;
+
+/**
+ * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
+ * return packet by a node along the route. See [BOLT #4] for details.
+ *
+ * [BOLT #4]: https://github.com/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`].
+ */
+ LDKNetworkUpdate_ChannelFailure,
+ /**
+ * An error indicating that a node failed to route a payment, which should be applied via
+ * [`NetworkGraph::node_failed_permanent`] if permanent.
+ */
+ LDKNetworkUpdate_NodeFailure,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKNetworkUpdate_Sentinel,
+} LDKNetworkUpdate_Tag;
+
+typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
+ /**
+ * The update to apply via [`NetworkGraph::update_channel`].
+ */
+ struct LDKChannelUpdate msg;
+} LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
+
+typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
+ /**
+ * The short channel id of the closed channel.
+ */
+ uint64_t short_channel_id;
+ /**
+ * Whether the channel should be permanently removed or temporarily disabled until a new
+ * `channel_update` message is received.
+ */
+ bool is_permanent;
+} LDKNetworkUpdate_LDKChannelFailure_Body;
+
+typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
+ /**
+ * The node id of the failed node.
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * Whether the node should be permanently removed from consideration or can be restored
+ * when a new `channel_update` message is received.
+ */
+ bool is_permanent;
+} LDKNetworkUpdate_LDKNodeFailure_Body;
+
+typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
+ LDKNetworkUpdate_Tag tag;
+ union {
+ LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
+ LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
+ LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
+ };
+} LDKNetworkUpdate;
+
+/**
+ * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
+ */
+typedef enum LDKCOption_NetworkUpdateZ_Tag {
+ /**
+ * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
+ */
+ LDKCOption_NetworkUpdateZ_Some,
+ /**
+ * When we're in this state, this COption_NetworkUpdateZ contains nothing
+ */
+ LDKCOption_NetworkUpdateZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_NetworkUpdateZ_Sentinel,
+} LDKCOption_NetworkUpdateZ_Tag;
+
+typedef struct LDKCOption_NetworkUpdateZ {
+ LDKCOption_NetworkUpdateZ_Tag tag;
+ union {
+ struct {
+ struct LDKNetworkUpdate some;
+ };
+ };
+} LDKCOption_NetworkUpdateZ;
+
+
+
+/**
+ * A reference to a transaction output.
+ *
+ * Differs from bitcoin::blockdata::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 {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeOutPoint *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;
+} LDKOutPoint;
+
+
+
+/**
+ * Information about a spendable output to a P2WSH script.
+ *
+ * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
+ */
+typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeDelayedPaymentOutputDescriptor *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;
+} LDKDelayedPaymentOutputDescriptor;
+
+
+
+/**
+ * Information about a spendable output to our \"payment key\".
+ *
+ * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this.
+ */
+typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeStaticPaymentOutputDescriptor *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;
+} LDKStaticPaymentOutputDescriptor;
+
+/**
+ * Describes the necessary information to spend a spendable output.
+ *
+ * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any
+ * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able
+ * to spend on-chain. The information needed to do this is provided in this enum, including the
+ * outpoint describing which `txid` and output `index` is available, the full output which exists
+ * at that `txid`/`index`, and any keys or other information required to sign.
+ *
+ * [`SpendableOutputs`]: crate::util::events::Event::SpendableOutputs
+ */
+typedef enum LDKSpendableOutputDescriptor_Tag {
+ /**
+ * An output to a script which was provided via [`KeysInterface`] directly, either from
+ * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already
+ * know how to spend it. No secret keys are provided as LDK was never given any key.
+ * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
+ * on-chain using the payment preimage or after it has timed out.
+ *
+ * [`get_shutdown_scriptpubkey`]: KeysInterface::get_shutdown_scriptpubkey
+ * [`get_destination_script`]: KeysInterface::get_shutdown_scriptpubkey
+ */
+ LDKSpendableOutputDescriptor_StaticOutput,
+ /**
+ * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
+ * delay.
+ *
+ * The witness in the spending input should be:
+ * ```bitcoin
+ * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
+ * ```
+ *
+ * Note that the `nSequence` field in the spending input must be set to
+ * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not
+ * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after
+ * the outpoint confirms, see [BIP
+ * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK
+ * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height
+ * is reached.
+ *
+ * These are generally the result of a \"revocable\" output to us, spendable only by us unless
+ * it is an output from an old state which we broadcast (which should never happen).
+ *
+ * To derive the delayed payment key which is used to sign this input, you must pass the
+ * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
+ * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`BaseSign::pubkeys`]) and the provided
+ * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The public key can be
+ * generated without the secret key using [`chan_utils::derive_public_key`] and only the
+ * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`BaseSign::pubkeys`].
+ *
+ * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
+ * used in the witness script generation), you must pass the counterparty
+ * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
+ * [`BaseSign::provide_channel_parameters`]) and the provided
+ * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
+ * [`chan_utils::derive_public_revocation_key`].
+ *
+ * The witness script which is hashed and included in the output `script_pubkey` may be
+ * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
+ * as explained above), our delayed payment pubkey (derived as explained above), and the
+ * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to
+ * [`chan_utils::get_revokeable_redeemscript`].
+ */
+ LDKSpendableOutputDescriptor_DelayedPaymentOutput,
+ /**
+ * An output to a P2WPKH, spendable exclusively by our payment key (i.e., the private key
+ * which corresponds to the `payment_point` in [`BaseSign::pubkeys`]). The witness
+ * in the spending input is, thus, simply:
+ * ```bitcoin
+ * <BIP 143 signature> <payment key>
+ * ```
+ *
+ * These are generally the result of our counterparty having broadcast the current state,
+ * allowing us to claim the non-HTLC-encumbered outputs immediately.
+ */
+ LDKSpendableOutputDescriptor_StaticPaymentOutput,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKSpendableOutputDescriptor_Sentinel,
+} LDKSpendableOutputDescriptor_Tag;
+
+typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
+ /**
+ * The outpoint which is spendable.
+ */
+ struct LDKOutPoint outpoint;
+ /**
+ * The output which is referenced by the given outpoint.
+ */
+ struct LDKTxOut output;
+} LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
+
+typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
+ LDKSpendableOutputDescriptor_Tag tag;
+ union {
+ LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
+ struct {
+ struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
+ };
+ struct {
+ struct LDKStaticPaymentOutputDescriptor static_payment_output;
+ };
+ };
+} LDKSpendableOutputDescriptor;
+
+/**
+ * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_SpendableOutputDescriptorZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKSpendableOutputDescriptor *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_SpendableOutputDescriptorZ;
+
+
+
+/**
+ * Features used within the channel_type field in an OpenChannel message.
+ *
+ * A channel is always of some known \"type\", describing the transaction formats used and the exact
+ * semantics of our interaction with our peer.
+ *
+ * Note that because a channel is a specific type which is proposed by the opener and accepted by
+ * the counterparty, only required features are allowed here.
+ *
+ * This is serialized differently from other feature types - it is not prefixed by a length, and
+ * thus must only appear inside a TLV where its length is known in advance.
+ */
+typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.