+} LDKPersist;
+
+
+
+/**
+ * An implementation of [`chain::Watch`] for monitoring channels.
+ *
+ * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
+ * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
+ * or used independently to monitor channels remotely. See the [module-level documentation] for
+ * details.
+ *
+ * [`chain::Watch`]: ../trait.Watch.html
+ * [`ChannelManager`]: ../../ln/channelmanager/struct.ChannelManager.html
+ * [module-level documentation]: index.html
+ */
+typedef struct MUST_USE_STRUCT LDKChainMonitor {
+ /**
+ * Nearly everywhere, 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;
+
+typedef struct LDKCVecTempl_C2TupleTempl_usize__Transaction {
+ struct LDKC2TupleTempl_usize__Transaction *data;
+ uintptr_t datalen;
+} LDKCVecTempl_C2TupleTempl_usize__Transaction;
+
+typedef struct LDKCVecTempl_C2TupleTempl_usize__Transaction LDKCVec_C2Tuple_usizeTransactionZZ;
+
+
+
+/**
+ * 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 LDKCResultPtr_ChannelMonitorUpdate__DecodeError {
+ struct LDKChannelMonitorUpdate *result;
+ struct LDKDecodeError *err;
+} LDKCResultPtr_ChannelMonitorUpdate__DecodeError;
+
+typedef struct LDKCResultTempl_ChannelMonitorUpdate__DecodeError {
+ union LDKCResultPtr_ChannelMonitorUpdate__DecodeError contents;
+ bool result_ok;
+} LDKCResultTempl_ChannelMonitorUpdate__DecodeError;
+
+typedef struct LDKCResultTempl_ChannelMonitorUpdate__DecodeError LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
+
+
+
+/**
+ * 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;
+
+typedef struct LDKCVecTempl_Transaction {
+ struct LDKTransaction *data;
+ uintptr_t datalen;
+} LDKCVecTempl_Transaction;
+
+typedef struct LDKCVecTempl_Transaction LDKCVec_TransactionZ;
+
+typedef struct LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut {
+ struct LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut *data;
+ uintptr_t datalen;
+} LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut;
+
+typedef struct LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ;
+
+typedef union LDKCResultPtr_SpendableOutputDescriptor__DecodeError {
+ struct LDKSpendableOutputDescriptor *result;
+ struct LDKDecodeError *err;
+} LDKCResultPtr_SpendableOutputDescriptor__DecodeError;
+
+typedef struct LDKCResultTempl_SpendableOutputDescriptor__DecodeError {
+ union LDKCResultPtr_SpendableOutputDescriptor__DecodeError contents;
+ bool result_ok;
+} LDKCResultTempl_SpendableOutputDescriptor__DecodeError;
+
+typedef struct LDKCResultTempl_SpendableOutputDescriptor__DecodeError LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
+
+typedef struct LDKSecretKey {
+ uint8_t bytes[32];
+} LDKSecretKey;
+
+typedef union LDKCResultPtr_ChannelKeys__DecodeError {
+ struct LDKChannelKeys *result;
+ struct LDKDecodeError *err;
+} LDKCResultPtr_ChannelKeys__DecodeError;
+
+typedef struct LDKCResultTempl_ChannelKeys__DecodeError {
+ union LDKCResultPtr_ChannelKeys__DecodeError contents;
+ bool result_ok;
+} LDKCResultTempl_ChannelKeys__DecodeError;
+
+typedef struct LDKCResultTempl_ChannelKeys__DecodeError LDKCResult_ChanKeySignerDecodeErrorZ;
+
+/**
+ * A trait to describe an object which can get user secrets and key material.
+ */
+typedef struct LDKKeysInterface {
+ void *this_arg;
+ /**
+ * Get node secret key (aka node_id or network_key)
+ */
+ struct LDKSecretKey (*get_node_secret)(const void *this_arg);
+ /**
+ * Get destination redeemScript to encumber static protocol exit points.
+ */
+ LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
+ /**
+ * Get shutdown_pubkey to use as PublicKey at channel closure
+ */
+ 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
+ * restarted with some stale data!
+ */
+ struct LDKChannelKeys (*get_channel_keys)(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.
+ */
+ struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
+ /**
+ * Reads a `ChanKeySigner` 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
+ * 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.
+ */
+ LDKCResult_ChanKeySignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
+ void (*free)(void *this_arg);
+} LDKKeysInterface;
+
+
+
+/**
+ * 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 LDKCResultPtr_InMemoryChannelKeys__DecodeError {
+ struct LDKInMemoryChannelKeys *result;
+ struct LDKDecodeError *err;
+} LDKCResultPtr_InMemoryChannelKeys__DecodeError;
+
+typedef struct LDKCResultTempl_InMemoryChannelKeys__DecodeError {
+ union LDKCResultPtr_InMemoryChannelKeys__DecodeError contents;
+ bool result_ok;
+} LDKCResultTempl_InMemoryChannelKeys__DecodeError;
+
+typedef struct LDKCResultTempl_InMemoryChannelKeys__DecodeError LDKCResult_InMemoryChannelKeysDecodeErrorZ;
+
+
+
+/**
+ * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
+ * and derives keys from that.
+ *
+ * Your node_id is seed/0'
+ * ChannelMonitor closes may use seed/1'
+ * Cooperative closes may use seed/2'
+ * The two close keys may be needed to claim on-chain funds!
+ */
+typedef struct MUST_USE_STRUCT LDKKeysManager {
+ /**
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeKeysManager *inner;
+ bool is_owned;
+} LDKKeysManager;