#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
-#include <stdlib.h>
+
/**
* An error when accessing the chain via [`Access`].
LDKSecp256k1Error_InvalidSecretKey,
LDKSecp256k1Error_InvalidRecoveryId,
LDKSecp256k1Error_InvalidTweak,
+ LDKSecp256k1Error_TweakCheckFailed,
LDKSecp256k1Error_NotEnoughMemory,
- LDKSecp256k1Error_CallbackPanicked,
/**
* Must be last for serialization purposes
*/
uint64_t value;
} LDKTxOut;
+typedef struct LDKSecretKey {
+ uint8_t bytes[32];
+} LDKSecretKey;
+typedef union LDKCResult_SecretKeyErrorZPtr {
+ struct LDKSecretKey *result;
+ enum LDKSecp256k1Error *err;
+} LDKCResult_SecretKeyErrorZPtr;
-/**
- * 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 {
- /**
- * Nearly everywhere, 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;
- bool is_owned;
-} LDKOutPoint;
+typedef struct LDKCResult_SecretKeyErrorZ {
+ union LDKCResult_SecretKeyErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_SecretKeyErrorZ;
typedef struct LDKPublicKey {
uint8_t compressed_form[33];
} LDKPublicKey;
-typedef struct LDKC2Tuple_u64u64Z {
- uint64_t a;
- uint64_t b;
-} LDKC2Tuple_u64u64Z;
-
-/**
- * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
- * claim at any point in the future) an 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.
- */
-typedef enum LDKSpendableOutputDescriptor_Tag {
- /**
- * An output to a script which was provided via KeysInterface, thus you should already know
- * how to spend it. No keys are provided as rust-lightning was never given any keys - only the
- * script_pubkey as it appears in the output.
- * 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.
- */
- LDKSpendableOutputDescriptor_StaticOutput,
- /**
- * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
- *
- * The witness in the spending input should be:
- * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
- *
- * Note that the nSequence field in the spending input must be set to to_self_delay
- * (which means the transaction is not broadcastable until at least to_self_delay
- * blocks after the outpoint confirms).
- *
- * 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 for this input, you must pass the
- * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
- * ChannelKeys::pubkeys().delayed_payment_basepoint) and the provided 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 delayed_payment_basepoint which appears in
- * ChannelKeys::pubkeys().
- *
- * To derive the revocation_pubkey provided here (which is used in the witness
- * script generation), you must pass the counterparty revocation_basepoint (which appears in the
- * call to ChannelKeys::ready_channel) and the provided 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 revocation_pubkey (derived as above), our delayed_payment pubkey
- * (derived as above), and the to_self_delay contained here to
- * chan_utils::get_revokeable_redeemscript.
- */
- LDKSpendableOutputDescriptor_DynamicOutputP2WSH,
- /**
- * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
- * corresponds to the public key in ChannelKeys::pubkeys().payment_point).
- * The witness in the spending input, is, thus, simply:
- * <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_StaticOutputCounterpartyPayment,
- /**
- * Must be last for serialization purposes
- */
- LDKSpendableOutputDescriptor_Sentinel,
-} LDKSpendableOutputDescriptor_Tag;
-
-typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
- struct LDKOutPoint outpoint;
- struct LDKTxOut output;
-} LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
-
-typedef struct LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body {
- struct LDKOutPoint outpoint;
- struct LDKPublicKey per_commitment_point;
- uint16_t to_self_delay;
- struct LDKTxOut output;
- struct LDKC2Tuple_u64u64Z key_derivation_params;
- struct LDKPublicKey revocation_pubkey;
-} LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body;
-
-typedef struct LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body {
- struct LDKOutPoint outpoint;
- struct LDKTxOut output;
- struct LDKC2Tuple_u64u64Z key_derivation_params;
-} LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body;
-
-typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
- LDKSpendableOutputDescriptor_Tag tag;
- union {
- LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
- LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body dynamic_output_p2wsh;
- LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body static_output_counterparty_payment;
- };
-} LDKSpendableOutputDescriptor;
+typedef union LDKCResult_PublicKeyErrorZPtr {
+ struct LDKPublicKey *result;
+ enum LDKSecp256k1Error *err;
+} LDKCResult_PublicKeyErrorZPtr;
-typedef struct LDKCVec_SpendableOutputDescriptorZ {
- struct LDKSpendableOutputDescriptor *data;
- uintptr_t datalen;
-} LDKCVec_SpendableOutputDescriptorZ;
+typedef struct LDKCResult_PublicKeyErrorZ {
+ union LDKCResult_PublicKeyErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_PublicKeyErrorZ;
/**
- * An accept_channel message to be sent or received from a peer
+ * 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 LDKAcceptChannel {
+typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeAcceptChannel *inner;
+ LDKnativeTxCreationKeys *inner;
bool is_owned;
-} LDKAcceptChannel;
+} LDKTxCreationKeys;
/**
- * An open_channel message to be sent or received from a peer
+ * An error in decoding a message or struct.
*/
-typedef struct MUST_USE_STRUCT LDKOpenChannel {
+typedef struct MUST_USE_STRUCT LDKDecodeError {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeOpenChannel *inner;
+ LDKnativeDecodeError *inner;
bool is_owned;
-} LDKOpenChannel;
+} LDKDecodeError;
+
+typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
+ struct LDKTxCreationKeys *result;
+ struct LDKDecodeError *err;
+} LDKCResult_TxCreationKeysDecodeErrorZPtr;
+
+typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
+ union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_TxCreationKeysDecodeErrorZ;
/**
- * A funding_created message to be sent or received from a peer
+ * One counterparty's public keys which do not change over the life of a channel.
*/
-typedef struct MUST_USE_STRUCT LDKFundingCreated {
+typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeFundingCreated *inner;
+ LDKnativeChannelPublicKeys *inner;
bool is_owned;
-} LDKFundingCreated;
+} LDKChannelPublicKeys;
+
+typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
+ struct LDKChannelPublicKeys *result;
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
+
+typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
+ union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_ChannelPublicKeysDecodeErrorZ;
+
+typedef union LDKCResult_TxCreationKeysErrorZPtr {
+ struct LDKTxCreationKeys *result;
+ enum LDKSecp256k1Error *err;
+} LDKCResult_TxCreationKeysErrorZPtr;
+
+typedef struct LDKCResult_TxCreationKeysErrorZ {
+ union LDKCResult_TxCreationKeysErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_TxCreationKeysErrorZ;
/**
- * A funding_signed message to be sent or received from a peer
+ * Information about an HTLC as it appears in a commitment transaction
*/
-typedef struct MUST_USE_STRUCT LDKFundingSigned {
+typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeFundingSigned *inner;
+ LDKnativeHTLCOutputInCommitment *inner;
bool is_owned;
-} LDKFundingSigned;
+} LDKHTLCOutputInCommitment;
+
+typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
+ struct LDKHTLCOutputInCommitment *result;
+ struct LDKDecodeError *err;
+} LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
+
+typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
+ union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
/**
- * A funding_locked message to be sent or received from a peer
+ * Late-bound per-channel counterparty data used to build transactions.
*/
-typedef struct MUST_USE_STRUCT LDKFundingLocked {
+typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeFundingLocked *inner;
+ LDKnativeCounterpartyChannelTransactionParameters *inner;
bool is_owned;
-} LDKFundingLocked;
+} LDKCounterpartyChannelTransactionParameters;
+
+typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
+ struct LDKCounterpartyChannelTransactionParameters *result;
+ struct LDKDecodeError *err;
+} LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
+
+typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
+ union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
/**
- * An announcement_signatures message to be sent or received from a peer
+ * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
+ * The fields are organized by holder/counterparty.
+ *
+ * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
+ * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
*/
-typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
+typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeAnnouncementSignatures *inner;
+ LDKnativeChannelTransactionParameters *inner;
bool is_owned;
-} LDKAnnouncementSignatures;
+} LDKChannelTransactionParameters;
+
+typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
+ struct LDKChannelTransactionParameters *result;
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
+
+typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
+ union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_ChannelTransactionParametersDecodeErrorZ;
+
+typedef struct LDKSignature {
+ uint8_t compact_form[64];
+} LDKSignature;
+
+typedef struct LDKCVec_SignatureZ {
+ struct LDKSignature *data;
+ uintptr_t datalen;
+} LDKCVec_SignatureZ;
/**
- * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
- * transaction updates if they were pending.
+ * Information needed to build and sign a holder's commitment transaction.
+ *
+ * The transaction is only signed once we are ready to broadcast.
*/
-typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
+typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeCommitmentUpdate *inner;
+ LDKnativeHolderCommitmentTransaction *inner;
bool is_owned;
-} LDKCommitmentUpdate;
+} LDKHolderCommitmentTransaction;
+
+typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
+ struct LDKHolderCommitmentTransaction *result;
+ struct LDKDecodeError *err;
+} LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
+
+typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
+ union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
/**
- * A revoke_and_ack message to be sent or received from a peer
+ * A pre-built Bitcoin commitment transaction and its txid.
*/
-typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
+typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeRevokeAndACK *inner;
+ LDKnativeBuiltCommitmentTransaction *inner;
bool is_owned;
-} LDKRevokeAndACK;
+} LDKBuiltCommitmentTransaction;
+
+typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
+ struct LDKBuiltCommitmentTransaction *result;
+ struct LDKDecodeError *err;
+} LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
+
+typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
+ union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
/**
- * A closing_signed message to be sent or received from a peer
+ * This class tracks the per-transaction information needed to build a commitment transaction and to
+ * actually build it and sign. It is used for holder transactions that we sign only when needed
+ * and for transactions we sign for the counterparty.
+ *
+ * This class can be used inside a signer implementation to generate a signature given the relevant
+ * secret key.
*/
-typedef struct MUST_USE_STRUCT LDKClosingSigned {
+typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeClosingSigned *inner;
+ LDKnativeCommitmentTransaction *inner;
bool is_owned;
-} LDKClosingSigned;
+} LDKCommitmentTransaction;
+
+typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
+ struct LDKCommitmentTransaction *result;
+ struct LDKDecodeError *err;
+} LDKCResult_CommitmentTransactionDecodeErrorZPtr;
+
+typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
+ union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_CommitmentTransactionDecodeErrorZ;
/**
- * A shutdown message to be sent or received from a peer
+ * 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 LDKShutdown {
+typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeShutdown *inner;
+ LDKnativeTrustedCommitmentTransaction *inner;
bool is_owned;
-} LDKShutdown;
-
-
+} LDKTrustedCommitmentTransaction;
+
+typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
+ struct LDKTrustedCommitmentTransaction *result;
+ /**
+ * Note that this value is always NULL, as there are no contents in the Err variant
+ */
+ void *err;
+} LDKCResult_TrustedCommitmentTransactionNoneZPtr;
+
+typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
+ union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
+ bool result_ok;
+} LDKCResult_TrustedCommitmentTransactionNoneZ;
+
+typedef union LDKCResult_CVec_SignatureZNoneZPtr {
+ struct LDKCVec_SignatureZ *result;
+ /**
+ * Note that this value is always NULL, as there are no contents in the Err variant
+ */
+ void *err;
+} LDKCResult_CVec_SignatureZNoneZPtr;
+
+typedef struct LDKCResult_CVec_SignatureZNoneZ {
+ union LDKCResult_CVec_SignatureZNoneZPtr contents;
+ bool result_ok;
+} LDKCResult_CVec_SignatureZNoneZ;
+
+typedef struct LDKCVec_PublicKeyZ {
+ struct LDKPublicKey *data;
+ uintptr_t datalen;
+} LDKCVec_PublicKeyZ;
+
+
/**
- * A channel_reestablish message to be sent or received from a peer
+ * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
+ * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
+ * descriptor.
*/
-typedef struct MUST_USE_STRUCT LDKChannelReestablish {
+typedef struct MUST_USE_STRUCT LDKPeerHandleError {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeChannelReestablish *inner;
+ LDKnativePeerHandleError *inner;
bool is_owned;
-} LDKChannelReestablish;
+} LDKPeerHandleError;
+
+typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
+ struct LDKCVec_u8Z *result;
+ struct LDKPeerHandleError *err;
+} LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
+
+typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
+ union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_CVec_u8ZPeerHandleErrorZ;
+
+typedef union LDKCResult_NonePeerHandleErrorZPtr {
+ /**
+ * Note that this value is always NULL, as there are no contents in the OK variant
+ */
+ void *result;
+ struct LDKPeerHandleError *err;
+} LDKCResult_NonePeerHandleErrorZPtr;
+
+typedef struct LDKCResult_NonePeerHandleErrorZ {
+ union LDKCResult_NonePeerHandleErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_NonePeerHandleErrorZ;
+
+typedef union LDKCResult_boolPeerHandleErrorZPtr {
+ bool *result;
+ struct LDKPeerHandleError *err;
+} LDKCResult_boolPeerHandleErrorZPtr;
+
+typedef struct LDKCResult_boolPeerHandleErrorZ {
+ union LDKCResult_boolPeerHandleErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_boolPeerHandleErrorZ;
/**
- * A channel_announcement message to be sent or received from a peer
+ * Features used within an `init` message.
*/
-typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
+typedef struct MUST_USE_STRUCT LDKInitFeatures {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeChannelAnnouncement *inner;
+ LDKnativeInitFeatures *inner;
bool is_owned;
-} LDKChannelAnnouncement;
+} LDKInitFeatures;
+
+typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
+ struct LDKInitFeatures *result;
+ struct LDKDecodeError *err;
+} LDKCResult_InitFeaturesDecodeErrorZPtr;
+
+typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
+ union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_InitFeaturesDecodeErrorZ;
/**
- * A channel_update message to be sent or received from a peer
+ * Features used within a `node_announcement` message.
*/
-typedef struct MUST_USE_STRUCT LDKChannelUpdate {
+typedef struct MUST_USE_STRUCT LDKNodeFeatures {
/**
* Nearly everywhere, 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;
+ LDKnativeNodeFeatures *inner;
bool is_owned;
-} LDKChannelUpdate;
+} LDKNodeFeatures;
+
+typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
+ struct LDKNodeFeatures *result;
+ struct LDKDecodeError *err;
+} LDKCResult_NodeFeaturesDecodeErrorZPtr;
+
+typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
+ union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_NodeFeaturesDecodeErrorZ;
/**
- * A node_announcement message to be sent or received from a peer
+ * Features used within a `channel_announcement` message.
*/
-typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
+typedef struct MUST_USE_STRUCT LDKChannelFeatures {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeNodeAnnouncement *inner;
+ LDKnativeChannelFeatures *inner;
bool is_owned;
-} LDKNodeAnnouncement;
+} LDKChannelFeatures;
+
+typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
+ struct LDKChannelFeatures *result;
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelFeaturesDecodeErrorZPtr;
+
+typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
+ union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_ChannelFeaturesDecodeErrorZ;
/**
- * An error message to be sent or received from a peer
+ * Options which apply on a per-channel basis and may change at runtime or based on negotiation
+ * with our counterparty.
*/
-typedef struct MUST_USE_STRUCT LDKErrorMessage {
+typedef struct MUST_USE_STRUCT LDKChannelConfig {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeErrorMessage *inner;
+ LDKnativeChannelConfig *inner;
bool is_owned;
-} LDKErrorMessage;
+} LDKChannelConfig;
-/**
- * Used to put an error message in a LightningError
- */
-typedef enum LDKErrorAction_Tag {
- /**
- * The peer took some action which made us think they were useless. Disconnect them.
- */
- LDKErrorAction_DisconnectPeer,
- /**
- * The peer did something harmless that we weren't able to process, just log and ignore
- */
- LDKErrorAction_IgnoreError,
- /**
- * The peer did something incorrect. Tell them.
- */
- LDKErrorAction_SendErrorMessage,
- /**
- * Must be last for serialization purposes
- */
- LDKErrorAction_Sentinel,
-} LDKErrorAction_Tag;
+typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
+ struct LDKChannelConfig *result;
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelConfigDecodeErrorZPtr;
-typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
- struct LDKErrorMessage msg;
-} LDKErrorAction_LDKDisconnectPeer_Body;
+typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
+ union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_ChannelConfigDecodeErrorZ;
-typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
- struct LDKErrorMessage msg;
-} LDKErrorAction_LDKSendErrorMessage_Body;
-typedef struct MUST_USE_STRUCT LDKErrorAction {
- LDKErrorAction_Tag tag;
- union {
- LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
- LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
- };
-} LDKErrorAction;
/**
- * The information we received from a peer along the route of a payment we originated. This is
- * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
- * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
+ * An Err type for failure to process messages.
*/
-typedef enum LDKHTLCFailChannelUpdate_Tag {
- /**
- * We received an error which included a full ChannelUpdate message.
- */
- LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
- /**
- * We received an error which indicated only that a channel has been closed
- */
- LDKHTLCFailChannelUpdate_ChannelClosed,
- /**
- * We received an error which indicated only that a node has failed
- */
- LDKHTLCFailChannelUpdate_NodeFailure,
+typedef struct MUST_USE_STRUCT LDKLightningError {
/**
- * Must be last for serialization purposes
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKHTLCFailChannelUpdate_Sentinel,
-} LDKHTLCFailChannelUpdate_Tag;
-
-typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
- struct LDKChannelUpdate msg;
-} LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
-
-typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
- uint64_t short_channel_id;
- bool is_permanent;
-} LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
+ LDKnativeLightningError *inner;
+ bool is_owned;
+} LDKLightningError;
-typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
- struct LDKPublicKey node_id;
- bool is_permanent;
-} LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
+typedef union LDKCResult_boolLightningErrorZPtr {
+ bool *result;
+ struct LDKLightningError *err;
+} LDKCResult_boolLightningErrorZPtr;
-typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
- LDKHTLCFailChannelUpdate_Tag tag;
- union {
- LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
- LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
- LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
- };
-} LDKHTLCFailChannelUpdate;
+typedef struct LDKCResult_boolLightningErrorZ {
+ union LDKCResult_boolLightningErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_boolLightningErrorZ;
/**
- * A query_channel_range message is used to query a peer for channel
- * UTXOs in a range of blocks. The recipient of a query makes a best
- * effort to reply to the query using one or more reply_channel_range
- * messages.
+ * A channel_announcement message to be sent or received from a peer
*/
-typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
+typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeQueryChannelRange *inner;
+ LDKnativeChannelAnnouncement *inner;
bool is_owned;
-} LDKQueryChannelRange;
+} LDKChannelAnnouncement;
/**
- * A query_short_channel_ids message is used to query a peer for
- * routing gossip messages related to one or more short_channel_ids.
- * The query recipient will reply with the latest, if available,
- * channel_announcement, channel_update and node_announcement messages
- * it maintains for the requested short_channel_ids followed by a
- * reply_short_channel_ids_end message. The short_channel_ids sent in
- * this query are encoded. We only support encoding_type=0 uncompressed
- * serialization and do not support encoding_type=1 zlib serialization.
+ * A channel_update message to be sent or received from a peer
*/
-typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
+typedef struct MUST_USE_STRUCT LDKChannelUpdate {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeQueryShortChannelIds *inner;
+ LDKnativeChannelUpdate *inner;
bool is_owned;
-} LDKQueryShortChannelIds;
+} LDKChannelUpdate;
+
+typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
+ struct LDKChannelAnnouncement a;
+ struct LDKChannelUpdate b;
+ struct LDKChannelUpdate c;
+} LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
+
+typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
+ struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
+ uintptr_t datalen;
+} LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
+
+
/**
- * An event generated by ChannelManager which indicates a message should be sent to a peer (or
- * broadcast to most peers).
- * These events are handled by PeerManager::process_events if you are using a PeerManager.
+ * A node_announcement message to be sent or received from a peer
*/
-typedef enum LDKMessageSendEvent_Tag {
+typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
/**
- * Used to indicate that we've accepted a channel open and should send the accept_channel
- * message provided to the given peer.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKMessageSendEvent_SendAcceptChannel,
+ LDKnativeNodeAnnouncement *inner;
+ bool is_owned;
+} LDKNodeAnnouncement;
+
+typedef struct LDKCVec_NodeAnnouncementZ {
+ struct LDKNodeAnnouncement *data;
+ uintptr_t datalen;
+} LDKCVec_NodeAnnouncementZ;
+
+typedef union LDKCResult_NoneLightningErrorZPtr {
/**
- * Used to indicate that we've initiated a channel open and should send the open_channel
- * message provided to the given peer.
+ * Note that this value is always NULL, as there are no contents in the OK variant
*/
- LDKMessageSendEvent_SendOpenChannel,
+ void *result;
+ struct LDKLightningError *err;
+} LDKCResult_NoneLightningErrorZPtr;
+
+typedef struct LDKCResult_NoneLightningErrorZ {
+ union LDKCResult_NoneLightningErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_NoneLightningErrorZ;
+
+
+
+/**
+ * An accept_channel message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKAcceptChannel {
/**
- * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKMessageSendEvent_SendFundingCreated,
+ LDKnativeAcceptChannel *inner;
+ bool is_owned;
+} LDKAcceptChannel;
+
+
+
+/**
+ * An open_channel message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKOpenChannel {
/**
- * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKMessageSendEvent_SendFundingSigned,
+ LDKnativeOpenChannel *inner;
+ bool is_owned;
+} LDKOpenChannel;
+
+
+
+/**
+ * A funding_created message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKFundingCreated {
/**
- * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKMessageSendEvent_SendFundingLocked,
+ LDKnativeFundingCreated *inner;
+ bool is_owned;
+} LDKFundingCreated;
+
+
+
+/**
+ * A funding_signed message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKFundingSigned {
/**
- * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKMessageSendEvent_SendAnnouncementSignatures,
+ LDKnativeFundingSigned *inner;
+ bool is_owned;
+} LDKFundingSigned;
+
+
+
+/**
+ * A funding_locked message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKFundingLocked {
/**
- * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
- * message should be sent to the peer with the given node_id.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKMessageSendEvent_UpdateHTLCs,
+ LDKnativeFundingLocked *inner;
+ bool is_owned;
+} LDKFundingLocked;
+
+
+
+/**
+ * An announcement_signatures message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
/**
- * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKMessageSendEvent_SendRevokeAndACK,
+ LDKnativeAnnouncementSignatures *inner;
+ bool is_owned;
+} LDKAnnouncementSignatures;
+
+
+
+/**
+ * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
+ * transaction updates if they were pending.
+ */
+typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
/**
- * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKMessageSendEvent_SendClosingSigned,
+ LDKnativeCommitmentUpdate *inner;
+ bool is_owned;
+} LDKCommitmentUpdate;
+
+
+
+/**
+ * A revoke_and_ack message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
/**
- * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKMessageSendEvent_SendShutdown,
+ LDKnativeRevokeAndACK *inner;
+ bool is_owned;
+} LDKRevokeAndACK;
+
+
+
+/**
+ * A closing_signed message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKClosingSigned {
/**
- * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKMessageSendEvent_SendChannelReestablish,
+ LDKnativeClosingSigned *inner;
+ bool is_owned;
+} LDKClosingSigned;
+
+
+
+/**
+ * A shutdown message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKShutdown {
/**
- * Used to indicate that a channel_announcement and channel_update should be broadcast to all
- * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
- *
- * Note that after doing so, you very likely (unless you did so very recently) want to call
- * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
- * This ensures that any nodes which see our channel_announcement also have a relevant
- * node_announcement, including relevant feature flags which may be important for routing
- * through or to us.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKMessageSendEvent_BroadcastChannelAnnouncement,
+ LDKnativeShutdown *inner;
+ bool is_owned;
+} LDKShutdown;
+
+
+
+/**
+ * A channel_reestablish message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKChannelReestablish {
/**
- * Used to indicate that a node_announcement should be broadcast to all peers.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKMessageSendEvent_BroadcastNodeAnnouncement,
+ LDKnativeChannelReestablish *inner;
+ bool is_owned;
+} LDKChannelReestablish;
+
+
+
+/**
+ * An error message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKErrorMessage {
/**
- * Used to indicate that a channel_update should be broadcast to all peers.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKMessageSendEvent_BroadcastChannelUpdate,
+ LDKnativeErrorMessage *inner;
+ bool is_owned;
+} LDKErrorMessage;
+
+/**
+ * Used to put an error message in a LightningError
+ */
+typedef enum LDKErrorAction_Tag {
/**
- * Broadcast an error downstream to be handled
+ * The peer took some action which made us think they were useless. Disconnect them.
*/
- LDKMessageSendEvent_HandleError,
+ LDKErrorAction_DisconnectPeer,
+ /**
+ * The peer did something harmless that we weren't able to process, just log and ignore
+ */
+ LDKErrorAction_IgnoreError,
+ /**
+ * The peer did something incorrect. Tell them.
+ */
+ LDKErrorAction_SendErrorMessage,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKErrorAction_Sentinel,
+} LDKErrorAction_Tag;
+
+typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
+ struct LDKErrorMessage msg;
+} LDKErrorAction_LDKDisconnectPeer_Body;
+
+typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
+ struct LDKErrorMessage msg;
+} LDKErrorAction_LDKSendErrorMessage_Body;
+
+typedef struct MUST_USE_STRUCT LDKErrorAction {
+ LDKErrorAction_Tag tag;
+ union {
+ LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
+ LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
+ };
+} LDKErrorAction;
+
+/**
+ * The information we received from a peer along the route of a payment we originated. This is
+ * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
+ * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
+ */
+typedef enum LDKHTLCFailChannelUpdate_Tag {
+ /**
+ * We received an error which included a full ChannelUpdate message.
+ */
+ LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
+ /**
+ * We received an error which indicated only that a channel has been closed
+ */
+ LDKHTLCFailChannelUpdate_ChannelClosed,
+ /**
+ * We received an error which indicated only that a node has failed
+ */
+ LDKHTLCFailChannelUpdate_NodeFailure,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKHTLCFailChannelUpdate_Sentinel,
+} LDKHTLCFailChannelUpdate_Tag;
+
+typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
+ struct LDKChannelUpdate msg;
+} LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
+
+typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
+ uint64_t short_channel_id;
+ bool is_permanent;
+} LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
+
+typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
+ struct LDKPublicKey node_id;
+ bool is_permanent;
+} LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
+
+typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
+ LDKHTLCFailChannelUpdate_Tag tag;
+ union {
+ LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
+ LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
+ LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
+ };
+} LDKHTLCFailChannelUpdate;
+
+
+
+/**
+ * A query_channel_range message is used to query a peer for channel
+ * UTXOs in a range of blocks. The recipient of a query makes a best
+ * effort to reply to the query using one or more reply_channel_range
+ * messages.
+ */
+typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
+ /**
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeQueryChannelRange *inner;
+ bool is_owned;
+} LDKQueryChannelRange;
+
+
+
+/**
+ * A query_short_channel_ids message is used to query a peer for
+ * routing gossip messages related to one or more short_channel_ids.
+ * The query recipient will reply with the latest, if available,
+ * channel_announcement, channel_update and node_announcement messages
+ * it maintains for the requested short_channel_ids followed by a
+ * reply_short_channel_ids_end message. The short_channel_ids sent in
+ * this query are encoded. We only support encoding_type=0 uncompressed
+ * serialization and do not support encoding_type=1 zlib serialization.
+ */
+typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
+ /**
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeQueryShortChannelIds *inner;
+ bool is_owned;
+} LDKQueryShortChannelIds;
+
+/**
+ * An event generated by ChannelManager which indicates a message should be sent to a peer (or
+ * broadcast to most peers).
+ * These events are handled by PeerManager::process_events if you are using a PeerManager.
+ */
+typedef enum LDKMessageSendEvent_Tag {
+ /**
+ * Used to indicate that we've accepted a channel open and should send the accept_channel
+ * message provided to the given peer.
+ */
+ LDKMessageSendEvent_SendAcceptChannel,
+ /**
+ * Used to indicate that we've initiated a channel open and should send the open_channel
+ * message provided to the given peer.
+ */
+ LDKMessageSendEvent_SendOpenChannel,
+ /**
+ * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
+ */
+ LDKMessageSendEvent_SendFundingCreated,
+ /**
+ * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
+ */
+ LDKMessageSendEvent_SendFundingSigned,
+ /**
+ * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
+ */
+ LDKMessageSendEvent_SendFundingLocked,
+ /**
+ * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
+ */
+ LDKMessageSendEvent_SendAnnouncementSignatures,
+ /**
+ * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
+ * message should be sent to the peer with the given node_id.
+ */
+ LDKMessageSendEvent_UpdateHTLCs,
+ /**
+ * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
+ */
+ LDKMessageSendEvent_SendRevokeAndACK,
+ /**
+ * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
+ */
+ LDKMessageSendEvent_SendClosingSigned,
+ /**
+ * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
+ */
+ LDKMessageSendEvent_SendShutdown,
+ /**
+ * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
+ */
+ LDKMessageSendEvent_SendChannelReestablish,
+ /**
+ * Used to indicate that a channel_announcement and channel_update should be broadcast to all
+ * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
+ *
+ * Note that after doing so, you very likely (unless you did so very recently) want to call
+ * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
+ * This ensures that any nodes which see our channel_announcement also have a relevant
+ * node_announcement, including relevant feature flags which may be important for routing
+ * through or to us.
+ */
+ LDKMessageSendEvent_BroadcastChannelAnnouncement,
+ /**
+ * Used to indicate that a node_announcement should be broadcast to all peers.
+ */
+ LDKMessageSendEvent_BroadcastNodeAnnouncement,
+ /**
+ * Used to indicate that a channel_update should be broadcast to all peers.
+ */
+ LDKMessageSendEvent_BroadcastChannelUpdate,
+ /**
+ * Broadcast an error downstream to be handled
+ */
+ LDKMessageSendEvent_HandleError,
+ /**
+ * When a payment fails we may receive updates back from the hop where it failed. In such
+ * cases this event is generated so that we can inform the network graph of this information.
+ */
+ LDKMessageSendEvent_PaymentFailureNetworkUpdate,
+ /**
+ * Query a peer for channels with funding transaction UTXOs in a block range.
+ */
+ LDKMessageSendEvent_SendChannelRangeQuery,
+ /**
+ * Request routing gossip messages from a peer for a list of channels identified by
+ * their short_channel_ids.
+ */
+ LDKMessageSendEvent_SendShortIdsQuery,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKMessageSendEvent_Sentinel,
+} LDKMessageSendEvent_Tag;
+
+typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
+ struct LDKPublicKey node_id;
+ struct LDKAcceptChannel msg;
+} LDKMessageSendEvent_LDKSendAcceptChannel_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
+ struct LDKPublicKey node_id;
+ struct LDKOpenChannel msg;
+} LDKMessageSendEvent_LDKSendOpenChannel_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
+ struct LDKPublicKey node_id;
+ struct LDKFundingCreated msg;
+} LDKMessageSendEvent_LDKSendFundingCreated_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
+ struct LDKPublicKey node_id;
+ struct LDKFundingSigned msg;
+} LDKMessageSendEvent_LDKSendFundingSigned_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
+ struct LDKPublicKey node_id;
+ struct LDKFundingLocked msg;
+} LDKMessageSendEvent_LDKSendFundingLocked_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
+ struct LDKPublicKey node_id;
+ struct LDKAnnouncementSignatures msg;
+} LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
+
+typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
+ struct LDKPublicKey node_id;
+ struct LDKCommitmentUpdate updates;
+} LDKMessageSendEvent_LDKUpdateHTLCs_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
+ struct LDKPublicKey node_id;
+ struct LDKRevokeAndACK msg;
+} LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
+ struct LDKPublicKey node_id;
+ struct LDKClosingSigned msg;
+} LDKMessageSendEvent_LDKSendClosingSigned_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
+ struct LDKPublicKey node_id;
+ struct LDKShutdown msg;
+} LDKMessageSendEvent_LDKSendShutdown_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
+ struct LDKPublicKey node_id;
+ struct LDKChannelReestablish msg;
+} LDKMessageSendEvent_LDKSendChannelReestablish_Body;
+
+typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
+ struct LDKChannelAnnouncement msg;
+ struct LDKChannelUpdate update_msg;
+} LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
+
+typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
+ struct LDKNodeAnnouncement msg;
+} LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
+
+typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
+ struct LDKChannelUpdate msg;
+} LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
+
+typedef struct LDKMessageSendEvent_LDKHandleError_Body {
+ struct LDKPublicKey node_id;
+ struct LDKErrorAction action;
+} LDKMessageSendEvent_LDKHandleError_Body;
+
+typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
+ struct LDKHTLCFailChannelUpdate update;
+} LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
+ struct LDKPublicKey node_id;
+ struct LDKQueryChannelRange msg;
+} LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
+ struct LDKPublicKey node_id;
+ struct LDKQueryShortChannelIds msg;
+} LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
+
+typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
+ LDKMessageSendEvent_Tag tag;
+ union {
+ LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
+ LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
+ LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
+ LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
+ LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
+ LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
+ LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
+ LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
+ LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
+ LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
+ LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
+ LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
+ LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
+ LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
+ LDKMessageSendEvent_LDKHandleError_Body handle_error;
+ LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
+ LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
+ LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
+ };
+} LDKMessageSendEvent;
+
+typedef struct LDKCVec_MessageSendEventZ {
+ struct LDKMessageSendEvent *data;
+ uintptr_t datalen;
+} LDKCVec_MessageSendEventZ;
+
+
+
+/**
+ * Details about one direction of a channel. Received
+ * within a channel update.
+ */
+typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
+ /**
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeDirectionalChannelInfo *inner;
+ bool is_owned;
+} LDKDirectionalChannelInfo;
+
+typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
+ struct LDKDirectionalChannelInfo *result;
+ struct LDKDecodeError *err;
+} LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
+
+typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
+ union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_DirectionalChannelInfoDecodeErrorZ;
+
+
+
+/**
+ * Details about a channel (both directions).
+ * Received within a channel announcement.
+ */
+typedef struct MUST_USE_STRUCT LDKChannelInfo {
+ /**
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeChannelInfo *inner;
+ bool is_owned;
+} LDKChannelInfo;
+
+typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
+ struct LDKChannelInfo *result;
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelInfoDecodeErrorZPtr;
+
+typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
+ union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_ChannelInfoDecodeErrorZ;
+
+
+
+/**
+ * Fees for routing via a given channel or a node
+ */
+typedef struct MUST_USE_STRUCT LDKRoutingFees {
+ /**
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeRoutingFees *inner;
+ bool is_owned;
+} LDKRoutingFees;
+
+typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
+ struct LDKRoutingFees *result;
+ struct LDKDecodeError *err;
+} LDKCResult_RoutingFeesDecodeErrorZPtr;
+
+typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
+ union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_RoutingFeesDecodeErrorZ;
+
+typedef struct LDKFourBytes {
+ uint8_t data[4];
+} LDKFourBytes;
+
+typedef struct LDKSixteenBytes {
+ uint8_t data[16];
+} LDKSixteenBytes;
+
+typedef struct LDKTenBytes {
+ uint8_t data[10];
+} LDKTenBytes;
+
+/**
+ * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
+ * look up the corresponding function in rust-lightning's docs.
+ */
+typedef struct LDKThirtyTwoBytes {
+ uint8_t data[32];
+} LDKThirtyTwoBytes;
+
+/**
+ * An address which can be used to connect to a remote peer
+ */
+typedef enum LDKNetAddress_Tag {
+ /**
+ * An IPv4 address/port on which the peer is listening.
+ */
+ LDKNetAddress_IPv4,
+ /**
+ * An IPv6 address/port on which the peer is listening.
+ */
+ LDKNetAddress_IPv6,
+ /**
+ * An old-style Tor onion address/port on which the peer is listening.
+ */
+ LDKNetAddress_OnionV2,
+ /**
+ * A new-style Tor onion address/port on which the peer is listening.
+ * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
+ * wrap as base32 and append \".onion\".
+ */
+ LDKNetAddress_OnionV3,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKNetAddress_Sentinel,
+} LDKNetAddress_Tag;
+
+typedef struct LDKNetAddress_LDKIPv4_Body {
+ struct LDKFourBytes addr;
+ uint16_t port;
+} LDKNetAddress_LDKIPv4_Body;
+
+typedef struct LDKNetAddress_LDKIPv6_Body {
+ struct LDKSixteenBytes addr;
+ uint16_t port;
+} LDKNetAddress_LDKIPv6_Body;
+
+typedef struct LDKNetAddress_LDKOnionV2_Body {
+ struct LDKTenBytes addr;
+ uint16_t port;
+} LDKNetAddress_LDKOnionV2_Body;
+
+typedef struct LDKNetAddress_LDKOnionV3_Body {
+ struct LDKThirtyTwoBytes ed25519_pubkey;
+ uint16_t checksum;
+ uint8_t version;
+ uint16_t port;
+} LDKNetAddress_LDKOnionV3_Body;
+
+typedef struct MUST_USE_STRUCT LDKNetAddress {
+ LDKNetAddress_Tag tag;
+ union {
+ LDKNetAddress_LDKIPv4_Body i_pv4;
+ LDKNetAddress_LDKIPv6_Body i_pv6;
+ LDKNetAddress_LDKOnionV2_Body onion_v2;
+ LDKNetAddress_LDKOnionV3_Body onion_v3;
+ };
+} LDKNetAddress;
+
+typedef struct LDKCVec_NetAddressZ {
+ struct LDKNetAddress *data;
+ uintptr_t datalen;
+} LDKCVec_NetAddressZ;
+
+
+
+/**
+ * Information received in the latest node_announcement from this node.
+ */
+typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
+ /**
+ * Nearly everywhere, 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;
+ bool is_owned;
+} LDKNodeAnnouncementInfo;
+
+typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
+ struct LDKNodeAnnouncementInfo *result;
+ struct LDKDecodeError *err;
+} LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
+
+typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
+ union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
+
+typedef struct LDKCVec_u64Z {
+ uint64_t *data;
+ uintptr_t datalen;
+} LDKCVec_u64Z;
+
+
+
+/**
+ * Details about a node in the network, known from the network announcement.
+ */
+typedef struct MUST_USE_STRUCT LDKNodeInfo {
+ /**
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeNodeInfo *inner;
+ bool is_owned;
+} LDKNodeInfo;
+
+typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
+ struct LDKNodeInfo *result;
+ struct LDKDecodeError *err;
+} LDKCResult_NodeInfoDecodeErrorZPtr;
+
+typedef struct LDKCResult_NodeInfoDecodeErrorZ {
+ union LDKCResult_NodeInfoDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_NodeInfoDecodeErrorZ;
+
+
+
+/**
+ * Represents the network as nodes and channels between them
+ */
+typedef struct MUST_USE_STRUCT LDKNetworkGraph {
+ /**
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeNetworkGraph *inner;
+ bool is_owned;
+} LDKNetworkGraph;
+
+typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
+ struct LDKNetworkGraph *result;
+ struct LDKDecodeError *err;
+} LDKCResult_NetworkGraphDecodeErrorZPtr;
+
+typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
+ union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_NetworkGraphDecodeErrorZ;
+
+typedef struct LDKC2Tuple_usizeTransactionZ {
+ uintptr_t a;
+ struct LDKTransaction b;
+} LDKC2Tuple_usizeTransactionZ;
+
+typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
+ struct LDKC2Tuple_usizeTransactionZ *data;
+ uintptr_t datalen;
+} LDKCVec_C2Tuple_usizeTransactionZZ;
+
+typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
+ /**
+ * Note that this value is always NULL, as there are no contents in the OK variant
+ */
+ void *result;
+ enum LDKChannelMonitorUpdateErr *err;
+} LDKCResult_NoneChannelMonitorUpdateErrZPtr;
+
+typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
+ union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
+ bool result_ok;
+} LDKCResult_NoneChannelMonitorUpdateErrZ;
+
+
+
+/**
+ * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
+ * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
+ * preimage claim backward will lead to loss of funds.
+ *
+ * [`chain::Watch`]: ../trait.Watch.html
+ */
+typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
+ /**
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeHTLCUpdate *inner;
+ bool is_owned;
+} LDKHTLCUpdate;
+
+
+
+/**
+ * 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 {
/**
- * When a payment fails we may receive updates back from the hop where it failed. In such
- * cases this event is generated so that we can inform the network graph of this information.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKMessageSendEvent_PaymentFailureNetworkUpdate,
+ LDKnativeOutPoint *inner;
+ bool is_owned;
+} LDKOutPoint;
+
+/**
+ * An event to be processed by the ChannelManager.
+ */
+typedef enum LDKMonitorEvent_Tag {
/**
- * Query a peer for channels with funding transaction UTXOs in a block range.
+ * A monitor event containing an HTLCUpdate.
*/
- LDKMessageSendEvent_SendChannelRangeQuery,
+ LDKMonitorEvent_HTLCEvent,
/**
- * Request routing gossip messages from a peer for a list of channels identified by
- * their short_channel_ids.
+ * A monitor event that the Channel's commitment transaction was broadcasted.
*/
- LDKMessageSendEvent_SendShortIdsQuery,
+ LDKMonitorEvent_CommitmentTxBroadcasted,
/**
* Must be last for serialization purposes
*/
- LDKMessageSendEvent_Sentinel,
-} LDKMessageSendEvent_Tag;
-
-typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
- struct LDKPublicKey node_id;
- struct LDKAcceptChannel msg;
-} LDKMessageSendEvent_LDKSendAcceptChannel_Body;
-
-typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
- struct LDKPublicKey node_id;
- struct LDKOpenChannel msg;
-} LDKMessageSendEvent_LDKSendOpenChannel_Body;
-
-typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
- struct LDKPublicKey node_id;
- struct LDKFundingCreated msg;
-} LDKMessageSendEvent_LDKSendFundingCreated_Body;
-
-typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
- struct LDKPublicKey node_id;
- struct LDKFundingSigned msg;
-} LDKMessageSendEvent_LDKSendFundingSigned_Body;
-
-typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
- struct LDKPublicKey node_id;
- struct LDKFundingLocked msg;
-} LDKMessageSendEvent_LDKSendFundingLocked_Body;
-
-typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
- struct LDKPublicKey node_id;
- struct LDKAnnouncementSignatures msg;
-} LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
-
-typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
- struct LDKPublicKey node_id;
- struct LDKCommitmentUpdate updates;
-} LDKMessageSendEvent_LDKUpdateHTLCs_Body;
-
-typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
- struct LDKPublicKey node_id;
- struct LDKRevokeAndACK msg;
-} LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
+ LDKMonitorEvent_Sentinel,
+} LDKMonitorEvent_Tag;
-typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
- struct LDKPublicKey node_id;
- struct LDKClosingSigned msg;
-} LDKMessageSendEvent_LDKSendClosingSigned_Body;
+typedef struct MUST_USE_STRUCT LDKMonitorEvent {
+ LDKMonitorEvent_Tag tag;
+ union {
+ struct {
+ struct LDKHTLCUpdate htlc_event;
+ };
+ struct {
+ struct LDKOutPoint commitment_tx_broadcasted;
+ };
+ };
+} LDKMonitorEvent;
-typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
- struct LDKPublicKey node_id;
- struct LDKShutdown msg;
-} LDKMessageSendEvent_LDKSendShutdown_Body;
+typedef struct LDKCVec_MonitorEventZ {
+ struct LDKMonitorEvent *data;
+ uintptr_t datalen;
+} LDKCVec_MonitorEventZ;
-typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
- struct LDKPublicKey node_id;
- struct LDKChannelReestablish msg;
-} LDKMessageSendEvent_LDKSendChannelReestablish_Body;
-typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
- struct LDKChannelAnnouncement msg;
- struct LDKChannelUpdate update_msg;
-} LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
-typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
- struct LDKNodeAnnouncement msg;
-} LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
+/**
+ * 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 {
+ /**
+ * Nearly everywhere, 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;
+ bool is_owned;
+} LDKDelayedPaymentOutputDescriptor;
-typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
- struct LDKChannelUpdate msg;
-} LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
-typedef struct LDKMessageSendEvent_LDKHandleError_Body {
- struct LDKPublicKey node_id;
- struct LDKErrorAction action;
-} LDKMessageSendEvent_LDKHandleError_Body;
-typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
- struct LDKHTLCFailChannelUpdate update;
-} LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
+/**
+ * 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 {
+ /**
+ * Nearly everywhere, 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;
+ bool is_owned;
+} LDKStaticPaymentOutputDescriptor;
-typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
- struct LDKPublicKey node_id;
- struct LDKQueryChannelRange msg;
-} LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
+/**
+ * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
+ * claim at any point in the future) an 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.
+ */
+typedef enum LDKSpendableOutputDescriptor_Tag {
+ /**
+ * An output to a script which was provided via KeysInterface directly, either from
+ * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
+ * spend it. No secret keys are provided as rust-lightning was never given any key.
+ * 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.
+ */
+ LDKSpendableOutputDescriptor_StaticOutput,
+ /**
+ * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
+ *
+ * The witness in the spending input should be:
+ * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
+ *
+ * Note that the nSequence field in the spending input must be set to to_self_delay
+ * (which means the transaction is not broadcastable until at least to_self_delay
+ * blocks after the outpoint confirms).
+ *
+ * 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 for this input, you must pass the
+ * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
+ * Sign::pubkeys().delayed_payment_basepoint) and the provided 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 delayed_payment_basepoint which appears in
+ * Sign::pubkeys().
+ *
+ * To derive the revocation_pubkey provided here (which is used in the witness
+ * script generation), you must pass the counterparty revocation_basepoint (which appears in the
+ * call to Sign::ready_channel) and the provided 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 revocation_pubkey (derived as above), our delayed_payment pubkey
+ * (derived as above), and the to_self_delay contained here to
+ * chan_utils::get_revokeable_redeemscript.
+ */
+ LDKSpendableOutputDescriptor_DelayedPaymentOutput,
+ /**
+ * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
+ * corresponds to the public key in Sign::pubkeys().payment_point).
+ * The witness in the spending input, is, thus, simply:
+ * <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 LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
- struct LDKPublicKey node_id;
- struct LDKQueryShortChannelIds msg;
-} LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
+typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
+ struct LDKOutPoint outpoint;
+ struct LDKTxOut output;
+} LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
-typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
- LDKMessageSendEvent_Tag tag;
+typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
+ LDKSpendableOutputDescriptor_Tag tag;
union {
- LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
- LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
- LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
- LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
- LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
- LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
- LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
- LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
- LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
- LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
- LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
- LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
- LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
- LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
- LDKMessageSendEvent_LDKHandleError_Body handle_error;
- LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
- LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
- LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
+ LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
+ struct {
+ struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
+ };
+ struct {
+ struct LDKStaticPaymentOutputDescriptor static_payment_output;
+ };
};
-} LDKMessageSendEvent;
+} LDKSpendableOutputDescriptor;
-typedef struct LDKCVec_MessageSendEventZ {
- struct LDKMessageSendEvent *data;
+typedef struct LDKCVec_SpendableOutputDescriptorZ {
+ struct LDKSpendableOutputDescriptor *data;
uintptr_t datalen;
-} LDKCVec_MessageSendEventZ;
-
-/**
- * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
- * look up the corresponding function in rust-lightning's docs.
- */
-typedef struct LDKThirtyTwoBytes {
- uint8_t data[32];
-} LDKThirtyTwoBytes;
+} LDKCVec_SpendableOutputDescriptorZ;
/**
* An Event which you should probably take some action in response to.
LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
};
-} LDKEvent;
-
-typedef struct LDKCVec_EventZ {
- struct LDKEvent *data;
- uintptr_t datalen;
-} LDKCVec_EventZ;
-
-typedef struct LDKC2Tuple_usizeTransactionZ {
- uintptr_t a;
- struct LDKTransaction b;
-} LDKC2Tuple_usizeTransactionZ;
-
-typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
- struct LDKC2Tuple_usizeTransactionZ *data;
- uintptr_t datalen;
-} LDKCVec_C2Tuple_usizeTransactionZZ;
-
-typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
- /**
- * Note that this value is always NULL, as there are no contents in the OK variant
- */
- void *result;
- enum LDKChannelMonitorUpdateErr *err;
-} LDKCResult_NoneChannelMonitorUpdateErrZPtr;
-
-typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
- union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
- bool result_ok;
-} LDKCResult_NoneChannelMonitorUpdateErrZ;
-
-
-
-/**
- * An event to be processed by the ChannelManager.
- */
-typedef struct MUST_USE_STRUCT LDKMonitorEvent {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeMonitorEvent *inner;
- bool is_owned;
-} LDKMonitorEvent;
+} LDKEvent;
-typedef struct LDKCVec_MonitorEventZ {
- struct LDKMonitorEvent *data;
+typedef struct LDKCVec_EventZ {
+ struct LDKEvent *data;
uintptr_t datalen;
-} LDKCVec_MonitorEventZ;
+} LDKCVec_EventZ;
+
+typedef union LDKCResult_OutPointDecodeErrorZPtr {
+ struct LDKOutPoint *result;
+ struct LDKDecodeError *err;
+} LDKCResult_OutPointDecodeErrorZPtr;
+
+typedef struct LDKCResult_OutPointDecodeErrorZ {
+ union LDKCResult_OutPointDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_OutPointDecodeErrorZ;
bool is_owned;
} LDKChannelMonitorUpdate;
-
-
-/**
- * An error in decoding a message or struct.
- */
-typedef struct MUST_USE_STRUCT LDKDecodeError {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeDecodeError *inner;
- bool is_owned;
-} LDKDecodeError;
-
typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
struct LDKChannelMonitorUpdate *result;
struct LDKDecodeError *err;
bool result_ok;
} LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
+typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
+ struct LDKHTLCUpdate *result;
+ struct LDKDecodeError *err;
+} LDKCResult_HTLCUpdateDecodeErrorZPtr;
+
+typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
+ union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_HTLCUpdateDecodeErrorZ;
+
/**
uintptr_t datalen;
} LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ;
-
-
-/**
- * One counterparty's public keys which do not change over the life of a channel.
- */
-typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeChannelPublicKeys *inner;
- bool is_owned;
-} LDKChannelPublicKeys;
-
-typedef struct LDKSignature {
- uint8_t compact_form[64];
-} LDKSignature;
-
-typedef struct LDKCVec_SignatureZ {
- struct LDKSignature *data;
- uintptr_t datalen;
-} LDKCVec_SignatureZ;
-
typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
struct LDKSignature a;
struct LDKCVec_SignatureZ b;
bool result_ok;
} LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
-
-
-/**
- * This class tracks the per-transaction information needed to build a commitment transaction and to
- * actually build it and sign. It is used for holder transactions that we sign only when needed
- * and for transactions we sign for the counterparty.
- *
- * This class can be used inside a signer implementation to generate a signature given the relevant
- * secret key.
- */
-typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeCommitmentTransaction *inner;
- bool is_owned;
-} LDKCommitmentTransaction;
-
-
-
-/**
- * Information needed to build and sign a holder's commitment transaction.
- *
- * The transaction is only signed once we are ready to broadcast.
- */
-typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeHolderCommitmentTransaction *inner;
- bool is_owned;
-} LDKHolderCommitmentTransaction;
-
typedef union LDKCResult_SignatureNoneZPtr {
struct LDKSignature *result;
/**
-/**
- * Information about an HTLC as it appears in a commitment transaction
- */
-typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeHTLCOutputInCommitment *inner;
- bool is_owned;
-} LDKHTLCOutputInCommitment;
-
-
-
/**
* The unsigned part of a channel_announcement
*/
bool is_owned;
} LDKUnsignedChannelAnnouncement;
-
-
-/**
- * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
- * The fields are organized by holder/counterparty.
- *
- * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
- * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
- */
-typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeChannelTransactionParameters *inner;
- bool is_owned;
-} LDKChannelTransactionParameters;
-
/**
- * Set of lightning keys needed to operate a channel as described in BOLT 3.
+ * A trait to sign lightning channel transactions as described in BOLT 3.
*
* Signing services could be implemented on a hardware wallet. In this case,
- * the current ChannelKeys would be a front-end on top of a communication
+ * the current Sign would be a front-end on top of a communication
* channel connected to your secure device and lightning key material wouldn't
* reside on a hot server. Nevertheless, a this deployment would still need
* to trust the ChannelManager to avoid loss of funds as this latest component
* In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
* to act, as liveness and breach reply correctness are always going to be hard requirements
* of LN security model, orthogonal of key management issues.
- *
- * If you're implementing a custom signer, you almost certainly want to implement
- * Readable/Writable to serialize out a unique reference to this set of keys so
- * that you can serialize the full ChannelManager object.
- *
*/
-typedef struct LDKChannelKeys {
+typedef struct LDKSign {
void *this_arg;
/**
* Gets the per-commitment point for a specific commitment number
* May be called more than once for the same index.
*
* Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
- * TODO: return a Result so we can signal a validation error
*/
struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
/**
* Note that this takes a pointer to this object, not the this_ptr like other methods do
* This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
*/
- void (*set_pubkeys)(const struct LDKChannelKeys*NONNULL_PTR );
+ void (*set_pubkeys)(const struct LDKSign*NONNULL_PTR );
/**
- * Gets arbitrary identifiers describing the set of keys which are provided back to you in
- * some SpendableOutputDescriptor types. These should be sufficient to identify this
- * ChannelKeys object uniquely and lookup or re-derive its keys.
+ * Gets an arbitrary identifier describing the set of keys which are provided back to you in
+ * some SpendableOutputDescriptor types. This should be sufficient to identify this
+ * Sign object uniquely and lookup or re-derive its keys.
*/
- struct LDKC2Tuple_u64u64Z (*key_derivation_params)(const void *this_arg);
+ struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
/**
* Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
*
void *(*clone)(const void *this_arg);
struct LDKCVec_u8Z (*write)(const void *this_arg);
void (*free)(void *this_arg);
-} LDKChannelKeys;
+} LDKSign;
bool result_ok;
} LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
-typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
- struct LDKSpendableOutputDescriptor *result;
- struct LDKDecodeError *err;
-} LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
-
-typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
- union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
- bool result_ok;
-} LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
-
-typedef union LDKCResult_ChanKeySignerDecodeErrorZPtr {
- struct LDKChannelKeys *result;
- struct LDKDecodeError *err;
-} LDKCResult_ChanKeySignerDecodeErrorZPtr;
-
-typedef struct LDKCResult_ChanKeySignerDecodeErrorZ {
- union LDKCResult_ChanKeySignerDecodeErrorZPtr contents;
- bool result_ok;
-} LDKCResult_ChanKeySignerDecodeErrorZ;
-
-
-
-/**
- * A simple implementation of ChannelKeys that just keeps the private keys in memory.
- *
- * This implementation performs no policy checks and is insufficient by itself as
- * a secure external signer.
- */
-typedef struct MUST_USE_STRUCT LDKInMemoryChannelKeys {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeInMemoryChannelKeys *inner;
- bool is_owned;
-} LDKInMemoryChannelKeys;
-
-typedef union LDKCResult_InMemoryChannelKeysDecodeErrorZPtr {
- struct LDKInMemoryChannelKeys *result;
- struct LDKDecodeError *err;
-} LDKCResult_InMemoryChannelKeysDecodeErrorZPtr;
-
-typedef struct LDKCResult_InMemoryChannelKeysDecodeErrorZ {
- union LDKCResult_InMemoryChannelKeysDecodeErrorZPtr contents;
- bool result_ok;
-} LDKCResult_InMemoryChannelKeysDecodeErrorZ;
-
typedef union LDKCResult_TxOutAccessErrorZPtr {
struct LDKTxOut *result;
enum LDKAccessError *err;
bool result_ok;
} LDKCResult_NoneAPIErrorZ;
+typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
+ struct LDKCResult_NoneAPIErrorZ *data;
+ uintptr_t datalen;
+} LDKCVec_CResult_NoneAPIErrorZZ;
+
+typedef struct LDKCVec_APIErrorZ {
+ struct LDKAPIError *data;
+ uintptr_t datalen;
+} LDKCVec_APIErrorZ;
+
/**
uintptr_t datalen;
} LDKCVec_ChannelDetailsZ;
-
-
/**
* If a payment fails to send, it can be in one of several states. This enum is returned as the
* Err() type describing which state the payment is in, see the description of individual enum
* states for more.
*/
-typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativePaymentSendFailure *inner;
- bool is_owned;
-} LDKPaymentSendFailure;
-
-typedef union LDKCResult_NonePaymentSendFailureZPtr {
- /**
- * Note that this value is always NULL, as there are no contents in the OK variant
- */
- void *result;
- struct LDKPaymentSendFailure *err;
-} LDKCResult_NonePaymentSendFailureZPtr;
-
-typedef struct LDKCResult_NonePaymentSendFailureZ {
- union LDKCResult_NonePaymentSendFailureZPtr contents;
- bool result_ok;
-} LDKCResult_NonePaymentSendFailureZ;
-
-typedef struct LDKFourBytes {
- uint8_t data[4];
-} LDKFourBytes;
-
-typedef struct LDKSixteenBytes {
- uint8_t data[16];
-} LDKSixteenBytes;
-
-typedef struct LDKTenBytes {
- uint8_t data[10];
-} LDKTenBytes;
-
-/**
- * An address which can be used to connect to a remote peer
- */
-typedef enum LDKNetAddress_Tag {
+typedef enum LDKPaymentSendFailure_Tag {
/**
- * An IPv4 address/port on which the peer is listening.
+ * A parameter which was passed to send_payment was invalid, preventing us from attempting to
+ * send the payment at all. No channel state has been changed or messages sent to peers, and
+ * once you've changed the parameter at error, you can freely retry the payment in full.
*/
- LDKNetAddress_IPv4,
+ LDKPaymentSendFailure_ParameterError,
/**
- * An IPv6 address/port on which the peer is listening.
+ * A parameter in a single path which was passed to send_payment was invalid, preventing us
+ * from attempting to send the payment at all. No channel state has been changed or messages
+ * sent to peers, and once you've changed the parameter at error, you can freely retry the
+ * payment in full.
+ *
+ * The results here are ordered the same as the paths in the route object which was passed to
+ * send_payment.
*/
- LDKNetAddress_IPv6,
+ LDKPaymentSendFailure_PathParameterError,
/**
- * An old-style Tor onion address/port on which the peer is listening.
+ * All paths which were attempted failed to send, with no channel state change taking place.
+ * You can freely retry the payment in full (though you probably want to do so over different
+ * paths than the ones selected).
*/
- LDKNetAddress_OnionV2,
+ LDKPaymentSendFailure_AllFailedRetrySafe,
/**
- * A new-style Tor onion address/port on which the peer is listening.
- * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
- * wrap as base32 and append \".onion\".
+ * Some paths which were attempted failed to send, though possibly not all. At least some
+ * paths have irrevocably committed to the HTLC and retrying the payment in full would result
+ * in over-/re-payment.
+ *
+ * The results here are ordered the same as the paths in the route object which was passed to
+ * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
+ * retried (though there is currently no API with which to do so).
+ *
+ * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
+ * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
+ * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
+ * with the latest update_id.
*/
- LDKNetAddress_OnionV3,
+ LDKPaymentSendFailure_PartialFailure,
/**
* Must be last for serialization purposes
*/
- LDKNetAddress_Sentinel,
-} LDKNetAddress_Tag;
-
-typedef struct LDKNetAddress_LDKIPv4_Body {
- struct LDKFourBytes addr;
- uint16_t port;
-} LDKNetAddress_LDKIPv4_Body;
-
-typedef struct LDKNetAddress_LDKIPv6_Body {
- struct LDKSixteenBytes addr;
- uint16_t port;
-} LDKNetAddress_LDKIPv6_Body;
-
-typedef struct LDKNetAddress_LDKOnionV2_Body {
- struct LDKTenBytes addr;
- uint16_t port;
-} LDKNetAddress_LDKOnionV2_Body;
-
-typedef struct LDKNetAddress_LDKOnionV3_Body {
- struct LDKThirtyTwoBytes ed25519_pubkey;
- uint16_t checksum;
- uint8_t version;
- uint16_t port;
-} LDKNetAddress_LDKOnionV3_Body;
+ LDKPaymentSendFailure_Sentinel,
+} LDKPaymentSendFailure_Tag;
-typedef struct MUST_USE_STRUCT LDKNetAddress {
- LDKNetAddress_Tag tag;
+typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
+ LDKPaymentSendFailure_Tag tag;
union {
- LDKNetAddress_LDKIPv4_Body i_pv4;
- LDKNetAddress_LDKIPv6_Body i_pv6;
- LDKNetAddress_LDKOnionV2_Body onion_v2;
- LDKNetAddress_LDKOnionV3_Body onion_v3;
+ struct {
+ struct LDKAPIError parameter_error;
+ };
+ struct {
+ struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
+ };
+ struct {
+ struct LDKCVec_APIErrorZ all_failed_retry_safe;
+ };
+ struct {
+ struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
+ };
};
-} LDKNetAddress;
+} LDKPaymentSendFailure;
-typedef struct LDKCVec_NetAddressZ {
- struct LDKNetAddress *data;
- uintptr_t datalen;
-} LDKCVec_NetAddressZ;
+typedef union LDKCResult_NonePaymentSendFailureZPtr {
+ /**
+ * Note that this value is always NULL, as there are no contents in the OK variant
+ */
+ void *result;
+ struct LDKPaymentSendFailure *err;
+} LDKCResult_NonePaymentSendFailureZPtr;
+
+typedef struct LDKCResult_NonePaymentSendFailureZ {
+ union LDKCResult_NonePaymentSendFailureZPtr contents;
+ bool result_ok;
+} LDKCResult_NonePaymentSendFailureZ;
typedef struct LDKCVec_ChannelMonitorZ {
struct LDKChannelMonitor *data;
void (*free)(void *this_arg);
} LDKBroadcasterInterface;
-typedef struct LDKSecretKey {
- uint8_t bytes[32];
-} LDKSecretKey;
+typedef union LDKCResult_SignDecodeErrorZPtr {
+ struct LDKSign *result;
+ struct LDKDecodeError *err;
+} LDKCResult_SignDecodeErrorZPtr;
+
+typedef struct LDKCResult_SignDecodeErrorZ {
+ union LDKCResult_SignDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_SignDecodeErrorZ;
typedef struct LDKu8slice {
const uint8_t *data;
typedef struct LDKKeysInterface {
void *this_arg;
/**
- * Get node secret key (aka node_id or network_key)
+ * Get node secret key (aka node_id or network_key).
+ *
+ * This method must return the same value each time it is called.
*/
struct LDKSecretKey (*get_node_secret)(const void *this_arg);
/**
- * Get destination redeemScript to encumber static protocol exit points.
+ * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
+ *
+ * This method should return a different value each time it is called, to avoid linking
+ * on-chain funds across channels as controlled to the same user.
*/
struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
/**
- * Get shutdown_pubkey to use as PublicKey at channel closure
+ * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
+ * a channel.
+ *
+ * This method should return a different value each time it is called, to avoid linking
+ * on-chain funds across channels as controlled to the same user.
*/
struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
/**
- * Get a new set of ChannelKeys for per-channel secrets. These MUST be unique even if you
+ * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
* restarted with some stale data!
+ *
+ * This method must return a different value each time it is called.
*/
- struct LDKChannelKeys (*get_channel_keys)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
+ struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
/**
* Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
* onion packets and for temporary channel IDs. There is no requirement that these be
* persisted anywhere, though they must be unique across restarts.
+ *
+ * This method must return a different value each time it is called.
*/
struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
/**
- * Reads a `ChanKeySigner` for this `KeysInterface` from the given input stream.
+ * Reads a `Signer` for this `KeysInterface` from the given input stream.
* This is only called during deserialization of other objects which contain
- * `ChannelKeys`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
- * The bytes are exactly those which `<Self::ChanKeySigner as Writeable>::write()` writes, and
+ * `Sign`-implementing objects (ie `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.
*/
- struct LDKCResult_ChanKeySignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
+ struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
void (*free)(void *this_arg);
} LDKKeysInterface;
bool result_ok;
} LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
-typedef union LDKCResult_NetAddressu8ZPtr {
- struct LDKNetAddress *result;
- uint8_t *err;
-} LDKCResult_NetAddressu8ZPtr;
-
-typedef struct LDKCResult_NetAddressu8Z {
- union LDKCResult_NetAddressu8ZPtr contents;
- bool result_ok;
-} LDKCResult_NetAddressu8Z;
-
-typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
- struct LDKCResult_NetAddressu8Z *result;
+typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
+ struct LDKSpendableOutputDescriptor *result;
struct LDKDecodeError *err;
-} LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
+} LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
-typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
- union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
+typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
+ union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
+} LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
-typedef struct LDKCVec_u64Z {
- uint64_t *data;
+typedef struct LDKCVec_CVec_u8ZZ {
+ struct LDKCVec_u8Z *data;
uintptr_t datalen;
-} LDKCVec_u64Z;
+} LDKCVec_CVec_u8ZZ;
+
+typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
+ struct LDKCVec_CVec_u8ZZ *result;
+ /**
+ * Note that this value is always NULL, as there are no contents in the Err variant
+ */
+ void *err;
+} LDKCResult_CVec_CVec_u8ZZNoneZPtr;
+
+typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
+ union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
+ bool result_ok;
+} LDKCResult_CVec_CVec_u8ZZNoneZ;
/**
- * An update_add_htlc message to be sent or received from a peer
+ * A simple implementation of Sign that just keeps the private keys in memory.
+ *
+ * This implementation performs no policy checks and is insufficient by itself as
+ * a secure external signer.
*/
-typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
+typedef struct MUST_USE_STRUCT LDKInMemorySigner {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeUpdateAddHTLC *inner;
+ LDKnativeInMemorySigner *inner;
bool is_owned;
-} LDKUpdateAddHTLC;
+} LDKInMemorySigner;
-typedef struct LDKCVec_UpdateAddHTLCZ {
- struct LDKUpdateAddHTLC *data;
- uintptr_t datalen;
-} LDKCVec_UpdateAddHTLCZ;
+typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
+ struct LDKInMemorySigner *result;
+ struct LDKDecodeError *err;
+} LDKCResult_InMemorySignerDecodeErrorZPtr;
+typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
+ union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_InMemorySignerDecodeErrorZ;
+typedef struct LDKCVec_TxOutZ {
+ struct LDKTxOut *data;
+ uintptr_t datalen;
+} LDKCVec_TxOutZ;
-/**
- * An update_fulfill_htlc message to be sent or received from a peer
- */
-typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
+typedef union LDKCResult_TransactionNoneZPtr {
+ struct LDKTransaction *result;
/**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ * Note that this value is always NULL, as there are no contents in the Err variant
*/
- LDKnativeUpdateFulfillHTLC *inner;
- bool is_owned;
-} LDKUpdateFulfillHTLC;
+ void *err;
+} LDKCResult_TransactionNoneZPtr;
-typedef struct LDKCVec_UpdateFulfillHTLCZ {
- struct LDKUpdateFulfillHTLC *data;
- uintptr_t datalen;
-} LDKCVec_UpdateFulfillHTLCZ;
+typedef struct LDKCResult_TransactionNoneZ {
+ union LDKCResult_TransactionNoneZPtr contents;
+ bool result_ok;
+} LDKCResult_TransactionNoneZ;
/**
- * An update_fail_htlc message to be sent or received from a peer
+ * A hop in a route
*/
-typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
+typedef struct MUST_USE_STRUCT LDKRouteHop {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeUpdateFailHTLC *inner;
+ LDKnativeRouteHop *inner;
bool is_owned;
-} LDKUpdateFailHTLC;
+} LDKRouteHop;
-typedef struct LDKCVec_UpdateFailHTLCZ {
- struct LDKUpdateFailHTLC *data;
+typedef struct LDKCVec_RouteHopZ {
+ struct LDKRouteHop *data;
uintptr_t datalen;
-} LDKCVec_UpdateFailHTLCZ;
+} LDKCVec_RouteHopZ;
+
+typedef struct LDKCVec_CVec_RouteHopZZ {
+ struct LDKCVec_RouteHopZ *data;
+ uintptr_t datalen;
+} LDKCVec_CVec_RouteHopZZ;
/**
- * An update_fail_malformed_htlc message to be sent or received from a peer
+ * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
+ * it can take multiple paths. Each path is composed of one or more hops through the network.
*/
-typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
+typedef struct MUST_USE_STRUCT LDKRoute {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeUpdateFailMalformedHTLC *inner;
+ LDKnativeRoute *inner;
bool is_owned;
-} LDKUpdateFailMalformedHTLC;
+} LDKRoute;
-typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
- struct LDKUpdateFailMalformedHTLC *data;
- uintptr_t datalen;
-} LDKCVec_UpdateFailMalformedHTLCZ;
+typedef union LDKCResult_RouteDecodeErrorZPtr {
+ struct LDKRoute *result;
+ struct LDKDecodeError *err;
+} LDKCResult_RouteDecodeErrorZPtr;
+
+typedef struct LDKCResult_RouteDecodeErrorZ {
+ union LDKCResult_RouteDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_RouteDecodeErrorZ;
/**
- * An Err type for failure to process messages.
+ * A channel descriptor which provides a last-hop route to get_route
*/
-typedef struct MUST_USE_STRUCT LDKLightningError {
+typedef struct MUST_USE_STRUCT LDKRouteHint {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeLightningError *inner;
+ LDKnativeRouteHint *inner;
bool is_owned;
-} LDKLightningError;
-
-typedef union LDKCResult_boolLightningErrorZPtr {
- bool *result;
- struct LDKLightningError *err;
-} LDKCResult_boolLightningErrorZPtr;
-
-typedef struct LDKCResult_boolLightningErrorZ {
- union LDKCResult_boolLightningErrorZPtr contents;
- bool result_ok;
-} LDKCResult_boolLightningErrorZ;
-
-typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
- struct LDKChannelAnnouncement a;
- struct LDKChannelUpdate b;
- struct LDKChannelUpdate c;
-} LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
-
-typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
- struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
- uintptr_t datalen;
-} LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
+} LDKRouteHint;
-typedef struct LDKCVec_NodeAnnouncementZ {
- struct LDKNodeAnnouncement *data;
+typedef struct LDKCVec_RouteHintZ {
+ struct LDKRouteHint *data;
uintptr_t datalen;
-} LDKCVec_NodeAnnouncementZ;
+} LDKCVec_RouteHintZ;
-typedef union LDKCResult_NoneLightningErrorZPtr {
- /**
- * Note that this value is always NULL, as there are no contents in the OK variant
- */
- void *result;
+typedef union LDKCResult_RouteLightningErrorZPtr {
+ struct LDKRoute *result;
struct LDKLightningError *err;
-} LDKCResult_NoneLightningErrorZPtr;
+} LDKCResult_RouteLightningErrorZPtr;
-typedef struct LDKCResult_NoneLightningErrorZ {
- union LDKCResult_NoneLightningErrorZPtr contents;
+typedef struct LDKCResult_RouteLightningErrorZ {
+ union LDKCResult_RouteLightningErrorZPtr contents;
bool result_ok;
-} LDKCResult_NoneLightningErrorZ;
+} LDKCResult_RouteLightningErrorZ;
-typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
- struct LDKChannelReestablish *result;
- struct LDKDecodeError *err;
-} LDKCResult_ChannelReestablishDecodeErrorZPtr;
+typedef union LDKCResult_NetAddressu8ZPtr {
+ struct LDKNetAddress *result;
+ uint8_t *err;
+} LDKCResult_NetAddressu8ZPtr;
-typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
- union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
+typedef struct LDKCResult_NetAddressu8Z {
+ union LDKCResult_NetAddressu8ZPtr contents;
bool result_ok;
-} LDKCResult_ChannelReestablishDecodeErrorZ;
-
-
-
-/**
- * An init message to be sent or received from a peer
- */
-typedef struct MUST_USE_STRUCT LDKInit {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeInit *inner;
- bool is_owned;
-} LDKInit;
+} LDKCResult_NetAddressu8Z;
-typedef union LDKCResult_InitDecodeErrorZPtr {
- struct LDKInit *result;
+typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
+ struct LDKCResult_NetAddressu8Z *result;
struct LDKDecodeError *err;
-} LDKCResult_InitDecodeErrorZPtr;
+} LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
-typedef struct LDKCResult_InitDecodeErrorZ {
- union LDKCResult_InitDecodeErrorZPtr contents;
+typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
+ union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_InitDecodeErrorZ;
+} LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
/**
- * A ping message to be sent or received from a peer
+ * An update_add_htlc message to be sent or received from a peer
*/
-typedef struct MUST_USE_STRUCT LDKPing {
+typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativePing *inner;
+ LDKnativeUpdateAddHTLC *inner;
bool is_owned;
-} LDKPing;
-
-typedef union LDKCResult_PingDecodeErrorZPtr {
- struct LDKPing *result;
- struct LDKDecodeError *err;
-} LDKCResult_PingDecodeErrorZPtr;
+} LDKUpdateAddHTLC;
-typedef struct LDKCResult_PingDecodeErrorZ {
- union LDKCResult_PingDecodeErrorZPtr contents;
- bool result_ok;
-} LDKCResult_PingDecodeErrorZ;
+typedef struct LDKCVec_UpdateAddHTLCZ {
+ struct LDKUpdateAddHTLC *data;
+ uintptr_t datalen;
+} LDKCVec_UpdateAddHTLCZ;
/**
- * A pong message to be sent or received from a peer
+ * An update_fulfill_htlc message to be sent or received from a peer
*/
-typedef struct MUST_USE_STRUCT LDKPong {
+typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativePong *inner;
+ LDKnativeUpdateFulfillHTLC *inner;
bool is_owned;
-} LDKPong;
-
-typedef union LDKCResult_PongDecodeErrorZPtr {
- struct LDKPong *result;
- struct LDKDecodeError *err;
-} LDKCResult_PongDecodeErrorZPtr;
-
-typedef struct LDKCResult_PongDecodeErrorZ {
- union LDKCResult_PongDecodeErrorZPtr contents;
- bool result_ok;
-} LDKCResult_PongDecodeErrorZ;
-
-typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
- struct LDKUnsignedChannelAnnouncement *result;
- struct LDKDecodeError *err;
-} LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
+} LDKUpdateFulfillHTLC;
-typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
- union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
- bool result_ok;
-} LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
+typedef struct LDKCVec_UpdateFulfillHTLCZ {
+ struct LDKUpdateFulfillHTLC *data;
+ uintptr_t datalen;
+} LDKCVec_UpdateFulfillHTLCZ;
/**
- * The unsigned part of a channel_update
+ * An update_fail_htlc message to be sent or received from a peer
*/
-typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
+typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeUnsignedChannelUpdate *inner;
+ LDKnativeUpdateFailHTLC *inner;
bool is_owned;
-} LDKUnsignedChannelUpdate;
-
-typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
- struct LDKUnsignedChannelUpdate *result;
- struct LDKDecodeError *err;
-} LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
-
-typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
- union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
- bool result_ok;
-} LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
-
-typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
- struct LDKErrorMessage *result;
- struct LDKDecodeError *err;
-} LDKCResult_ErrorMessageDecodeErrorZPtr;
+} LDKUpdateFailHTLC;
-typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
- union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
- bool result_ok;
-} LDKCResult_ErrorMessageDecodeErrorZ;
+typedef struct LDKCVec_UpdateFailHTLCZ {
+ struct LDKUpdateFailHTLC *data;
+ uintptr_t datalen;
+} LDKCVec_UpdateFailHTLCZ;
/**
- * The unsigned part of a node_announcement
+ * An update_fail_malformed_htlc message to be sent or received from a peer
*/
-typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
+typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeUnsignedNodeAnnouncement *inner;
+ LDKnativeUpdateFailMalformedHTLC *inner;
bool is_owned;
-} LDKUnsignedNodeAnnouncement;
+} LDKUpdateFailMalformedHTLC;
-typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
- struct LDKUnsignedNodeAnnouncement *result;
+typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
+ struct LDKUpdateFailMalformedHTLC *data;
+ uintptr_t datalen;
+} LDKCVec_UpdateFailMalformedHTLCZ;
+
+typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
+ struct LDKAcceptChannel *result;
struct LDKDecodeError *err;
-} LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
+} LDKCResult_AcceptChannelDecodeErrorZPtr;
-typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
- union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
+typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
+ union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
+} LDKCResult_AcceptChannelDecodeErrorZ;
-typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
- struct LDKQueryShortChannelIds *result;
+typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
+ struct LDKAnnouncementSignatures *result;
struct LDKDecodeError *err;
-} LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
+} LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
-typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
- union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
+typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
+ union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_QueryShortChannelIdsDecodeErrorZ;
-
-
-
-/**
- * A reply_short_channel_ids_end message is sent as a reply to a
- * query_short_channel_ids message. The query recipient makes a best
- * effort to respond based on their local network view which may not be
- * a perfect view of the network.
- */
-typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeReplyShortChannelIdsEnd *inner;
- bool is_owned;
-} LDKReplyShortChannelIdsEnd;
+} LDKCResult_AnnouncementSignaturesDecodeErrorZ;
-typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
- struct LDKReplyShortChannelIdsEnd *result;
+typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
+ struct LDKChannelReestablish *result;
struct LDKDecodeError *err;
-} LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
+} LDKCResult_ChannelReestablishDecodeErrorZPtr;
-typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
- union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
+typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
+ union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
+} LDKCResult_ChannelReestablishDecodeErrorZ;
-typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
- struct LDKQueryChannelRange *result;
+typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
+ struct LDKClosingSigned *result;
struct LDKDecodeError *err;
-} LDKCResult_QueryChannelRangeDecodeErrorZPtr;
+} LDKCResult_ClosingSignedDecodeErrorZPtr;
-typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
- union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
+typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
+ union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_QueryChannelRangeDecodeErrorZ;
+} LDKCResult_ClosingSignedDecodeErrorZ;
/**
- * A reply_channel_range message is a reply to a query_channel_range
- * message. Multiple reply_channel_range messages can be sent in reply
- * to a single query_channel_range message. The query recipient makes a
- * best effort to respond based on their local network view which may
- * not be a perfect view of the network. The short_channel_ids in the
- * reply are encoded. We only support encoding_type=0 uncompressed
- * serialization and do not support encoding_type=1 zlib serialization.
+ * A commitment_signed message to be sent or received from a peer
*/
-typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
+typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeReplyChannelRange *inner;
+ LDKnativeCommitmentSigned *inner;
bool is_owned;
-} LDKReplyChannelRange;
+} LDKCommitmentSigned;
-typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
- struct LDKReplyChannelRange *result;
+typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
+ struct LDKCommitmentSigned *result;
struct LDKDecodeError *err;
-} LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
+} LDKCResult_CommitmentSignedDecodeErrorZPtr;
-typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
- union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
+typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
+ union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_ReplyChannelRangeDecodeErrorZ;
-
+} LDKCResult_CommitmentSignedDecodeErrorZ;
+typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
+ struct LDKFundingCreated *result;
+ struct LDKDecodeError *err;
+} LDKCResult_FundingCreatedDecodeErrorZPtr;
-/**
- * A gossip_timestamp_filter message is used by a node to request
- * gossip relay for messages in the requested time range when the
- * gossip_queries feature has been negotiated.
- */
-typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeGossipTimestampFilter *inner;
- bool is_owned;
-} LDKGossipTimestampFilter;
+typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
+ union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_FundingCreatedDecodeErrorZ;
-typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
- struct LDKGossipTimestampFilter *result;
+typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
+ struct LDKFundingSigned *result;
struct LDKDecodeError *err;
-} LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
+} LDKCResult_FundingSignedDecodeErrorZPtr;
-typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
- union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
+typedef struct LDKCResult_FundingSignedDecodeErrorZ {
+ union LDKCResult_FundingSignedDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_GossipTimestampFilterDecodeErrorZ;
+} LDKCResult_FundingSignedDecodeErrorZ;
-typedef struct LDKCVec_PublicKeyZ {
- struct LDKPublicKey *data;
- uintptr_t datalen;
-} LDKCVec_PublicKeyZ;
+typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
+ struct LDKFundingLocked *result;
+ struct LDKDecodeError *err;
+} LDKCResult_FundingLockedDecodeErrorZPtr;
+
+typedef struct LDKCResult_FundingLockedDecodeErrorZ {
+ union LDKCResult_FundingLockedDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_FundingLockedDecodeErrorZ;
/**
- * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
- * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
- * descriptor.
+ * An init message to be sent or received from a peer
*/
-typedef struct MUST_USE_STRUCT LDKPeerHandleError {
+typedef struct MUST_USE_STRUCT LDKInit {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativePeerHandleError *inner;
+ LDKnativeInit *inner;
bool is_owned;
-} LDKPeerHandleError;
+} LDKInit;
-typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
- struct LDKCVec_u8Z *result;
- struct LDKPeerHandleError *err;
-} LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
+typedef union LDKCResult_InitDecodeErrorZPtr {
+ struct LDKInit *result;
+ struct LDKDecodeError *err;
+} LDKCResult_InitDecodeErrorZPtr;
-typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
- union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
+typedef struct LDKCResult_InitDecodeErrorZ {
+ union LDKCResult_InitDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_CVec_u8ZPeerHandleErrorZ;
+} LDKCResult_InitDecodeErrorZ;
-typedef union LDKCResult_NonePeerHandleErrorZPtr {
- /**
- * Note that this value is always NULL, as there are no contents in the OK variant
- */
- void *result;
- struct LDKPeerHandleError *err;
-} LDKCResult_NonePeerHandleErrorZPtr;
+typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
+ struct LDKOpenChannel *result;
+ struct LDKDecodeError *err;
+} LDKCResult_OpenChannelDecodeErrorZPtr;
-typedef struct LDKCResult_NonePeerHandleErrorZ {
- union LDKCResult_NonePeerHandleErrorZPtr contents;
+typedef struct LDKCResult_OpenChannelDecodeErrorZ {
+ union LDKCResult_OpenChannelDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_NonePeerHandleErrorZ;
+} LDKCResult_OpenChannelDecodeErrorZ;
-typedef union LDKCResult_boolPeerHandleErrorZPtr {
- bool *result;
- struct LDKPeerHandleError *err;
-} LDKCResult_boolPeerHandleErrorZPtr;
+typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
+ struct LDKRevokeAndACK *result;
+ struct LDKDecodeError *err;
+} LDKCResult_RevokeAndACKDecodeErrorZPtr;
-typedef struct LDKCResult_boolPeerHandleErrorZ {
- union LDKCResult_boolPeerHandleErrorZPtr contents;
+typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
+ union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_boolPeerHandleErrorZ;
+} LDKCResult_RevokeAndACKDecodeErrorZ;
-typedef union LDKCResult_SecretKeySecpErrorZPtr {
- struct LDKSecretKey *result;
- enum LDKSecp256k1Error *err;
-} LDKCResult_SecretKeySecpErrorZPtr;
+typedef union LDKCResult_ShutdownDecodeErrorZPtr {
+ struct LDKShutdown *result;
+ struct LDKDecodeError *err;
+} LDKCResult_ShutdownDecodeErrorZPtr;
-typedef struct LDKCResult_SecretKeySecpErrorZ {
- union LDKCResult_SecretKeySecpErrorZPtr contents;
+typedef struct LDKCResult_ShutdownDecodeErrorZ {
+ union LDKCResult_ShutdownDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_SecretKeySecpErrorZ;
+} LDKCResult_ShutdownDecodeErrorZ;
-typedef union LDKCResult_PublicKeySecpErrorZPtr {
- struct LDKPublicKey *result;
- enum LDKSecp256k1Error *err;
-} LDKCResult_PublicKeySecpErrorZPtr;
+typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
+ struct LDKUpdateFailHTLC *result;
+ struct LDKDecodeError *err;
+} LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
-typedef struct LDKCResult_PublicKeySecpErrorZ {
- union LDKCResult_PublicKeySecpErrorZPtr contents;
+typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
+ union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_PublicKeySecpErrorZ;
-
-
+} LDKCResult_UpdateFailHTLCDecodeErrorZ;
-/**
- * The set of public keys which are used in the creation of one commitment transaction.
- * These are derived from the channel base keys and per-commitment data.
- *
- * A broadcaster key is provided from potential broadcaster of the computed transaction.
- * A countersignatory key is coming from a protocol participant unable to broadcast the
- * transaction.
- *
- * These keys are assumed to be good, either because the code derived them from
- * channel basepoints via the new function, or they were obtained via
- * CommitmentTransaction.trust().keys() because we trusted the source of the
- * pre-calculated keys.
- */
-typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
- /**
- * Nearly everywhere, 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;
- bool is_owned;
-} LDKTxCreationKeys;
-
-typedef union LDKCResult_TxCreationKeysSecpErrorZPtr {
- struct LDKTxCreationKeys *result;
- enum LDKSecp256k1Error *err;
-} LDKCResult_TxCreationKeysSecpErrorZPtr;
+typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
+ struct LDKUpdateFailMalformedHTLC *result;
+ struct LDKDecodeError *err;
+} LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
-typedef struct LDKCResult_TxCreationKeysSecpErrorZ {
- union LDKCResult_TxCreationKeysSecpErrorZPtr contents;
+typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
+ union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_TxCreationKeysSecpErrorZ;
+} LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
/**
- * 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.
+ * An update_fee message to be sent or received from a peer
*/
-typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
+typedef struct MUST_USE_STRUCT LDKUpdateFee {
/**
* Nearly everywhere, 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;
+ LDKnativeUpdateFee *inner;
bool is_owned;
-} LDKTrustedCommitmentTransaction;
+} LDKUpdateFee;
-typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
- struct LDKTrustedCommitmentTransaction *result;
- /**
- * Note that this value is always NULL, as there are no contents in the Err variant
- */
- void *err;
-} LDKCResult_TrustedCommitmentTransactionNoneZPtr;
+typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
+ struct LDKUpdateFee *result;
+ struct LDKDecodeError *err;
+} LDKCResult_UpdateFeeDecodeErrorZPtr;
-typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
- union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
+typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
+ union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_TrustedCommitmentTransactionNoneZ;
+} LDKCResult_UpdateFeeDecodeErrorZ;
-typedef union LDKCResult_CVec_SignatureZNoneZPtr {
- struct LDKCVec_SignatureZ *result;
- /**
- * Note that this value is always NULL, as there are no contents in the Err variant
- */
- void *err;
-} LDKCResult_CVec_SignatureZNoneZPtr;
+typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
+ struct LDKUpdateFulfillHTLC *result;
+ struct LDKDecodeError *err;
+} LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
-typedef struct LDKCResult_CVec_SignatureZNoneZ {
- union LDKCResult_CVec_SignatureZNoneZPtr contents;
+typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
+ union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_CVec_SignatureZNoneZ;
+} LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
+
+typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
+ struct LDKUpdateAddHTLC *result;
+ struct LDKDecodeError *err;
+} LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
+
+typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
+ union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_UpdateAddHTLCDecodeErrorZ;
/**
- * A hop in a route
+ * A ping message to be sent or received from a peer
*/
-typedef struct MUST_USE_STRUCT LDKRouteHop {
+typedef struct MUST_USE_STRUCT LDKPing {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeRouteHop *inner;
+ LDKnativePing *inner;
bool is_owned;
-} LDKRouteHop;
+} LDKPing;
-typedef struct LDKCVec_RouteHopZ {
- struct LDKRouteHop *data;
- uintptr_t datalen;
-} LDKCVec_RouteHopZ;
+typedef union LDKCResult_PingDecodeErrorZPtr {
+ struct LDKPing *result;
+ struct LDKDecodeError *err;
+} LDKCResult_PingDecodeErrorZPtr;
-typedef struct LDKCVec_CVec_RouteHopZZ {
- struct LDKCVec_RouteHopZ *data;
- uintptr_t datalen;
-} LDKCVec_CVec_RouteHopZZ;
+typedef struct LDKCResult_PingDecodeErrorZ {
+ union LDKCResult_PingDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_PingDecodeErrorZ;
/**
- * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
- * it can take multiple paths. Each path is composed of one or more hops through the network.
+ * A pong message to be sent or received from a peer
*/
-typedef struct MUST_USE_STRUCT LDKRoute {
+typedef struct MUST_USE_STRUCT LDKPong {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeRoute *inner;
+ LDKnativePong *inner;
bool is_owned;
-} LDKRoute;
+} LDKPong;
-typedef union LDKCResult_RouteDecodeErrorZPtr {
- struct LDKRoute *result;
+typedef union LDKCResult_PongDecodeErrorZPtr {
+ struct LDKPong *result;
struct LDKDecodeError *err;
-} LDKCResult_RouteDecodeErrorZPtr;
+} LDKCResult_PongDecodeErrorZPtr;
-typedef struct LDKCResult_RouteDecodeErrorZ {
- union LDKCResult_RouteDecodeErrorZPtr contents;
+typedef struct LDKCResult_PongDecodeErrorZ {
+ union LDKCResult_PongDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_RouteDecodeErrorZ;
+} LDKCResult_PongDecodeErrorZ;
+
+typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
+ struct LDKUnsignedChannelAnnouncement *result;
+ struct LDKDecodeError *err;
+} LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
+
+typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
+ union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
+
+typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
+ struct LDKChannelAnnouncement *result;
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
+
+typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
+ union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_ChannelAnnouncementDecodeErrorZ;
/**
- * A channel descriptor which provides a last-hop route to get_route
+ * The unsigned part of a channel_update
*/
-typedef struct MUST_USE_STRUCT LDKRouteHint {
+typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeRouteHint *inner;
+ LDKnativeUnsignedChannelUpdate *inner;
bool is_owned;
-} LDKRouteHint;
+} LDKUnsignedChannelUpdate;
-typedef struct LDKCVec_RouteHintZ {
- struct LDKRouteHint *data;
- uintptr_t datalen;
-} LDKCVec_RouteHintZ;
+typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
+ struct LDKUnsignedChannelUpdate *result;
+ struct LDKDecodeError *err;
+} LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
-typedef union LDKCResult_RouteLightningErrorZPtr {
- struct LDKRoute *result;
- struct LDKLightningError *err;
-} LDKCResult_RouteLightningErrorZPtr;
+typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
+ union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
-typedef struct LDKCResult_RouteLightningErrorZ {
- union LDKCResult_RouteLightningErrorZPtr contents;
+typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
+ struct LDKChannelUpdate *result;
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelUpdateDecodeErrorZPtr;
+
+typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
+ union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_RouteLightningErrorZ;
+} LDKCResult_ChannelUpdateDecodeErrorZ;
+
+typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
+ struct LDKErrorMessage *result;
+ struct LDKDecodeError *err;
+} LDKCResult_ErrorMessageDecodeErrorZPtr;
+
+typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
+ union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_ErrorMessageDecodeErrorZ;
/**
- * Fees for routing via a given channel or a node
+ * The unsigned part of a node_announcement
*/
-typedef struct MUST_USE_STRUCT LDKRoutingFees {
+typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeRoutingFees *inner;
+ LDKnativeUnsignedNodeAnnouncement *inner;
bool is_owned;
-} LDKRoutingFees;
+} LDKUnsignedNodeAnnouncement;
-typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
- struct LDKRoutingFees *result;
+typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
+ struct LDKUnsignedNodeAnnouncement *result;
struct LDKDecodeError *err;
-} LDKCResult_RoutingFeesDecodeErrorZPtr;
+} LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
-typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
- union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
+typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
+ union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_RoutingFeesDecodeErrorZ;
+} LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
+
+typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
+ struct LDKNodeAnnouncement *result;
+ struct LDKDecodeError *err;
+} LDKCResult_NodeAnnouncementDecodeErrorZPtr;
+
+typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
+ union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_NodeAnnouncementDecodeErrorZ;
+
+typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
+ struct LDKQueryShortChannelIds *result;
+ struct LDKDecodeError *err;
+} LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
+
+typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
+ union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_QueryShortChannelIdsDecodeErrorZ;
/**
- * Information received in the latest node_announcement from this node.
+ * A reply_short_channel_ids_end message is sent as a reply to a
+ * query_short_channel_ids message. The query recipient makes a best
+ * effort to respond based on their local network view which may not be
+ * a perfect view of the network.
*/
-typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
+typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
/**
* Nearly everywhere, 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;
+ LDKnativeReplyShortChannelIdsEnd *inner;
bool is_owned;
-} LDKNodeAnnouncementInfo;
+} LDKReplyShortChannelIdsEnd;
-typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
- struct LDKNodeAnnouncementInfo *result;
+typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
+ struct LDKReplyShortChannelIdsEnd *result;
struct LDKDecodeError *err;
-} LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
+} LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
-typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
- union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
+typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
+ union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
+} LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
+
+typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
+ struct LDKQueryChannelRange *result;
+ struct LDKDecodeError *err;
+} LDKCResult_QueryChannelRangeDecodeErrorZPtr;
+
+typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
+ union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_QueryChannelRangeDecodeErrorZ;
/**
- * Details about a node in the network, known from the network announcement.
+ * A reply_channel_range message is a reply to a query_channel_range
+ * message. Multiple reply_channel_range messages can be sent in reply
+ * to a single query_channel_range message. The query recipient makes a
+ * best effort to respond based on their local network view which may
+ * not be a perfect view of the network. The short_channel_ids in the
+ * reply are encoded. We only support encoding_type=0 uncompressed
+ * serialization and do not support encoding_type=1 zlib serialization.
*/
-typedef struct MUST_USE_STRUCT LDKNodeInfo {
+typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeNodeInfo *inner;
+ LDKnativeReplyChannelRange *inner;
bool is_owned;
-} LDKNodeInfo;
+} LDKReplyChannelRange;
-typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
- struct LDKNodeInfo *result;
+typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
+ struct LDKReplyChannelRange *result;
struct LDKDecodeError *err;
-} LDKCResult_NodeInfoDecodeErrorZPtr;
+} LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
-typedef struct LDKCResult_NodeInfoDecodeErrorZ {
- union LDKCResult_NodeInfoDecodeErrorZPtr contents;
+typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
+ union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_NodeInfoDecodeErrorZ;
+} LDKCResult_ReplyChannelRangeDecodeErrorZ;
/**
- * Represents the network as nodes and channels between them
+ * A gossip_timestamp_filter message is used by a node to request
+ * gossip relay for messages in the requested time range when the
+ * gossip_queries feature has been negotiated.
*/
-typedef struct MUST_USE_STRUCT LDKNetworkGraph {
+typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
/**
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
- LDKnativeNetworkGraph *inner;
+ LDKnativeGossipTimestampFilter *inner;
bool is_owned;
-} LDKNetworkGraph;
+} LDKGossipTimestampFilter;
-typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
- struct LDKNetworkGraph *result;
+typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
+ struct LDKGossipTimestampFilter *result;
struct LDKDecodeError *err;
-} LDKCResult_NetworkGraphDecodeErrorZPtr;
+} LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
-typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
- union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
+typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
+ union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
bool result_ok;
-} LDKCResult_NetworkGraphDecodeErrorZ;
+} LDKCResult_GossipTimestampFilterDecodeErrorZ;
/**
* A trait indicating an object may generate message send events
-/**
- * Options which apply on a per-channel basis and may change at runtime or based on negotiation
- * with our counterparty.
- */
-typedef struct MUST_USE_STRUCT LDKChannelConfig {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeChannelConfig *inner;
- bool is_owned;
-} LDKChannelConfig;
-
-
-
/**
* Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
*
void (*free)(void *this_arg);
} LDKAccess;
+/**
+ * The `Listen` trait is used to be notified of 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.
+ */
+typedef struct LDKListen {
+ void *this_arg;
+ /**
+ * Notifies the listener that a block was added at the given height.
+ */
+ void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
+ /**
+ * Notifies the listener that a block was removed at the given height.
+ */
+ void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
+ void (*free)(void *this_arg);
+} LDKListen;
+
/**
* The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
* channels.
* Nearly everywhere, 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;
- bool is_owned;
-} LDKChainMonitor;
-
-
-
-/**
- * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
- * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
- * preimage claim backward will lead to loss of funds.
- *
- * [`chain::Watch`]: ../trait.Watch.html
- */
-typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeHTLCUpdate *inner;
+ LDKnativeChainMonitor *inner;
bool is_owned;
-} LDKHTLCUpdate;
+} LDKChainMonitor;
bool is_owned;
} LDKKeysManager;
-
-
-/**
- * Features used within an `init` message.
- */
-typedef struct MUST_USE_STRUCT LDKInitFeatures {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeInitFeatures *inner;
- bool is_owned;
-} LDKInitFeatures;
-
typedef struct LDKThreeBytes {
uint8_t data[3];
} LDKThreeBytes;
-
-
-/**
- * A commitment_signed message to be sent or received from a peer
- */
-typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeCommitmentSigned *inner;
- bool is_owned;
-} LDKCommitmentSigned;
-
-
-
-/**
- * An update_fee message to be sent or received from a peer
- */
-typedef struct MUST_USE_STRUCT LDKUpdateFee {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeUpdateFee *inner;
- bool is_owned;
-} LDKUpdateFee;
-
/**
* A trait to describe an object which can receive channel messages.
*
/**
* Handle an incoming shutdown message from the given peer.
*/
- void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
+ void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInitFeatures *NONNULL_PTR their_features, const struct LDKShutdown *NONNULL_PTR msg);
/**
* Handle an incoming closing_signed message from the given peer.
*/
bool is_owned;
} LDKDataLossProtect;
-
-
-/**
- * Features used within a `node_announcement` message.
- */
-typedef struct MUST_USE_STRUCT LDKNodeFeatures {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeNodeFeatures *inner;
- bool is_owned;
-} LDKNodeFeatures;
-
-
-
-/**
- * Features used within a `channel_announcement` message.
- */
-typedef struct MUST_USE_STRUCT LDKChannelFeatures {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeChannelFeatures *inner;
- bool is_owned;
-} LDKChannelFeatures;
-
/**
* A trait to describe an object which can receive routing messages.
*
-/**
- * Late-bound per-channel counterparty data used to build transactions.
- */
-typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
- /**
- * Nearly everywhere, 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;
- bool is_owned;
-} LDKCounterpartyChannelTransactionParameters;
+/**
+ * Static channel fields used to build transactions given per-commitment fields, organized by
+ * broadcaster/countersignatory.
+ *
+ * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
+ * as_holder_broadcastable and as_counterparty_broadcastable functions.
+ */
+typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
+ /**
+ * Nearly everywhere, 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;
+ bool is_owned;
+} LDKDirectedChannelTransactionParameters;
+
+
+
+/**
+ * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
+ * This exists only to make accessing a RwLock<NetworkGraph> possible from
+ * the C bindings, as it can be done directly in Rust code.
+ */
+typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
+ /**
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeLockedNetworkGraph *inner;
+ bool is_owned;
+} LDKLockedNetworkGraph;
+
+
+
+/**
+ * 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 LDKNetGraphMsgHandler {
+ /**
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeNetGraphMsgHandler *inner;
+ bool is_owned;
+} LDKNetGraphMsgHandler;
+
+extern const uintptr_t MAX_BUF_SIZE;
+
+extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
+
+extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
+
+extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
+
+void Transaction_free(struct LDKTransaction _res);
+
+void TxOut_free(struct LDKTxOut _res);
+
+struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
+
+struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
+
+struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
+
+void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
+
+struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
+
+struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
+
+void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
+
+struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
+
+struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
+
+struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
+
+struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
+
+struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
+
+struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
+
+void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
+
+struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
+
+struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
+
+struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
+
+struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
+
+struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
+
+struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
+
+struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
+
+void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
+
+struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
+
+struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
+
+struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
+
+struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
+
+struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
+
+struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
+
+struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
+
+struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
+
+void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
+
+struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
+
+struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
+
+void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
+
+struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
+
+void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
+
+void CVec_u8Z_free(struct LDKCVec_u8Z _res);
+
+struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
+
+struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
+
+void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
+
+struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
+
+struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
+
+void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
+
+struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
+
+struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
+
+void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
+
+struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
+
+struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
+
+struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
+
+struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
+
+struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
+
+struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
+
+struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
+
+struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
+
+struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
+
+struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
+
+void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
+
+struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
+
+struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
+
+struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
+
+void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
+
+void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
+
+void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
+
+struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
+
+struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
+
+void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
+
+struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
+void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
+struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
-/**
- * Static channel fields used to build transactions given per-commitment fields, organized by
- * broadcaster/countersignatory.
- *
- * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
- * as_holder_broadcastable and as_counterparty_broadcastable functions.
- */
-typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
- /**
- * Nearly everywhere, 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;
- bool is_owned;
-} LDKDirectedChannelTransactionParameters;
+struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
+void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
+struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
-/**
- * A pre-built Bitcoin commitment transaction and its txid.
- */
-typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
- /**
- * Nearly everywhere, 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;
- bool is_owned;
-} LDKBuiltCommitmentTransaction;
+struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
+struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
+void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
-/**
- * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
- * This exists only to make accessing a RwLock<NetworkGraph> possible from
- * the C bindings, as it can be done directly in Rust code.
- */
-typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeLockedNetworkGraph *inner;
- bool is_owned;
-} LDKLockedNetworkGraph;
+struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
+struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
-/**
- * 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 LDKNetGraphMsgHandler {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeNetGraphMsgHandler *inner;
- bool is_owned;
-} LDKNetGraphMsgHandler;
+void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
+struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
+void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
-/**
- * Details about one direction of a channel. Received
- * within a channel update.
- */
-typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeDirectionalChannelInfo *inner;
- bool is_owned;
-} LDKDirectionalChannelInfo;
+struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
+struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
+void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
-/**
- * Details about a channel (both directions).
- * Received within a channel announcement.
- */
-typedef struct MUST_USE_STRUCT LDKChannelInfo {
- /**
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeChannelInfo *inner;
- bool is_owned;
-} LDKChannelInfo;
+struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
-extern const uintptr_t MAX_BUF_SIZE;
+void CVec_u64Z_free(struct LDKCVec_u64Z _res);
-extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
+struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
-extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
+struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
-void Transaction_free(struct LDKTransaction _res);
+void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
-void TxOut_free(struct LDKTxOut _res);
+struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
-struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
+struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
-void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
+struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
-void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
+void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
-void CVec_EventZ_free(struct LDKCVec_EventZ _res);
+struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
+void CVec_EventZ_free(struct LDKCVec_EventZ _res);
+
+struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
+
+struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
+
+struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
+
struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
+
+struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
+
+struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
+
struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
+struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
+
struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
-struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
+void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
+
+struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
+
+struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
+
+void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
+
+struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
+
+struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
+
+void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
+
+struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
+
+void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
+
+void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
+
+void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
+
+struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
+
+struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
+
+void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
+
+struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
+
+void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
+
+struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
+
+void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
+
+struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
-struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
+struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
-void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
+void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
-void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
-
struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
-struct LDKCResult_ChanKeySignerDecodeErrorZ CResult_ChanKeySignerDecodeErrorZ_ok(struct LDKChannelKeys o);
+struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
-struct LDKCResult_ChanKeySignerDecodeErrorZ CResult_ChanKeySignerDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
-void CResult_ChanKeySignerDecodeErrorZ_free(struct LDKCResult_ChanKeySignerDecodeErrorZ _res);
+void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
-struct LDKCResult_ChanKeySignerDecodeErrorZ CResult_ChanKeySignerDecodeErrorZ_clone(const struct LDKCResult_ChanKeySignerDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
-struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_ok(struct LDKInMemoryChannelKeys o);
+void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
-struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
-void CResult_InMemoryChannelKeysDecodeErrorZ_free(struct LDKCResult_InMemoryChannelKeysDecodeErrorZ _res);
+struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
-struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_clone(const struct LDKCResult_InMemoryChannelKeysDecodeErrorZ *NONNULL_PTR orig);
+void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
-struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
+struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
-struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
+struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
-void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
+struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
-struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
+void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
-struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
+struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
-struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
+void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
-void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
+struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
-struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
+struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
-void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
+void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
-struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
+void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
-struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
+void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
+
+struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
+
+struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
+
+struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
+
+void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
+
+struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
+
+struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
+
+void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
+
+struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
+
+struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
+
+void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
+
+struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
+
+struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
+
+struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
+
+struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
+
+void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
+
+void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
+
+void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
+
+void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
+
+struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
+
+struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
+
+struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
+
+struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
+
+struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
+
+struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
+
+struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
+
+struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
+
+struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
+
+struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
+
+struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
+
+struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
+
+struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
+
+struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
-void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
+struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
-struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
+void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
-void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
+struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
-void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
+struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
-struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
+struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
-void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
+void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
-struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
+struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
-struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
-void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
+struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
-struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
+void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
-struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
+struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
-void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
+struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
-struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
+struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
-struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
+void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
-struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
-void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
+struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
-struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
-void CVec_u64Z_free(struct LDKCVec_u64Z _res);
+void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
-void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
+struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
-void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
+struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
-void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
+struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
-void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
+void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
-struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
+struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
-struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
+struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
-void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
+struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
-struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
+void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
-struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
+struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
-struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
+struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
-void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
+struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
-void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
+void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
-void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
+struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
-struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
+struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
-struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
+struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
-void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
+void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
-struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
+struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
-struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
+struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
-struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
-void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
+void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
-struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
-struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
+struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
-struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
-void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
+void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
-struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
+
+struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
+
+struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
+
struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
+
+struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
+
+struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
+
struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
+
+struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
+
+struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
+
struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
-void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
-
-void CVec_u8Z_free(struct LDKCVec_u8Z _res);
-
-struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
-
-struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
-
-void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
-
-struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
-
-struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
-
-struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
-
-void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
-
-struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
-
-struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
-
-struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
-
-void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
-
-struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
-
-struct LDKCResult_SecretKeySecpErrorZ CResult_SecretKeySecpErrorZ_ok(struct LDKSecretKey o);
-
-struct LDKCResult_SecretKeySecpErrorZ CResult_SecretKeySecpErrorZ_err(enum LDKSecp256k1Error e);
-
-void CResult_SecretKeySecpErrorZ_free(struct LDKCResult_SecretKeySecpErrorZ _res);
-
-struct LDKCResult_PublicKeySecpErrorZ CResult_PublicKeySecpErrorZ_ok(struct LDKPublicKey o);
-
-struct LDKCResult_PublicKeySecpErrorZ CResult_PublicKeySecpErrorZ_err(enum LDKSecp256k1Error e);
-
-void CResult_PublicKeySecpErrorZ_free(struct LDKCResult_PublicKeySecpErrorZ _res);
-
-struct LDKCResult_TxCreationKeysSecpErrorZ CResult_TxCreationKeysSecpErrorZ_ok(struct LDKTxCreationKeys o);
-
-struct LDKCResult_TxCreationKeysSecpErrorZ CResult_TxCreationKeysSecpErrorZ_err(enum LDKSecp256k1Error e);
-
-void CResult_TxCreationKeysSecpErrorZ_free(struct LDKCResult_TxCreationKeysSecpErrorZ _res);
-
-struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
-
-struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
-
-void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
-
-struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
-
-struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
-
-void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
-
-struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
-
-void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
-
-void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
-
-struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
-
-struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
-
-void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
-
-struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
-
-void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
-
-struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
-
-struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
-
-void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
-
-struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
-
-struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
-
-struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
-
-void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
-
-struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
-
-struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
-
-struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
-
-void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
-
-struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
-
-struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
-
-struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
-
-void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
-
-struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
-
-struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
-
-struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
-
-void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
-
void Event_free(struct LDKEvent this_ptr);
struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_ptr);
-struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
-
/**
* Confirmations we will wait for before considering the channel locked in.
* Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
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);
+struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
+
MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_ptr);
-struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
-
/**
* Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
* only applies to inbound channels.
MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_funding_satoshis_arg, uint64_t max_htlc_minimum_msat_arg, uint64_t min_max_htlc_value_in_flight_msat_arg, uint64_t max_channel_reserve_satoshis_arg, uint16_t min_max_accepted_htlcs_arg, uint64_t min_dust_limit_satoshis_arg, uint64_t max_dust_limit_satoshis_arg, uint32_t max_minimum_depth_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg);
+struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
+
MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
void ChannelConfig_free(struct LDKChannelConfig this_ptr);
-struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
-
/**
* Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
* This may be allowed to change at runtime in a later update, however doing so must result in
MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
+struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
+
MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
-struct LDKChannelConfig ChannelConfig_read(struct LDKu8slice ser);
+struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
void UserConfig_free(struct LDKUserConfig this_ptr);
-struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
-
/**
* Channel config that we propose to our counterparty.
*/
MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg);
+struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
+
MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
*/
void Access_free(struct LDKAccess this_ptr);
+/**
+ * Calls the free function if one is set
+ */
+void Listen_free(struct LDKListen this_ptr);
+
/**
* Calls the free function if one is set
*/
void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_ptr);
-struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
-
/**
* The sequence number of this update. Updates *must* be replayed in-order according to this
* sequence number (and updates may panic if they are not). The update_id values are strictly
*/
void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
+
struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
-struct LDKHTLCUpdate HTLCUpdate_read(struct LDKu8slice ser);
+struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
void ChannelMonitor_free(struct LDKChannelMonitor this_ptr);
void OutPoint_free(struct LDKOutPoint this_ptr);
-struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
-
/**
* The referenced transaction's txid.
*/
MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
+struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
+
/**
* Convert an `OutPoint` to a lightning channel id.
*/
struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
-struct LDKOutPoint OutPoint_read(struct LDKu8slice ser);
+struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
+
+void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_ptr);
+
+/**
+ * The outpoint which is spendable
+ */
+struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+
+/**
+ * The outpoint which is spendable
+ */
+void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+
+/**
+ * Per commitment point to derive delayed_payment_key by key holder
+ */
+struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+
+/**
+ * Per commitment point to derive delayed_payment_key by key holder
+ */
+void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
+ * the witness_script.
+ */
+uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+
+/**
+ * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
+ * the witness_script.
+ */
+void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * The output which is referenced by the given outpoint
+ */
+void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
+
+/**
+ * The revocation point specific to the commitment transaction which was broadcast. Used to
+ * derive the witnessScript for this output.
+ */
+struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+
+/**
+ * The revocation point specific to the commitment transaction which was broadcast. Used to
+ * derive the witnessScript for this output.
+ */
+void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Arbitrary identification information returned by a call to
+ * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
+ * the channel to spend the output.
+ */
+const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
+
+/**
+ * Arbitrary identification information returned by a call to
+ * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
+ * the channel to spend the output.
+ */
+void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The value of the channel which this output originated from, possibly indirectly.
+ */
+uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+
+/**
+ * The value of the channel which this output originated from, possibly indirectly.
+ */
+void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
+
+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 LDKPublicKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg);
+
+struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
+
+void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_ptr);
+
+/**
+ * The outpoint which is spendable
+ */
+struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+
+/**
+ * The outpoint which is spendable
+ */
+void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+
+/**
+ * The output which is referenced by the given outpoint
+ */
+void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
+
+/**
+ * Arbitrary identification information returned by a call to
+ * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
+ * the channel to spend the output.
+ */
+const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
+
+/**
+ * Arbitrary identification information returned by a call to
+ * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
+ * the channel to spend the output.
+ */
+void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The value of the channel which this transactions spends.
+ */
+uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+
+/**
+ * The value of the channel which this transactions spends.
+ */
+void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
+
+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 LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
-struct LDKChannelKeys ChannelKeys_clone(const struct LDKChannelKeys *NONNULL_PTR orig);
+struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
/**
* Calls the free function if one is set
*/
-void ChannelKeys_free(struct LDKChannelKeys this_ptr);
+void Sign_free(struct LDKSign this_ptr);
/**
* Calls the free function if one is set
*/
void KeysInterface_free(struct LDKKeysInterface this_ptr);
-void InMemoryChannelKeys_free(struct LDKInMemoryChannelKeys this_ptr);
-
-struct LDKInMemoryChannelKeys InMemoryChannelKeys_clone(const struct LDKInMemoryChannelKeys *NONNULL_PTR orig);
+void InMemorySigner_free(struct LDKInMemorySigner this_ptr);
/**
* Private key of anchor tx
*/
-const uint8_t (*InMemoryChannelKeys_get_funding_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
+const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
/**
* Private key of anchor tx
*/
-void InMemoryChannelKeys_set_funding_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
/**
* Holder secret key for blinded revocation pubkey
*/
-const uint8_t (*InMemoryChannelKeys_get_revocation_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
+const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
/**
* Holder secret key for blinded revocation pubkey
*/
-void InMemoryChannelKeys_set_revocation_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
/**
* Holder secret key used for our balance in counterparty-broadcasted commitment transactions
*/
-const uint8_t (*InMemoryChannelKeys_get_payment_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
+const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
/**
* Holder secret key used for our balance in counterparty-broadcasted commitment transactions
*/
-void InMemoryChannelKeys_set_payment_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
/**
* Holder secret key used in HTLC tx
*/
-const uint8_t (*InMemoryChannelKeys_get_delayed_payment_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
+const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
/**
* Holder secret key used in HTLC tx
*/
-void InMemoryChannelKeys_set_delayed_payment_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
/**
* Holder htlc secret key used in commitment tx htlc outputs
*/
-const uint8_t (*InMemoryChannelKeys_get_htlc_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
+const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
/**
* Holder htlc secret key used in commitment tx htlc outputs
*/
-void InMemoryChannelKeys_set_htlc_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
/**
* Commitment seed
*/
-const uint8_t (*InMemoryChannelKeys_get_commitment_seed(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
+const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
/**
* Commitment seed
*/
-void InMemoryChannelKeys_set_commitment_seed(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
/**
- * Create a new InMemoryChannelKeys
+ * Create a new InMemorySigner
*/
-MUST_USE_RES struct LDKInMemoryChannelKeys InMemoryChannelKeys_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 LDKC2Tuple_u64u64Z key_derivation_params);
+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);
/**
* Counterparty pubkeys.
* Will panic if ready_channel wasn't called.
*/
-MUST_USE_RES struct LDKChannelPublicKeys InMemoryChannelKeys_counterparty_pubkeys(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
/**
* The contest_delay value specified by our counterparty and applied on holder-broadcastable
* broadcast a transaction.
* Will panic if ready_channel wasn't called.
*/
-MUST_USE_RES uint16_t InMemoryChannelKeys_counterparty_selected_contest_delay(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
+MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
/**
* The contest_delay value specified by us and applied on transactions broadcastable
* if they broadcast a transaction.
* Will panic if ready_channel wasn't called.
*/
-MUST_USE_RES uint16_t InMemoryChannelKeys_holder_selected_contest_delay(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
+MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
/**
* Whether the holder is the initiator
* Will panic if ready_channel wasn't called.
*/
-MUST_USE_RES bool InMemoryChannelKeys_is_outbound(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
+MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
/**
* Funding outpoint
* Will panic if ready_channel wasn't called.
*/
-MUST_USE_RES struct LDKOutPoint InMemoryChannelKeys_funding_outpoint(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
/**
* Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
*
* Will panic if ready_channel wasn't called.
*/
-MUST_USE_RES struct LDKChannelTransactionParameters InMemoryChannelKeys_get_channel_parameters(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *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 Err if the input at input_idx does not exist, has a non-empty script_sig,
+ * or is not spending the outpoint described by `descriptor.outpoint`.
+ */
+MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ 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);
+
+/**
+ * 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 Err 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 does not have a
+ * sequence set to `descriptor.to_self_delay`.
+ */
+MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ 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);
-struct LDKChannelKeys InMemoryChannelKeys_as_ChannelKeys(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
+struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
-struct LDKCVec_u8Z InMemoryChannelKeys_write(const struct LDKInMemoryChannelKeys *NONNULL_PTR obj);
+struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
-struct LDKCResult_InMemoryChannelKeysDecodeErrorZ InMemoryChannelKeys_read(struct LDKu8slice ser);
+struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
void KeysManager_free(struct LDKKeysManager this_ptr);
* versions. Once the library is more fully supported, the docs will be updated to include a
* detailed description of the guarantee.
*/
-MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], enum LDKNetwork network, uint64_t starting_time_secs, uint32_t starting_time_nanos);
+MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
/**
- * Derive an old set of ChannelKeys for per-channel secrets based on a key derivation
- * parameters.
+ * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
+ *
* Key derivation parameters are accessible through a per-channel secrets
- * ChannelKeys::key_derivation_params and is provided inside DynamicOuputP2WSH in case of
+ * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
* onchain output detection for which a corresponding delayed_payment_key must be derived.
*/
-MUST_USE_RES struct LDKInMemoryChannelKeys KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, uint64_t params_1, uint64_t params_2);
+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]);
+
+/**
+ * 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.
+ *
+ * Returns `Err(())` if the output value is greater than the input value minus required fee or
+ * if a descriptor was duplicated.
+ *
+ * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
+ *
+ * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
+ * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
+ */
+MUST_USE_RES struct LDKCResult_TransactionNoneZ KeysManager_spend_spendable_outputs(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight);
struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
void ChannelDetails_free(struct LDKChannelDetails this_ptr);
-struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
-
/**
* 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).
*/
void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
+struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
+
void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
+struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
/**
* Updates channel state based on transactions seen in a connected block.
*/
*/
void ChannelManager_block_disconnected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80]);
+/**
+ * Blocks until ChannelManager needs to be persisted. Only one listener on `wait` is
+ * guaranteed to be woken up.
+ */
+void ChannelManager_wait(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
void Init_free(struct LDKInit this_ptr);
+/**
+ * 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);
+
+MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
+
struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
void ErrorMessage_free(struct LDKErrorMessage this_ptr);
-struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
-
/**
* The channel ID involved in the error
*/
MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
-void Ping_free(struct LDKPing this_ptr);
+struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
-struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
+void Ping_free(struct LDKPing this_ptr);
/**
* The desired response length
MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
-void Pong_free(struct LDKPong this_ptr);
+struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
-struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
+void Pong_free(struct LDKPong this_ptr);
/**
* The pong packet size.
MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
-void OpenChannel_free(struct LDKOpenChannel this_ptr);
+struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
-struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
+void OpenChannel_free(struct LDKOpenChannel this_ptr);
/**
* The genesis hash of the blockchain where the channel is to be opened
*/
void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
-void AcceptChannel_free(struct LDKAcceptChannel this_ptr);
+struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
-struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
+void AcceptChannel_free(struct LDKAcceptChannel this_ptr);
/**
* A temporary channel ID, until the funding outpoint is announced
*/
void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
-void FundingCreated_free(struct LDKFundingCreated this_ptr);
+struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
-struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
+void FundingCreated_free(struct LDKFundingCreated this_ptr);
/**
* A temporary channel ID, until the funding is established
MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKSignature signature_arg);
-void FundingSigned_free(struct LDKFundingSigned this_ptr);
+struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
-struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
+void FundingSigned_free(struct LDKFundingSigned this_ptr);
/**
* The channel ID
MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
-void FundingLocked_free(struct LDKFundingLocked this_ptr);
+struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
-struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
+void FundingLocked_free(struct LDKFundingLocked this_ptr);
/**
* The channel ID
MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
-void Shutdown_free(struct LDKShutdown this_ptr);
+struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
-struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
+void Shutdown_free(struct LDKShutdown this_ptr);
/**
* The channel ID
MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
-void ClosingSigned_free(struct LDKClosingSigned this_ptr);
+struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
-struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
+void ClosingSigned_free(struct LDKClosingSigned this_ptr);
/**
* The channel ID
MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
-void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_ptr);
+struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
-struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
+void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_ptr);
/**
* The channel ID
*/
void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
-void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_ptr);
+struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
-struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
+void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_ptr);
/**
* The channel ID
MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
-void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_ptr);
+struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
-struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
+void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_ptr);
/**
* The channel ID
*/
void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
-void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_ptr);
+struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
-struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
+void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_ptr);
/**
* The channel ID
*/
void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
-void CommitmentSigned_free(struct LDKCommitmentSigned this_ptr);
+struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
-struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
+void CommitmentSigned_free(struct LDKCommitmentSigned this_ptr);
/**
* The channel ID
MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
-void RevokeAndACK_free(struct LDKRevokeAndACK this_ptr);
+struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
-struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
+void RevokeAndACK_free(struct LDKRevokeAndACK this_ptr);
/**
* The channel ID
MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg);
-void UpdateFee_free(struct LDKUpdateFee this_ptr);
+struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
-struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
+void UpdateFee_free(struct LDKUpdateFee this_ptr);
/**
* The channel ID
MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
-void DataLossProtect_free(struct LDKDataLossProtect this_ptr);
+struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
-struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
+void DataLossProtect_free(struct LDKDataLossProtect this_ptr);
/**
* Proof that the sender knows the per-commitment secret of a specific commitment transaction
MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
-void ChannelReestablish_free(struct LDKChannelReestablish this_ptr);
+struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
-struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
+void ChannelReestablish_free(struct LDKChannelReestablish this_ptr);
/**
* The channel ID
*/
void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
-void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_ptr);
+struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
-struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
+void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_ptr);
/**
* The channel ID
MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, struct LDKSignature node_signature_arg, struct LDKSignature bitcoin_signature_arg);
+struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
+
void NetAddress_free(struct LDKNetAddress this_ptr);
struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_ptr);
-struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
-
/**
* The advertised features
*/
*/
void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
-void NodeAnnouncement_free(struct LDKNodeAnnouncement this_ptr);
+struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
-struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
+void NodeAnnouncement_free(struct LDKNodeAnnouncement this_ptr);
/**
* The signature by the node key
MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
-void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_ptr);
+struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
-struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
+void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_ptr);
/**
* The advertised channel features
*/
void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
-void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_ptr);
+struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
-struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
+void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_ptr);
/**
* Authentication of the announcement by the first public node
MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKSignature node_signature_1_arg, struct LDKSignature node_signature_2_arg, struct LDKSignature bitcoin_signature_1_arg, struct LDKSignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg);
-void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_ptr);
+struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
-struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
+void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_ptr);
/**
* The genesis hash of the blockchain where the channel is to be opened
*/
void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
-void ChannelUpdate_free(struct LDKChannelUpdate this_ptr);
+struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
-struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
+void ChannelUpdate_free(struct LDKChannelUpdate this_ptr);
/**
* A signature of the channel update
MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
-void QueryChannelRange_free(struct LDKQueryChannelRange this_ptr);
+struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
-struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
+void QueryChannelRange_free(struct LDKQueryChannelRange this_ptr);
/**
* The genesis hash of the blockchain being queried
MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
-void ReplyChannelRange_free(struct LDKReplyChannelRange this_ptr);
+struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
-struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
+void ReplyChannelRange_free(struct LDKReplyChannelRange this_ptr);
/**
* The genesis hash of the blockchain being queried
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 QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_ptr);
+struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
-struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
+void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_ptr);
/**
* The genesis hash of the blockchain being queried
MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
-void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_ptr);
+struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
-struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
+void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_ptr);
/**
* The genesis hash of the blockchain that was queried
MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
-void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_ptr);
+struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
-struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
+void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_ptr);
/**
* The genesis hash of the blockchain for channel and node information
MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
+struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
+
void ErrorAction_free(struct LDKErrorAction this_ptr);
struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
void LightningError_free(struct LDKLightningError this_ptr);
-struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
-
/**
* A human-readable message describing the error
*/
MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg);
-void CommitmentUpdate_free(struct LDKCommitmentUpdate this_ptr);
+struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
-struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
+void CommitmentUpdate_free(struct LDKCommitmentUpdate this_ptr);
/**
* update_add_htlc messages which should be sent
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 LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
+
void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
-struct LDKAcceptChannel AcceptChannel_read(struct LDKu8slice ser);
+struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
-struct LDKAnnouncementSignatures AnnouncementSignatures_read(struct LDKu8slice ser);
+struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
-struct LDKClosingSigned ClosingSigned_read(struct LDKu8slice ser);
+struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
-struct LDKCommitmentSigned CommitmentSigned_read(struct LDKu8slice ser);
+struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
-struct LDKFundingCreated FundingCreated_read(struct LDKu8slice ser);
+struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
-struct LDKFundingSigned FundingSigned_read(struct LDKu8slice ser);
+struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
-struct LDKFundingLocked FundingLocked_read(struct LDKu8slice ser);
+struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
-struct LDKOpenChannel OpenChannel_read(struct LDKu8slice ser);
+struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
-struct LDKRevokeAndACK RevokeAndACK_read(struct LDKu8slice ser);
+struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
-struct LDKShutdown Shutdown_read(struct LDKu8slice ser);
+struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
-struct LDKUpdateFailHTLC UpdateFailHTLC_read(struct LDKu8slice ser);
+struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
-struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
+struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
-struct LDKUpdateFee UpdateFee_read(struct LDKu8slice ser);
+struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
-struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_read(struct LDKu8slice ser);
+struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
-struct LDKUpdateAddHTLC UpdateAddHTLC_read(struct LDKu8slice ser);
+struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
-struct LDKChannelAnnouncement ChannelAnnouncement_read(struct LDKu8slice ser);
+struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
-struct LDKChannelUpdate ChannelUpdate_read(struct LDKu8slice ser);
+struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
-struct LDKNodeAnnouncement NodeAnnouncement_read(struct LDKu8slice ser);
+struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
void PeerHandleError_free(struct LDKPeerHandleError this_ptr);
-struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
-
/**
* Used to indicate that we probably can't make any future connections to this peer, implying
* we should go ahead and force-close any channels we have with it.
MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
+struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
+
void PeerManager_free(struct LDKPeerManager this_ptr);
/**
* Note that this is infallible iff we trust that at least one of the two input keys are randomly
* generated (ie our own).
*/
-struct LDKCResult_SecretKeySecpErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
+struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
/**
* Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
* Note that this is infallible iff we trust that at least one of the two input keys are randomly
* generated (ie our own).
*/
-struct LDKCResult_PublicKeySecpErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
+struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
/**
* Derives a per-commitment-transaction revocation key from its constituent parts.
* Note that this is infallible iff we trust that at least one of the two input keys are randomly
* generated (ie our own).
*/
-struct LDKCResult_SecretKeySecpErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
+struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
/**
* Derives a per-commitment-transaction revocation public key from its constituent parts. This is
* Note that this is infallible iff we trust that at least one of the two input keys are randomly
* generated (ie our own).
*/
-struct LDKCResult_PublicKeySecpErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
+struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
void TxCreationKeys_free(struct LDKTxCreationKeys this_ptr);
-struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
-
/**
* The broadcaster's per-commitment public key which was used to derive the other keys.
*/
MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKPublicKey revocation_key_arg, struct LDKPublicKey broadcaster_htlc_key_arg, struct LDKPublicKey countersignatory_htlc_key_arg, struct LDKPublicKey broadcaster_delayed_payment_key_arg);
+struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
+
struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
-struct LDKTxCreationKeys TxCreationKeys_read(struct LDKu8slice ser);
+struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_ptr);
-struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
-
/**
* 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 LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg);
+struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
+
struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
-struct LDKChannelPublicKeys ChannelPublicKeys_read(struct LDKu8slice ser);
+struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_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.
*/
-MUST_USE_RES struct LDKCResult_TxCreationKeysSecpErrorZ TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base);
+MUST_USE_RES struct LDKCResult_TxCreationKeysErrorZ TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base);
/**
* 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.
*/
-MUST_USE_RES struct LDKCResult_TxCreationKeysSecpErrorZ 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 LDKCResult_TxCreationKeysErrorZ TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys);
/**
* A script either spendable by the revocation
void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_ptr);
-struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *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
*/
void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
+
struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
-struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_read(struct LDKu8slice ser);
+struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
/**
* Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_ptr);
-struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
-
/**
* Holder public keys
*/
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);
-void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_ptr);
+struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
-struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
+void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_ptr);
/**
* Counter-party public keys
MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
+struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
+
/**
* Whether the late bound parameters are populated.
*/
struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
-struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
+struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
-struct LDKChannelTransactionParameters ChannelTransactionParameters_read(struct LDKu8slice ser);
+struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_ptr);
void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_ptr);
-struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
-
/**
* Our counterparty's signature for the transaction
*/
*/
void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
+struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
+
struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
-struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_read(struct LDKu8slice ser);
+struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
/**
* Create a new holder transaction with the given counterparty signatures.
void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_ptr);
-struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
-
/**
* The commitment transaction
*/
MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
+struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
+
struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
-struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_read(struct LDKu8slice ser);
+struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
/**
* Get the SIGHASH_ALL sighash value of the transaction.
struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
-struct LDKCommitmentTransaction CommitmentTransaction_read(struct LDKu8slice ser);
+struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
/**
* The backwards-counting commitment number
*/
uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
+struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
+
+struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
+
+struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
+
void InitFeatures_free(struct LDKInitFeatures this_ptr);
void NodeFeatures_free(struct LDKNodeFeatures this_ptr);
void ChannelFeatures_free(struct LDKChannelFeatures this_ptr);
-void RouteHop_free(struct LDKRouteHop this_ptr);
+/**
+ * Create a blank Features with no features set
+ */
+MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
-struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
+/**
+ * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
+ *
+ * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+ */
+MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
+
+/**
+ * Create a blank Features with no features set
+ */
+MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
+
+/**
+ * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
+ *
+ * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+ */
+MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
+
+/**
+ * Create a blank Features with no features set
+ */
+MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
+
+/**
+ * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
+ *
+ * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+ */
+MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
+
+struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
+
+struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
+
+struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
+
+struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
+
+struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
+
+struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
+
+void RouteHop_free(struct LDKRouteHop this_ptr);
/**
* The node_id of the node at this hop.
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);
-void Route_free(struct LDKRoute this_ptr);
+struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
-struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
+void Route_free(struct LDKRoute this_ptr);
/**
* The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
+struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
+
struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
void RouteHint_free(struct LDKRouteHint this_ptr);
-struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
-
/**
* The node_id of the non-target end of the route
*/
MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg);
+struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
+
/**
* Gets a route from us to the given target node.
*
void NetworkGraph_free(struct LDKNetworkGraph this_ptr);
+struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
+
void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_ptr);
void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_ptr);
void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_ptr);
-struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
-
/**
* When the last update to the channel direction was issued.
* Value is opaque, as set in the announcement.
*/
void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
+struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
+
struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
-struct LDKDirectionalChannelInfo DirectionalChannelInfo_read(struct LDKu8slice ser);
+struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
void ChannelInfo_free(struct LDKChannelInfo this_ptr);
*/
void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
+struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
+
struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
-struct LDKChannelInfo ChannelInfo_read(struct LDKu8slice ser);
+struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
void RoutingFees_free(struct LDKRoutingFees this_ptr);
-struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
-
/**
* Flat routing fee in satoshis
*/
MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
+struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
+
struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_ptr);
-struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
-
/**
* Protocol features the node announced support for
*/
MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKThirtyTwoBytes alias_arg, struct LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg);
+struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
+
struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
void NodeInfo_free(struct LDKNodeInfo this_ptr);
-struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
-
/**
* All valid channels a node has announced
*/
MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
+struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
+
struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);