+/**
+ * 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 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
+ * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
+ *
+ * A more secure iteration would be to use hashlock (or payment points) to pair
+ * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
+ * at the price of more state and computation on the hardware wallet side. In the future,
+ * we are looking forward to design such interface.
+ *
+ * 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.
+ */
+typedef struct LDKBaseSign {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Gets the per-commitment point for a specific commitment number
+ *
+ * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
+ */
+ struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
+ /**
+ * Gets the commitment secret for a specific commitment number as part of the revocation process
+ *
+ * An external signer implementation should error here if the commitment was already signed
+ * and should refuse to sign it in the future.
+ *
+ * May be called more than once for the same index.
+ *
+ * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
+ */
+ struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
+ /**
+ * Gets the holder's channel public keys and basepoints
+ */
+ struct LDKChannelPublicKeys pubkeys;
+ /**
+ * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
+ * 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 LDKBaseSign*NONNULL_PTR );
+ /**
+ * 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 LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
+ /**
+ * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
+ *
+ * Note that if signing fails or is rejected, the channel will be force-closed.
+ */
+ struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
+ /**
+ * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
+ * This will only ever be called with a non-revoked commitment_tx. This will be called with the
+ * latest commitment_tx when we initiate a force-close.
+ * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
+ * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
+ * the latest.
+ * This may be called multiple times for the same transaction.
+ *
+ * An external signer implementation should check that the commitment has not been revoked.
+ *
+ * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
+ */
+ struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
+ /**
+ * Create a signature for the given input in a transaction spending an HTLC or commitment
+ * transaction output when our counterparty broadcasts an old state.
+ *
+ * A justice transaction may claim multiples outputs at the same time if timelocks are
+ * similar, but only a signature for the input at index `input` should be signed for here.
+ * It may be called multiples time for same output(s) if a fee-bump is needed with regards
+ * to an upcoming timelock expiration.
+ *
+ * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
+ *
+ * per_commitment_key is revocation secret which was provided by our counterparty when they
+ * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
+ * not allow the spending of any funds by itself (you need our holder revocation_secret to do
+ * so).
+ *
+ * htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus
+ * changing the format of the witness script (which is committed to in the BIP 143
+ * signatures).
+ */
+ struct LDKCResult_SignatureNoneZ (*sign_justice_transaction)(const void *this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc);
+ /**
+ * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
+ * transaction, either offered or received.
+ *
+ * Such a transaction may claim multiples offered outputs at same time if we know the
+ * preimage for each when we create it, but only the input at index `input` should be
+ * signed for here. It may be called multiple times for same output(s) if a fee-bump is
+ * needed with regards to an upcoming timelock expiration.
+ *
+ * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
+ * outputs.
+ *
+ * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
+ *
+ * Per_commitment_point is the dynamic point corresponding to the channel state
+ * detected onchain. It has been generated by our counterparty and is used to derive
+ * channel state keys, which are then included in the witness script and committed to in the
+ * BIP 143 signature.
+ */
+ struct LDKCResult_SignatureNoneZ (*sign_counterparty_htlc_transaction)(const void *this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc);
+ /**
+ * Create a signature for a (proposed) closing transaction.
+ *
+ * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
+ * chosen to forgo their output as dust.
+ */
+ struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
+ /**
+ * Signs a channel announcement message with our funding key, proving it comes from one
+ * of the channel participants.
+ *
+ * Note that if this fails or is rejected, the channel will not be publicly announced and
+ * our counterparty may (though likely will not) close the channel on us for violating the
+ * protocol.
+ */
+ struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
+ /**
+ * Set the counterparty static channel data, including basepoints,
+ * counterparty_selected/holder_selected_contest_delay and funding outpoint.
+ * This is done as soon as the funding outpoint is known. Since these are static channel data,
+ * they MUST NOT be allowed to change to different values once set.
+ *
+ * channel_parameters.is_populated() MUST be true.
+ *
+ * We bind holder_selected_contest_delay late here for API convenience.
+ *
+ * Will be called before any signatures are applied.
+ */
+ void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKBaseSign;
+
+/**
+ * A cloneable signer.
+ *
+ * Although we require signers to be cloneable, it may be useful for developers to be able to use
+ * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
+ * which implies Sized, into this derived trait.
+ */
+typedef struct LDKSign {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Implementation of BaseSign for this object.
+ */
+ struct LDKBaseSign BaseSign;
+ /**
+ * Creates a copy of the BaseSign, for a copy of this Sign.
+ * Because BaseSign doesn't natively support copying itself, you have to provide a full copy implementation here.
+ */
+ struct LDKBaseSign (*BaseSign_clone)(const struct LDKBaseSign *NONNULL_PTR orig_BaseSign);
+ /**
+ * Serialize the object into a byte array
+ */
+ struct LDKCVec_u8Z (*write)(const void *this_arg);
+ /**
+ * Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
+ * Note that the ultimate copy of the Sign will have all function pointers the same as the original.
+ * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
+ */
+ void *(*clone)(const void *this_arg);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKSign;
+
+
+
+/**
+ * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
+ * on-chain transactions to ensure no loss of funds occurs.
+ *
+ * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
+ * information and are actively monitoring the chain.
+ *
+ * Pending Events or updated HTLCs which have not yet been read out by
+ * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
+ * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
+ * gotten are fully handled before re-serializing the new state.
+ *
+ * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
+ * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
+ * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
+ * returned block hash and the the current chain and then reconnecting blocks to get to the
+ * best chain) upon deserializing the object!
+ */
+typedef struct MUST_USE_STRUCT LDKChannelMonitor {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeChannelMonitor *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKChannelMonitor;
+
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
+ /**
+ * The element at position 0
+ */
+ struct LDKThirtyTwoBytes a;
+ /**
+ * The element at position 1
+ */
+ struct LDKChannelMonitor b;
+} LDKC2Tuple_BlockHashChannelMonitorZ;
+
+/**
+ * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
+ */
+typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
+
+/**
+ * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
+ /**
+ * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
+
+
+
+/**
+ * A hop in a route
+ */
+typedef struct MUST_USE_STRUCT LDKRouteHop {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeRouteHop *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKRouteHop;
+
+/**
+ * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_RouteHopZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKRouteHop *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_RouteHopZ;
+
+/**
+ * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_CVec_RouteHopZZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKCVec_RouteHopZ *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_CVec_RouteHopZZ;
+
+
+
+/**
+ * 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 LDKRoute {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeRoute *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKRoute;
+
+/**
+ * The contents of CResult_RouteDecodeErrorZ
+ */
+typedef union LDKCResult_RouteDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKRoute *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_RouteDecodeErrorZPtr;
+
+/**
+ * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_RouteDecodeErrorZ {
+ /**
+ * The contents of this CResult_RouteDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_RouteDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_RouteDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_RouteDecodeErrorZ;
+
+/**
+ * An enum which can either contain a u64 or not
+ */
+typedef enum LDKCOption_u64Z_Tag {
+ /**
+ * When we're in this state, this COption_u64Z contains a u64
+ */
+ LDKCOption_u64Z_Some,
+ /**
+ * When we're in this state, this COption_u64Z contains nothing
+ */
+ LDKCOption_u64Z_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_u64Z_Sentinel,
+} LDKCOption_u64Z_Tag;
+
+typedef struct LDKCOption_u64Z {
+ LDKCOption_u64Z_Tag tag;
+ union {
+ struct {
+ uint64_t some;
+ };
+ };
+} LDKCOption_u64Z;
+
+
+
+/**
+ * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
+ */
+typedef struct MUST_USE_STRUCT LDKChannelDetails {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeChannelDetails *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKChannelDetails;
+
+/**
+ * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_ChannelDetailsZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKChannelDetails *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_ChannelDetailsZ;
+
+
+
+/**
+ * A channel descriptor which provides a last-hop route to get_route
+ */
+typedef struct MUST_USE_STRUCT LDKRouteHint {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeRouteHint *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKRouteHint;
+
+/**
+ * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_RouteHintZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKRouteHint *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_RouteHintZ;
+
+
+
+/**
+ * An Err type for failure to process messages.
+ */
+typedef struct MUST_USE_STRUCT LDKLightningError {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeLightningError *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKLightningError;
+
+/**
+ * The contents of CResult_RouteLightningErrorZ
+ */
+typedef union LDKCResult_RouteLightningErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKRoute *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKLightningError *err;
+} LDKCResult_RouteLightningErrorZPtr;
+
+/**
+ * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_RouteLightningErrorZ {
+ /**
+ * The contents of this CResult_RouteLightningErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_RouteLightningErrorZPtr contents;
+ /**
+ * Whether this CResult_RouteLightningErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_RouteLightningErrorZ;
+
+
+
+/**
+ * An accept_channel message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKAcceptChannel {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeAcceptChannel *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKAcceptChannel;
+
+
+
+/**
+ * An open_channel message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKOpenChannel {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeOpenChannel *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKOpenChannel;
+
+
+
+/**
+ * A funding_created message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKFundingCreated {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeFundingCreated *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKFundingCreated;
+
+
+
+/**
+ * A funding_signed message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKFundingSigned {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeFundingSigned *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKFundingSigned;
+
+
+
+/**
+ * A funding_locked message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKFundingLocked {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeFundingLocked *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKFundingLocked;
+
+
+
+/**
+ * An announcement_signatures message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeAnnouncementSignatures *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} 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 {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeCommitmentUpdate *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKCommitmentUpdate;
+
+
+
+/**
+ * A revoke_and_ack message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeRevokeAndACK *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKRevokeAndACK;
+
+
+
+/**
+ * A closing_signed message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKClosingSigned {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeClosingSigned *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKClosingSigned;
+
+
+
+/**
+ * A shutdown message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKShutdown {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeShutdown *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKShutdown;
+
+
+
+/**
+ * A channel_reestablish message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKChannelReestablish {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeChannelReestablish *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKChannelReestablish;
+
+
+
+/**
+ * A channel_announcement message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeChannelAnnouncement *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKChannelAnnouncement;
+
+
+
+/**
+ * A channel_update message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKChannelUpdate {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeChannelUpdate *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKChannelUpdate;
+
+
+
+/**
+ * A node_announcement message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeNodeAnnouncement *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKNodeAnnouncement;
+
+
+
+/**
+ * An error message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKErrorMessage {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeErrorMessage *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKErrorMessage;
+
+/**
+ * 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 struct LDKErrorAction_LDKDisconnectPeer_Body {
+ /**
+ * An error message which we should make an effort to send before we disconnect.
+ */
+ struct LDKErrorMessage msg;
+} LDKErrorAction_LDKDisconnectPeer_Body;
+
+typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
+ /**
+ * The message to send.
+ */
+ 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 {
+ /**
+ * The unwrapped message we received
+ */
+ struct LDKChannelUpdate msg;
+} LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
+
+typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
+ /**
+ * The short_channel_id which has now closed.
+ */
+ uint64_t short_channel_id;
+ /**
+ * when this true, this channel should be permanently removed from the
+ * consideration. Otherwise, this channel can be restored as new channel_update is received
+ */
+ bool is_permanent;
+} LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
+
+typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
+ /**
+ * The node_id that has failed.
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * when this true, node should be permanently removed from the
+ * consideration. Otherwise, the channels connected to this node can be
+ * restored as new channel_update is received
+ */
+ bool is_permanent;
+} LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
+
+typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
+ LDKHTLCFailChannelUpdate_Tag tag;
+ union {
+ LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
+ LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
+ LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
+ };
+} LDKHTLCFailChannelUpdate;
+
+
+
+/**
+ * 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 {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeQueryChannelRange *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} 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 {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeQueryShortChannelIds *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKQueryShortChannelIds;
+
+
+
+/**
+ * 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 LDKReplyChannelRange {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeReplyChannelRange *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKReplyChannelRange;
+
+/**
+ * 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,
+ /**
+ * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
+ * emitted during processing of the query.
+ */
+ LDKMessageSendEvent_SendReplyChannelRange,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKMessageSendEvent_Sentinel,
+} LDKMessageSendEvent_Tag;
+
+typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
+ struct LDKAcceptChannel msg;
+} LDKMessageSendEvent_LDKSendAcceptChannel_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
+ struct LDKOpenChannel msg;
+} LDKMessageSendEvent_LDKSendOpenChannel_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
+ struct LDKFundingCreated msg;
+} LDKMessageSendEvent_LDKSendFundingCreated_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
+ struct LDKFundingSigned msg;
+} LDKMessageSendEvent_LDKSendFundingSigned_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
+ /**
+ * The node_id of the node which should receive these message(s)
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The funding_locked message which should be sent.
+ */
+ struct LDKFundingLocked msg;
+} LDKMessageSendEvent_LDKSendFundingLocked_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
+ /**
+ * The node_id of the node which should receive these message(s)
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The announcement_signatures message which should be sent.
+ */
+ struct LDKAnnouncementSignatures msg;
+} LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
+
+typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
+ /**
+ * The node_id of the node which should receive these message(s)
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The update messages which should be sent. ALL messages in the struct should be sent!
+ */
+ struct LDKCommitmentUpdate updates;
+} LDKMessageSendEvent_LDKUpdateHTLCs_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
+ struct LDKRevokeAndACK msg;
+} LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
+ struct LDKClosingSigned msg;
+} LDKMessageSendEvent_LDKSendClosingSigned_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
+ struct LDKShutdown msg;
+} LDKMessageSendEvent_LDKSendShutdown_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
+ struct LDKChannelReestablish msg;
+} LDKMessageSendEvent_LDKSendChannelReestablish_Body;
+
+typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
+ /**
+ * The channel_announcement which should be sent.
+ */
+ struct LDKChannelAnnouncement msg;
+ /**
+ * The followup channel_update which should be sent.
+ */
+ struct LDKChannelUpdate update_msg;
+} LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
+
+typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
+ /**
+ * The node_announcement which should be sent.
+ */
+ struct LDKNodeAnnouncement msg;
+} LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
+
+typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
+ /**
+ * The channel_update which should be sent.
+ */
+ struct LDKChannelUpdate msg;
+} LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
+
+typedef struct LDKMessageSendEvent_LDKHandleError_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The action which should be taken.
+ */
+ struct LDKErrorAction action;
+} LDKMessageSendEvent_LDKHandleError_Body;
+
+typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
+ /**
+ * The channel/node update which should be sent to NetGraphMsgHandler
+ */
+ struct LDKHTLCFailChannelUpdate update;
+} LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
+ /**
+ * The node_id of this message recipient
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The query_channel_range which should be sent.
+ */
+ struct LDKQueryChannelRange msg;
+} LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
+ /**
+ * The node_id of this message recipient
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The query_short_channel_ids which should be sent.
+ */
+ struct LDKQueryShortChannelIds msg;
+} LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
+
+typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
+ /**
+ * The node_id of this message recipient
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The reply_channel_range which should be sent.
+ */
+ struct LDKReplyChannelRange msg;
+} LDKMessageSendEvent_LDKSendReplyChannelRange_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_LDKSendReplyChannelRange_Body send_reply_channel_range;
+ };
+} LDKMessageSendEvent;
+
+/**
+ * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_MessageSendEventZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKMessageSendEvent *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_MessageSendEventZ;
+
+/**
+ * The contents of CResult_boolLightningErrorZ
+ */
+typedef union LDKCResult_boolLightningErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ bool *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKLightningError *err;
+} LDKCResult_boolLightningErrorZPtr;
+
+/**
+ * A CResult_boolLightningErrorZ represents the result of a fallible operation,
+ * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_boolLightningErrorZ {
+ /**
+ * The contents of this CResult_boolLightningErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_boolLightningErrorZPtr contents;
+ /**
+ * Whether this CResult_boolLightningErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_boolLightningErrorZ;
+
+/**
+ * A tuple of 3 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
+ /**
+ * The element at position 0
+ */
+ struct LDKChannelAnnouncement a;
+ /**
+ * The element at position 1
+ */
+ struct LDKChannelUpdate b;
+ /**
+ * The element at position 2
+ */
+ struct LDKChannelUpdate c;
+} LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
+
+/**
+ * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;