1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
4 /* Generated with cbindgen:0.16.0 */
6 /* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
14 * An error when accessing the chain via [`Access`].
16 typedef enum LDKAccessError {
18 * The requested chain is unknown.
20 LDKAccessError_UnknownChain,
22 * The requested transaction doesn't exist or hasn't confirmed.
24 LDKAccessError_UnknownTx,
26 * Must be last for serialization purposes
28 LDKAccessError_Sentinel,
32 * An error enum representing a failure to persist a channel monitor update.
34 typedef enum LDKChannelMonitorUpdateErr {
36 * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
37 * our state failed, but is expected to succeed at some point in the future).
39 * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
40 * submitting new commitment transactions to the counterparty. Once the update(s) which failed
41 * have been successfully applied, ChannelManager::channel_monitor_updated can be used to
42 * restore the channel to an operational state.
44 * Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If
45 * you return a TemporaryFailure you must ensure that it is written to disk safely before
46 * writing out the latest ChannelManager state.
48 * Even when a channel has been \"frozen\" updates to the ChannelMonitor can continue to occur
49 * (eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting
50 * to claim it on this channel) and those updates must be applied wherever they can be. At
51 * least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should
52 * be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to
53 * the channel which would invalidate previous ChannelMonitors are not made when a channel has
56 * Note that even if updates made after TemporaryFailure succeed you must still call
57 * channel_monitor_updated to ensure you have the latest monitor and re-enable normal channel
60 * Note that the update being processed here will not be replayed for you when you call
61 * ChannelManager::channel_monitor_updated, so you must store the update itself along
62 * with the persisted ChannelMonitor on your own local disk prior to returning a
63 * TemporaryFailure. You may, of course, employ a journaling approach, storing only the
64 * ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at
67 * For deployments where a copy of ChannelMonitors and other local state are backed up in a
68 * remote location (with local copies persisted immediately), it is anticipated that all
69 * updates will return TemporaryFailure until the remote copies could be updated.
71 LDKChannelMonitorUpdateErr_TemporaryFailure,
73 * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a
74 * different watchtower and cannot update with all watchtowers that were previously informed
77 * At reception of this error, ChannelManager will force-close the channel and return at
78 * least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at
79 * least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel
80 * update must be rejected.
82 * This failure may also signal a failure to update the local persisted copy of one of
83 * the channel monitor instance.
85 * Note that even when you fail a holder commitment transaction update, you must store the
86 * update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor
87 * broadcasts it (e.g distributed channel-monitor deployment)
89 * In case of distributed watchtowers deployment, the new version must be written to disk, as
90 * state may have been stored but rejected due to a block forcing a commitment broadcast. This
91 * storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
92 * lagging behind on block processing.
94 LDKChannelMonitorUpdateErr_PermanentFailure,
96 * Must be last for serialization purposes
98 LDKChannelMonitorUpdateErr_Sentinel,
99 } LDKChannelMonitorUpdateErr;
102 * An enum that represents the speed at which we want a transaction to confirm used for feerate
105 typedef enum LDKConfirmationTarget {
107 * We are happy with this transaction confirming slowly when feerate drops some.
109 LDKConfirmationTarget_Background,
111 * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine.
113 LDKConfirmationTarget_Normal,
115 * We'd like this transaction to confirm in the next few blocks.
117 LDKConfirmationTarget_HighPriority,
119 * Must be last for serialization purposes
121 LDKConfirmationTarget_Sentinel,
122 } LDKConfirmationTarget;
125 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
127 typedef enum LDKIOError {
129 LDKIOError_PermissionDenied,
130 LDKIOError_ConnectionRefused,
131 LDKIOError_ConnectionReset,
132 LDKIOError_ConnectionAborted,
133 LDKIOError_NotConnected,
134 LDKIOError_AddrInUse,
135 LDKIOError_AddrNotAvailable,
136 LDKIOError_BrokenPipe,
137 LDKIOError_AlreadyExists,
138 LDKIOError_WouldBlock,
139 LDKIOError_InvalidInput,
140 LDKIOError_InvalidData,
142 LDKIOError_WriteZero,
143 LDKIOError_Interrupted,
145 LDKIOError_UnexpectedEof,
147 * Must be last for serialization purposes
153 * An enum representing the available verbosity levels of the logger.
155 typedef enum LDKLevel {
157 *Designates logger being silent
161 * Designates very serious errors
165 * Designates hazardous situations
169 * Designates useful information
173 * Designates lower priority information
177 * Designates very low priority, often extremely verbose, information
181 * Must be last for serialization purposes
187 * An enum representing the possible Bitcoin or test networks which we can run on
189 typedef enum LDKNetwork {
191 * The main Bitcoin blockchain.
195 * The testnet3 blockchain.
199 * A local test blockchain.
203 * A blockchain on which blocks are signed instead of mined.
207 * Must be last for serialization purposes
213 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
215 typedef enum LDKSecp256k1Error {
217 * Signature failed verification
219 LDKSecp256k1Error_IncorrectSignature,
221 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
223 LDKSecp256k1Error_InvalidMessage,
227 LDKSecp256k1Error_InvalidPublicKey,
231 LDKSecp256k1Error_InvalidSignature,
235 LDKSecp256k1Error_InvalidSecretKey,
239 LDKSecp256k1Error_InvalidRecoveryId,
241 * Invalid tweak for add_assign or mul_assign
243 LDKSecp256k1Error_InvalidTweak,
245 * tweak_add_check failed on an xonly public key
247 LDKSecp256k1Error_TweakCheckFailed,
249 * Didn't pass enough memory to context creation with preallocated memory
251 LDKSecp256k1Error_NotEnoughMemory,
253 * Must be last for serialization purposes
255 LDKSecp256k1Error_Sentinel,
259 * A serialized transaction, in (pointer, length) form.
261 * This type optionally owns its own memory, and thus the semantics around access change based on
262 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
263 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
264 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
265 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
266 * you would be invalid.
268 * Note that, while it may change in the future, because transactions on the Rust side are stored
269 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
270 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
271 * `data_is_owned` either set or unset at your discretion.
273 typedef struct LDKTransaction {
275 * The serialized transaction data.
277 * This is non-const for your convenience, an object passed to Rust is never written to.
281 * The length of the serialized transaction
285 * Whether the data pointed to by `data` should be freed or not.
291 * A dynamically-allocated array of u8s of arbitrary size.
292 * This corresponds to std::vector in C++
294 typedef struct LDKCVec_u8Z {
296 * The elements in the array.
297 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
301 * The number of elements pointed to by `data`.
307 * A transaction output including a scriptPubKey and value.
308 * This type *does* own its own memory, so must be free'd appropriately.
310 typedef struct LDKTxOut {
312 * The script_pubkey in this output
314 struct LDKCVec_u8Z script_pubkey;
316 * The value, in satoshis, of this output
324 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
325 * with our counterparty.
327 typedef struct MUST_USE_STRUCT LDKChannelConfig {
329 * A pointer to the opaque Rust object.
330 * Nearly everywhere, inner must be non-null, however in places where
331 * the Rust equivalent takes an Option, it may be set to null to indicate None.
333 LDKnativeChannelConfig *inner;
335 * Indicates that this is the only struct which contains the same pointer.
336 * Rust functions which take ownership of an object provided via an argument require
337 * this to be true and invalidate the object pointed to by inner.
345 * An error in decoding a message or struct.
347 typedef struct MUST_USE_STRUCT LDKDecodeError {
349 * A pointer to the opaque Rust object.
350 * Nearly everywhere, inner must be non-null, however in places where
351 * the Rust equivalent takes an Option, it may be set to null to indicate None.
353 LDKnativeDecodeError *inner;
355 * Indicates that this is the only struct which contains the same pointer.
356 * Rust functions which take ownership of an object provided via an argument require
357 * this to be true and invalidate the object pointed to by inner.
363 * The contents of CResult_ChannelConfigDecodeErrorZ
365 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
367 * A pointer to the contents in the success state.
368 * Reading from this pointer when `result_ok` is not set is undefined.
370 struct LDKChannelConfig *result;
372 * A pointer to the contents in the error state.
373 * Reading from this pointer when `result_ok` is set is undefined.
375 struct LDKDecodeError *err;
376 } LDKCResult_ChannelConfigDecodeErrorZPtr;
379 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
380 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
381 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
383 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
385 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
386 * `err` or `result` depending on the state of `result_ok`.
388 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
390 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
393 } LDKCResult_ChannelConfigDecodeErrorZ;
398 * A reference to a transaction output.
400 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
401 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
403 typedef struct MUST_USE_STRUCT LDKOutPoint {
405 * A pointer to the opaque Rust object.
406 * Nearly everywhere, inner must be non-null, however in places where
407 * the Rust equivalent takes an Option, it may be set to null to indicate None.
409 LDKnativeOutPoint *inner;
411 * Indicates that this is the only struct which contains the same pointer.
412 * Rust functions which take ownership of an object provided via an argument require
413 * this to be true and invalidate the object pointed to by inner.
419 * The contents of CResult_OutPointDecodeErrorZ
421 typedef union LDKCResult_OutPointDecodeErrorZPtr {
423 * A pointer to the contents in the success state.
424 * Reading from this pointer when `result_ok` is not set is undefined.
426 struct LDKOutPoint *result;
428 * A pointer to the contents in the error state.
429 * Reading from this pointer when `result_ok` is set is undefined.
431 struct LDKDecodeError *err;
432 } LDKCResult_OutPointDecodeErrorZPtr;
435 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
436 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
437 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
439 typedef struct LDKCResult_OutPointDecodeErrorZ {
441 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
442 * `err` or `result` depending on the state of `result_ok`.
444 union LDKCResult_OutPointDecodeErrorZPtr contents;
446 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
449 } LDKCResult_OutPointDecodeErrorZ;
452 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
454 typedef struct LDKSecretKey {
456 * The bytes of the secret key
462 * The contents of CResult_SecretKeyErrorZ
464 typedef union LDKCResult_SecretKeyErrorZPtr {
466 * A pointer to the contents in the success state.
467 * Reading from this pointer when `result_ok` is not set is undefined.
469 struct LDKSecretKey *result;
471 * A pointer to the contents in the error state.
472 * Reading from this pointer when `result_ok` is set is undefined.
474 enum LDKSecp256k1Error *err;
475 } LDKCResult_SecretKeyErrorZPtr;
478 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
479 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
480 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
482 typedef struct LDKCResult_SecretKeyErrorZ {
484 * The contents of this CResult_SecretKeyErrorZ, accessible via either
485 * `err` or `result` depending on the state of `result_ok`.
487 union LDKCResult_SecretKeyErrorZPtr contents;
489 * Whether this CResult_SecretKeyErrorZ represents a success state.
492 } LDKCResult_SecretKeyErrorZ;
495 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
497 typedef struct LDKPublicKey {
499 * The bytes of the public key
501 uint8_t compressed_form[33];
505 * The contents of CResult_PublicKeyErrorZ
507 typedef union LDKCResult_PublicKeyErrorZPtr {
509 * A pointer to the contents in the success state.
510 * Reading from this pointer when `result_ok` is not set is undefined.
512 struct LDKPublicKey *result;
514 * A pointer to the contents in the error state.
515 * Reading from this pointer when `result_ok` is set is undefined.
517 enum LDKSecp256k1Error *err;
518 } LDKCResult_PublicKeyErrorZPtr;
521 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
522 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
523 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
525 typedef struct LDKCResult_PublicKeyErrorZ {
527 * The contents of this CResult_PublicKeyErrorZ, accessible via either
528 * `err` or `result` depending on the state of `result_ok`.
530 union LDKCResult_PublicKeyErrorZPtr contents;
532 * Whether this CResult_PublicKeyErrorZ represents a success state.
535 } LDKCResult_PublicKeyErrorZ;
540 * The set of public keys which are used in the creation of one commitment transaction.
541 * These are derived from the channel base keys and per-commitment data.
543 * A broadcaster key is provided from potential broadcaster of the computed transaction.
544 * A countersignatory key is coming from a protocol participant unable to broadcast the
547 * These keys are assumed to be good, either because the code derived them from
548 * channel basepoints via the new function, or they were obtained via
549 * CommitmentTransaction.trust().keys() because we trusted the source of the
550 * pre-calculated keys.
552 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
554 * A pointer to the opaque Rust object.
555 * Nearly everywhere, inner must be non-null, however in places where
556 * the Rust equivalent takes an Option, it may be set to null to indicate None.
558 LDKnativeTxCreationKeys *inner;
560 * Indicates that this is the only struct which contains the same pointer.
561 * Rust functions which take ownership of an object provided via an argument require
562 * this to be true and invalidate the object pointed to by inner.
568 * The contents of CResult_TxCreationKeysDecodeErrorZ
570 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
572 * A pointer to the contents in the success state.
573 * Reading from this pointer when `result_ok` is not set is undefined.
575 struct LDKTxCreationKeys *result;
577 * A pointer to the contents in the error state.
578 * Reading from this pointer when `result_ok` is set is undefined.
580 struct LDKDecodeError *err;
581 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
584 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
585 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
586 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
588 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
590 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
591 * `err` or `result` depending on the state of `result_ok`.
593 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
595 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
598 } LDKCResult_TxCreationKeysDecodeErrorZ;
603 * One counterparty's public keys which do not change over the life of a channel.
605 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
607 * A pointer to the opaque Rust object.
608 * Nearly everywhere, inner must be non-null, however in places where
609 * the Rust equivalent takes an Option, it may be set to null to indicate None.
611 LDKnativeChannelPublicKeys *inner;
613 * Indicates that this is the only struct which contains the same pointer.
614 * Rust functions which take ownership of an object provided via an argument require
615 * this to be true and invalidate the object pointed to by inner.
618 } LDKChannelPublicKeys;
621 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
623 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
625 * A pointer to the contents in the success state.
626 * Reading from this pointer when `result_ok` is not set is undefined.
628 struct LDKChannelPublicKeys *result;
630 * A pointer to the contents in the error state.
631 * Reading from this pointer when `result_ok` is set is undefined.
633 struct LDKDecodeError *err;
634 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
637 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
638 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
639 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
641 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
643 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
644 * `err` or `result` depending on the state of `result_ok`.
646 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
648 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
651 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
654 * The contents of CResult_TxCreationKeysErrorZ
656 typedef union LDKCResult_TxCreationKeysErrorZPtr {
658 * A pointer to the contents in the success state.
659 * Reading from this pointer when `result_ok` is not set is undefined.
661 struct LDKTxCreationKeys *result;
663 * A pointer to the contents in the error state.
664 * Reading from this pointer when `result_ok` is set is undefined.
666 enum LDKSecp256k1Error *err;
667 } LDKCResult_TxCreationKeysErrorZPtr;
670 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
671 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
672 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
674 typedef struct LDKCResult_TxCreationKeysErrorZ {
676 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
677 * `err` or `result` depending on the state of `result_ok`.
679 union LDKCResult_TxCreationKeysErrorZPtr contents;
681 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
684 } LDKCResult_TxCreationKeysErrorZ;
687 * An enum which can either contain a u32 or not
689 typedef enum LDKCOption_u32Z_Tag {
691 * When we're in this state, this COption_u32Z contains a u32
693 LDKCOption_u32Z_Some,
695 * When we're in this state, this COption_u32Z contains nothing
697 LDKCOption_u32Z_None,
699 * Must be last for serialization purposes
701 LDKCOption_u32Z_Sentinel,
702 } LDKCOption_u32Z_Tag;
704 typedef struct LDKCOption_u32Z {
705 LDKCOption_u32Z_Tag tag;
716 * Information about an HTLC as it appears in a commitment transaction
718 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
720 * A pointer to the opaque Rust object.
721 * Nearly everywhere, inner must be non-null, however in places where
722 * the Rust equivalent takes an Option, it may be set to null to indicate None.
724 LDKnativeHTLCOutputInCommitment *inner;
726 * Indicates that this is the only struct which contains the same pointer.
727 * Rust functions which take ownership of an object provided via an argument require
728 * this to be true and invalidate the object pointed to by inner.
731 } LDKHTLCOutputInCommitment;
734 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
736 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
738 * A pointer to the contents in the success state.
739 * Reading from this pointer when `result_ok` is not set is undefined.
741 struct LDKHTLCOutputInCommitment *result;
743 * A pointer to the contents in the error state.
744 * Reading from this pointer when `result_ok` is set is undefined.
746 struct LDKDecodeError *err;
747 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
750 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
751 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
752 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
754 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
756 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
757 * `err` or `result` depending on the state of `result_ok`.
759 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
761 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
764 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
769 * Late-bound per-channel counterparty data used to build transactions.
771 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
773 * A pointer to the opaque Rust object.
774 * Nearly everywhere, inner must be non-null, however in places where
775 * the Rust equivalent takes an Option, it may be set to null to indicate None.
777 LDKnativeCounterpartyChannelTransactionParameters *inner;
779 * Indicates that this is the only struct which contains the same pointer.
780 * Rust functions which take ownership of an object provided via an argument require
781 * this to be true and invalidate the object pointed to by inner.
784 } LDKCounterpartyChannelTransactionParameters;
787 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
789 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
791 * A pointer to the contents in the success state.
792 * Reading from this pointer when `result_ok` is not set is undefined.
794 struct LDKCounterpartyChannelTransactionParameters *result;
796 * A pointer to the contents in the error state.
797 * Reading from this pointer when `result_ok` is set is undefined.
799 struct LDKDecodeError *err;
800 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
803 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
804 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
805 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
807 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
809 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
810 * `err` or `result` depending on the state of `result_ok`.
812 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
814 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
817 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
822 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
823 * The fields are organized by holder/counterparty.
825 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
826 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
828 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
830 * A pointer to the opaque Rust object.
831 * Nearly everywhere, inner must be non-null, however in places where
832 * the Rust equivalent takes an Option, it may be set to null to indicate None.
834 LDKnativeChannelTransactionParameters *inner;
836 * Indicates that this is the only struct which contains the same pointer.
837 * Rust functions which take ownership of an object provided via an argument require
838 * this to be true and invalidate the object pointed to by inner.
841 } LDKChannelTransactionParameters;
844 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
846 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
848 * A pointer to the contents in the success state.
849 * Reading from this pointer when `result_ok` is not set is undefined.
851 struct LDKChannelTransactionParameters *result;
853 * A pointer to the contents in the error state.
854 * Reading from this pointer when `result_ok` is set is undefined.
856 struct LDKDecodeError *err;
857 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
860 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
861 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
862 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
864 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
866 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
867 * `err` or `result` depending on the state of `result_ok`.
869 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
871 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
874 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
877 * Represents a secp256k1 signature serialized as two 32-byte numbers
879 typedef struct LDKSignature {
881 * The bytes of the signature in "compact" form
883 uint8_t compact_form[64];
887 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
888 * This corresponds to std::vector in C++
890 typedef struct LDKCVec_SignatureZ {
892 * The elements in the array.
893 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
895 struct LDKSignature *data;
897 * The number of elements pointed to by `data`.
900 } LDKCVec_SignatureZ;
905 * Information needed to build and sign a holder's commitment transaction.
907 * The transaction is only signed once we are ready to broadcast.
909 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
911 * A pointer to the opaque Rust object.
912 * Nearly everywhere, inner must be non-null, however in places where
913 * the Rust equivalent takes an Option, it may be set to null to indicate None.
915 LDKnativeHolderCommitmentTransaction *inner;
917 * Indicates that this is the only struct which contains the same pointer.
918 * Rust functions which take ownership of an object provided via an argument require
919 * this to be true and invalidate the object pointed to by inner.
922 } LDKHolderCommitmentTransaction;
925 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
927 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
929 * A pointer to the contents in the success state.
930 * Reading from this pointer when `result_ok` is not set is undefined.
932 struct LDKHolderCommitmentTransaction *result;
934 * A pointer to the contents in the error state.
935 * Reading from this pointer when `result_ok` is set is undefined.
937 struct LDKDecodeError *err;
938 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
941 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
942 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
943 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
945 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
947 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
948 * `err` or `result` depending on the state of `result_ok`.
950 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
952 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
955 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
960 * A pre-built Bitcoin commitment transaction and its txid.
962 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
964 * A pointer to the opaque Rust object.
965 * Nearly everywhere, inner must be non-null, however in places where
966 * the Rust equivalent takes an Option, it may be set to null to indicate None.
968 LDKnativeBuiltCommitmentTransaction *inner;
970 * Indicates that this is the only struct which contains the same pointer.
971 * Rust functions which take ownership of an object provided via an argument require
972 * this to be true and invalidate the object pointed to by inner.
975 } LDKBuiltCommitmentTransaction;
978 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
980 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
982 * A pointer to the contents in the success state.
983 * Reading from this pointer when `result_ok` is not set is undefined.
985 struct LDKBuiltCommitmentTransaction *result;
987 * A pointer to the contents in the error state.
988 * Reading from this pointer when `result_ok` is set is undefined.
990 struct LDKDecodeError *err;
991 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
994 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
995 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
996 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
998 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1000 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1001 * `err` or `result` depending on the state of `result_ok`.
1003 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1005 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1008 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1013 * This class tracks the per-transaction information needed to build a commitment transaction and to
1014 * actually build it and sign. It is used for holder transactions that we sign only when needed
1015 * and for transactions we sign for the counterparty.
1017 * This class can be used inside a signer implementation to generate a signature given the relevant
1020 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1022 * A pointer to the opaque Rust object.
1023 * Nearly everywhere, inner must be non-null, however in places where
1024 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1026 LDKnativeCommitmentTransaction *inner;
1028 * Indicates that this is the only struct which contains the same pointer.
1029 * Rust functions which take ownership of an object provided via an argument require
1030 * this to be true and invalidate the object pointed to by inner.
1033 } LDKCommitmentTransaction;
1036 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1038 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1040 * A pointer to the contents in the success state.
1041 * Reading from this pointer when `result_ok` is not set is undefined.
1043 struct LDKCommitmentTransaction *result;
1045 * A pointer to the contents in the error state.
1046 * Reading from this pointer when `result_ok` is set is undefined.
1048 struct LDKDecodeError *err;
1049 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1052 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1053 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1054 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1056 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1058 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1059 * `err` or `result` depending on the state of `result_ok`.
1061 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1063 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1066 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1071 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1072 * transaction and the transaction creation keys) are trusted.
1074 * See trust() and verify() functions on CommitmentTransaction.
1076 * This structure implements Deref.
1078 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1080 * A pointer to the opaque Rust object.
1081 * Nearly everywhere, inner must be non-null, however in places where
1082 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1084 LDKnativeTrustedCommitmentTransaction *inner;
1086 * Indicates that this is the only struct which contains the same pointer.
1087 * Rust functions which take ownership of an object provided via an argument require
1088 * this to be true and invalidate the object pointed to by inner.
1091 } LDKTrustedCommitmentTransaction;
1094 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1096 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1098 * A pointer to the contents in the success state.
1099 * Reading from this pointer when `result_ok` is not set is undefined.
1101 struct LDKTrustedCommitmentTransaction *result;
1103 * Note that this value is always NULL, as there are no contents in the Err variant
1106 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1109 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1110 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1111 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1113 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1115 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1116 * `err` or `result` depending on the state of `result_ok`.
1118 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1120 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1123 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1126 * The contents of CResult_CVec_SignatureZNoneZ
1128 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1130 * A pointer to the contents in the success state.
1131 * Reading from this pointer when `result_ok` is not set is undefined.
1133 struct LDKCVec_SignatureZ *result;
1135 * Note that this value is always NULL, as there are no contents in the Err variant
1138 } LDKCResult_CVec_SignatureZNoneZPtr;
1141 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1142 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1143 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1145 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1147 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1148 * `err` or `result` depending on the state of `result_ok`.
1150 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1152 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1155 } LDKCResult_CVec_SignatureZNoneZ;
1158 * The contents of CResult_StringErrorZ
1160 typedef union LDKCResult_StringErrorZPtr {
1162 * A pointer to the contents in the success state.
1163 * Reading from this pointer when `result_ok` is not set is undefined.
1165 struct LDKCVec_u8Z *result;
1167 * A pointer to the contents in the error state.
1168 * Reading from this pointer when `result_ok` is set is undefined.
1170 enum LDKSecp256k1Error *err;
1171 } LDKCResult_StringErrorZPtr;
1174 * A CResult_StringErrorZ represents the result of a fallible operation,
1175 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::c_types::Secp256k1Error on failure.
1176 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1178 typedef struct LDKCResult_StringErrorZ {
1180 * The contents of this CResult_StringErrorZ, accessible via either
1181 * `err` or `result` depending on the state of `result_ok`.
1183 union LDKCResult_StringErrorZPtr contents;
1185 * Whether this CResult_StringErrorZ represents a success state.
1188 } LDKCResult_StringErrorZ;
1193 * An update generated by the underlying Channel itself which contains some new information the
1194 * ChannelMonitor should be made aware of.
1196 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
1198 * A pointer to the opaque Rust object.
1199 * Nearly everywhere, inner must be non-null, however in places where
1200 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1202 LDKnativeChannelMonitorUpdate *inner;
1204 * Indicates that this is the only struct which contains the same pointer.
1205 * Rust functions which take ownership of an object provided via an argument require
1206 * this to be true and invalidate the object pointed to by inner.
1209 } LDKChannelMonitorUpdate;
1212 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
1214 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
1216 * A pointer to the contents in the success state.
1217 * Reading from this pointer when `result_ok` is not set is undefined.
1219 struct LDKChannelMonitorUpdate *result;
1221 * A pointer to the contents in the error state.
1222 * Reading from this pointer when `result_ok` is set is undefined.
1224 struct LDKDecodeError *err;
1225 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
1228 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
1229 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
1230 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1232 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
1234 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
1235 * `err` or `result` depending on the state of `result_ok`.
1237 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
1239 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
1242 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
1247 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
1248 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
1249 * preimage claim backward will lead to loss of funds.
1251 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
1253 * A pointer to the opaque Rust object.
1254 * Nearly everywhere, inner must be non-null, however in places where
1255 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1257 LDKnativeHTLCUpdate *inner;
1259 * Indicates that this is the only struct which contains the same pointer.
1260 * Rust functions which take ownership of an object provided via an argument require
1261 * this to be true and invalidate the object pointed to by inner.
1267 * The contents of CResult_HTLCUpdateDecodeErrorZ
1269 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
1271 * A pointer to the contents in the success state.
1272 * Reading from this pointer when `result_ok` is not set is undefined.
1274 struct LDKHTLCUpdate *result;
1276 * A pointer to the contents in the error state.
1277 * Reading from this pointer when `result_ok` is set is undefined.
1279 struct LDKDecodeError *err;
1280 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
1283 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
1284 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
1285 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1287 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
1289 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
1290 * `err` or `result` depending on the state of `result_ok`.
1292 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
1294 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
1297 } LDKCResult_HTLCUpdateDecodeErrorZ;
1302 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
1303 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
1304 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
1306 * Contains a developer-readable error message.
1308 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
1310 * A pointer to the opaque Rust object.
1311 * Nearly everywhere, inner must be non-null, however in places where
1312 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1314 LDKnativeMonitorUpdateError *inner;
1316 * Indicates that this is the only struct which contains the same pointer.
1317 * Rust functions which take ownership of an object provided via an argument require
1318 * this to be true and invalidate the object pointed to by inner.
1321 } LDKMonitorUpdateError;
1324 * The contents of CResult_NoneMonitorUpdateErrorZ
1326 typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
1328 * Note that this value is always NULL, as there are no contents in the OK variant
1332 * A pointer to the contents in the error state.
1333 * Reading from this pointer when `result_ok` is set is undefined.
1335 struct LDKMonitorUpdateError *err;
1336 } LDKCResult_NoneMonitorUpdateErrorZPtr;
1339 * A CResult_NoneMonitorUpdateErrorZ represents the result of a fallible operation,
1340 * containing a () on success and a crate::lightning::chain::channelmonitor::MonitorUpdateError on failure.
1341 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1343 typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
1345 * The contents of this CResult_NoneMonitorUpdateErrorZ, accessible via either
1346 * `err` or `result` depending on the state of `result_ok`.
1348 union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
1350 * Whether this CResult_NoneMonitorUpdateErrorZ represents a success state.
1353 } LDKCResult_NoneMonitorUpdateErrorZ;
1356 * A tuple of 2 elements. See the individual fields for the types contained.
1358 typedef struct LDKC2Tuple_OutPointScriptZ {
1360 * The element at position 0
1362 struct LDKOutPoint a;
1364 * The element at position 1
1366 struct LDKCVec_u8Z b;
1367 } LDKC2Tuple_OutPointScriptZ;
1370 * A tuple of 2 elements. See the individual fields for the types contained.
1372 typedef struct LDKC2Tuple_u32ScriptZ {
1374 * The element at position 0
1378 * The element at position 1
1380 struct LDKCVec_u8Z b;
1381 } LDKC2Tuple_u32ScriptZ;
1384 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
1385 * This corresponds to std::vector in C++
1387 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
1389 * The elements in the array.
1390 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1392 struct LDKC2Tuple_u32ScriptZ *data;
1394 * The number of elements pointed to by `data`.
1397 } LDKCVec_C2Tuple_u32ScriptZZ;
1400 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1401 * look up the corresponding function in rust-lightning's docs.
1403 typedef struct LDKThirtyTwoBytes {
1405 * The thirty-two bytes
1408 } LDKThirtyTwoBytes;
1411 * A tuple of 2 elements. See the individual fields for the types contained.
1413 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
1415 * The element at position 0
1417 struct LDKThirtyTwoBytes a;
1419 * The element at position 1
1421 struct LDKCVec_C2Tuple_u32ScriptZZ b;
1422 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
1425 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
1426 * This corresponds to std::vector in C++
1428 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
1430 * The elements in the array.
1431 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1433 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
1435 * The number of elements pointed to by `data`.
1438 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
1441 * An event to be processed by the ChannelManager.
1443 typedef enum LDKMonitorEvent_Tag {
1445 * A monitor event containing an HTLCUpdate.
1447 LDKMonitorEvent_HTLCEvent,
1449 * A monitor event that the Channel's commitment transaction was broadcasted.
1451 LDKMonitorEvent_CommitmentTxBroadcasted,
1453 * Must be last for serialization purposes
1455 LDKMonitorEvent_Sentinel,
1456 } LDKMonitorEvent_Tag;
1458 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
1459 LDKMonitorEvent_Tag tag;
1462 struct LDKHTLCUpdate htlc_event;
1465 struct LDKOutPoint commitment_tx_broadcasted;
1471 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
1472 * This corresponds to std::vector in C++
1474 typedef struct LDKCVec_MonitorEventZ {
1476 * The elements in the array.
1477 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1479 struct LDKMonitorEvent *data;
1481 * The number of elements pointed to by `data`.
1484 } LDKCVec_MonitorEventZ;
1489 * Information about a spendable output to a P2WSH script. See
1490 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
1492 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
1494 * A pointer to the opaque Rust object.
1495 * Nearly everywhere, inner must be non-null, however in places where
1496 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1498 LDKnativeDelayedPaymentOutputDescriptor *inner;
1500 * Indicates that this is the only struct which contains the same pointer.
1501 * Rust functions which take ownership of an object provided via an argument require
1502 * this to be true and invalidate the object pointed to by inner.
1505 } LDKDelayedPaymentOutputDescriptor;
1510 * Information about a spendable output to our \"payment key\". See
1511 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
1513 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
1515 * A pointer to the opaque Rust object.
1516 * Nearly everywhere, inner must be non-null, however in places where
1517 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1519 LDKnativeStaticPaymentOutputDescriptor *inner;
1521 * Indicates that this is the only struct which contains the same pointer.
1522 * Rust functions which take ownership of an object provided via an argument require
1523 * this to be true and invalidate the object pointed to by inner.
1526 } LDKStaticPaymentOutputDescriptor;
1529 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
1530 * claim at any point in the future) an event is generated which you must track and be able to
1531 * spend on-chain. The information needed to do this is provided in this enum, including the
1532 * outpoint describing which txid and output index is available, the full output which exists at
1533 * that txid/index, and any keys or other information required to sign.
1535 typedef enum LDKSpendableOutputDescriptor_Tag {
1537 * An output to a script which was provided via KeysInterface directly, either from
1538 * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
1539 * spend it. No secret keys are provided as rust-lightning was never given any key.
1540 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
1541 * on-chain using the payment preimage or after it has timed out.
1543 LDKSpendableOutputDescriptor_StaticOutput,
1545 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
1547 * The witness in the spending input should be:
1548 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
1550 * Note that the nSequence field in the spending input must be set to to_self_delay
1551 * (which means the transaction is not broadcastable until at least to_self_delay
1552 * blocks after the outpoint confirms).
1554 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
1555 * it is an output from an old state which we broadcast (which should never happen).
1557 * To derive the delayed_payment key which is used to sign for this input, you must pass the
1558 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
1559 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
1560 * chan_utils::derive_private_key. The public key can be generated without the secret key
1561 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
1564 * To derive the revocation_pubkey provided here (which is used in the witness
1565 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
1566 * call to Sign::ready_channel) and the provided per_commitment point
1567 * to chan_utils::derive_public_revocation_key.
1569 * The witness script which is hashed and included in the output script_pubkey may be
1570 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
1571 * (derived as above), and the to_self_delay contained here to
1572 * chan_utils::get_revokeable_redeemscript.
1574 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
1576 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
1577 * corresponds to the public key in Sign::pubkeys().payment_point).
1578 * The witness in the spending input, is, thus, simply:
1579 * <BIP 143 signature> <payment key>
1581 * These are generally the result of our counterparty having broadcast the current state,
1582 * allowing us to claim the non-HTLC-encumbered outputs immediately.
1584 LDKSpendableOutputDescriptor_StaticPaymentOutput,
1586 * Must be last for serialization purposes
1588 LDKSpendableOutputDescriptor_Sentinel,
1589 } LDKSpendableOutputDescriptor_Tag;
1591 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
1593 * The outpoint which is spendable
1595 struct LDKOutPoint outpoint;
1597 * The output which is referenced by the given outpoint.
1599 struct LDKTxOut output;
1600 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
1602 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
1603 LDKSpendableOutputDescriptor_Tag tag;
1605 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
1607 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
1610 struct LDKStaticPaymentOutputDescriptor static_payment_output;
1613 } LDKSpendableOutputDescriptor;
1616 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
1617 * This corresponds to std::vector in C++
1619 typedef struct LDKCVec_SpendableOutputDescriptorZ {
1621 * The elements in the array.
1622 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1624 struct LDKSpendableOutputDescriptor *data;
1626 * The number of elements pointed to by `data`.
1629 } LDKCVec_SpendableOutputDescriptorZ;
1632 * An Event which you should probably take some action in response to.
1634 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
1635 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
1636 * written as it makes no sense to respond to it after reconnecting to peers).
1638 typedef enum LDKEvent_Tag {
1640 * Used to indicate that the client should generate a funding transaction with the given
1641 * parameters and then call ChannelManager::funding_transaction_generated.
1642 * Generated in ChannelManager message handling.
1643 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
1644 * counterparty can steal your funds!
1646 LDKEvent_FundingGenerationReady,
1648 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
1649 * ChannelManager::claim_funds to get it....
1650 * Note that if the preimage is not known or the amount paid is incorrect, you should call
1651 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
1652 * network congestion.
1653 * The amount paid should be considered 'incorrect' when it is less than or more than twice
1654 * the amount expected.
1655 * If you fail to call either ChannelManager::claim_funds or
1656 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
1657 * automatically failed.
1659 LDKEvent_PaymentReceived,
1661 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
1662 * and we got back the payment preimage for it).
1663 * Note that duplicative PaymentSent Events may be generated - it is your responsibility to
1664 * deduplicate them by payment_preimage (which MUST be unique)!
1666 LDKEvent_PaymentSent,
1668 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
1669 * something. You may wish to retry with a different route.
1670 * Note that duplicative PaymentFailed Events may be generated - it is your responsibility to
1671 * deduplicate them by payment_hash (which MUST be unique)!
1673 LDKEvent_PaymentFailed,
1675 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
1676 * time in the future.
1678 LDKEvent_PendingHTLCsForwardable,
1680 * Used to indicate that an output was generated on-chain which you should know how to spend.
1681 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
1682 * counterparty spending them due to some kind of timeout. Thus, you need to store them
1683 * somewhere and spend them when you create on-chain transactions.
1685 LDKEvent_SpendableOutputs,
1687 * Must be last for serialization purposes
1692 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
1694 * The random channel_id we picked which you'll need to pass into
1695 * ChannelManager::funding_transaction_generated.
1697 struct LDKThirtyTwoBytes temporary_channel_id;
1699 * The value, in satoshis, that the output should have.
1701 uint64_t channel_value_satoshis;
1703 * The script which should be used in the transaction output.
1705 struct LDKCVec_u8Z output_script;
1707 * The value passed in to ChannelManager::create_channel
1709 uint64_t user_channel_id;
1710 } LDKEvent_LDKFundingGenerationReady_Body;
1712 typedef struct LDKEvent_LDKPaymentReceived_Body {
1714 * The hash for which the preimage should be handed to the ChannelManager.
1716 struct LDKThirtyTwoBytes payment_hash;
1718 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
1719 * number of deanonymization attacks during the routing process.
1720 * As nodes upgrade, the invoices you provide should likely migrate to setting the
1721 * payment_secret feature to required, at which point you should fail_backwards any HTLCs
1722 * which have a None here.
1723 * Until then, however, values of None should be ignored, and only incorrect Some values
1724 * should result in an HTLC fail_backwards.
1725 * Note that, in any case, this value must be passed as-is to any fail or claim calls as
1726 * the HTLC index includes this value.
1728 struct LDKThirtyTwoBytes payment_secret;
1730 * The value, in thousandths of a satoshi, that this payment is for. Note that you must
1731 * compare this to the expected value before accepting the payment (as otherwise you are
1732 * providing proof-of-payment for less than the value you expected!).
1735 } LDKEvent_LDKPaymentReceived_Body;
1737 typedef struct LDKEvent_LDKPaymentSent_Body {
1739 * The preimage to the hash given to ChannelManager::send_payment.
1740 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
1743 struct LDKThirtyTwoBytes payment_preimage;
1744 } LDKEvent_LDKPaymentSent_Body;
1746 typedef struct LDKEvent_LDKPaymentFailed_Body {
1748 * The hash which was given to ChannelManager::send_payment.
1750 struct LDKThirtyTwoBytes payment_hash;
1752 * Indicates the payment was rejected for some reason by the recipient. This implies that
1753 * the payment has failed, not just the route in question. If this is not set, you may
1754 * retry the payment via a different route.
1756 bool rejected_by_dest;
1757 } LDKEvent_LDKPaymentFailed_Body;
1759 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
1761 * The minimum amount of time that should be waited prior to calling
1762 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
1763 * you should wait a random amount of time in roughly the range (now + time_forwardable,
1764 * now + 5*time_forwardable).
1766 uint64_t time_forwardable;
1767 } LDKEvent_LDKPendingHTLCsForwardable_Body;
1769 typedef struct LDKEvent_LDKSpendableOutputs_Body {
1771 * The outputs which you should store as spendable by you.
1773 struct LDKCVec_SpendableOutputDescriptorZ outputs;
1774 } LDKEvent_LDKSpendableOutputs_Body;
1776 typedef struct MUST_USE_STRUCT LDKEvent {
1779 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
1780 LDKEvent_LDKPaymentReceived_Body payment_received;
1781 LDKEvent_LDKPaymentSent_Body payment_sent;
1782 LDKEvent_LDKPaymentFailed_Body payment_failed;
1783 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
1784 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
1789 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
1790 * This corresponds to std::vector in C++
1792 typedef struct LDKCVec_EventZ {
1794 * The elements in the array.
1795 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1797 struct LDKEvent *data;
1799 * The number of elements pointed to by `data`.
1805 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
1806 * This corresponds to std::vector in C++
1808 typedef struct LDKCVec_TransactionZ {
1810 * The elements in the array.
1811 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1813 struct LDKTransaction *data;
1815 * The number of elements pointed to by `data`.
1818 } LDKCVec_TransactionZ;
1821 * A tuple of 2 elements. See the individual fields for the types contained.
1823 typedef struct LDKC2Tuple_usizeTransactionZ {
1825 * The element at position 0
1829 * The element at position 1
1831 struct LDKTransaction b;
1832 } LDKC2Tuple_usizeTransactionZ;
1835 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
1836 * This corresponds to std::vector in C++
1838 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
1840 * The elements in the array.
1841 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1843 struct LDKC2Tuple_usizeTransactionZ *data;
1845 * The number of elements pointed to by `data`.
1848 } LDKCVec_C2Tuple_usizeTransactionZZ;
1851 * A tuple of 2 elements. See the individual fields for the types contained.
1853 typedef struct LDKC2Tuple_u32TxOutZ {
1855 * The element at position 0
1859 * The element at position 1
1862 } LDKC2Tuple_u32TxOutZ;
1865 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
1866 * This corresponds to std::vector in C++
1868 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
1870 * The elements in the array.
1871 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1873 struct LDKC2Tuple_u32TxOutZ *data;
1875 * The number of elements pointed to by `data`.
1878 } LDKCVec_C2Tuple_u32TxOutZZ;
1881 * A tuple of 2 elements. See the individual fields for the types contained.
1883 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
1885 * The element at position 0
1887 struct LDKThirtyTwoBytes a;
1889 * The element at position 1
1891 struct LDKCVec_C2Tuple_u32TxOutZZ b;
1892 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
1895 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
1896 * This corresponds to std::vector in C++
1898 typedef struct LDKCVec_TransactionOutputsZ {
1900 * The elements in the array.
1901 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1903 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
1905 * The number of elements pointed to by `data`.
1908 } LDKCVec_TransactionOutputsZ;
1911 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
1912 * This corresponds to std::vector in C++
1914 typedef struct LDKCVec_TxidZ {
1916 * The elements in the array.
1917 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1919 struct LDKThirtyTwoBytes *data;
1921 * The number of elements pointed to by `data`.
1927 * The contents of CResult_NoneChannelMonitorUpdateErrZ
1929 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
1931 * Note that this value is always NULL, as there are no contents in the OK variant
1935 * A pointer to the contents in the error state.
1936 * Reading from this pointer when `result_ok` is set is undefined.
1938 enum LDKChannelMonitorUpdateErr *err;
1939 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
1942 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
1943 * containing a () on success and a crate::lightning::chain::channelmonitor::ChannelMonitorUpdateErr on failure.
1944 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1946 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
1948 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
1949 * `err` or `result` depending on the state of `result_ok`.
1951 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
1953 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
1956 } LDKCResult_NoneChannelMonitorUpdateErrZ;
1959 * A tuple of 2 elements. See the individual fields for the types contained.
1961 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
1963 * The element at position 0
1965 struct LDKSignature a;
1967 * The element at position 1
1969 struct LDKCVec_SignatureZ b;
1970 } LDKC2Tuple_SignatureCVec_SignatureZZ;
1973 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
1975 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
1977 * A pointer to the contents in the success state.
1978 * Reading from this pointer when `result_ok` is not set is undefined.
1980 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
1982 * Note that this value is always NULL, as there are no contents in the Err variant
1985 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
1988 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
1989 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
1990 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1992 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
1994 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
1995 * `err` or `result` depending on the state of `result_ok`.
1997 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
1999 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
2002 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
2005 * The contents of CResult_SignatureNoneZ
2007 typedef union LDKCResult_SignatureNoneZPtr {
2009 * A pointer to the contents in the success state.
2010 * Reading from this pointer when `result_ok` is not set is undefined.
2012 struct LDKSignature *result;
2014 * Note that this value is always NULL, as there are no contents in the Err variant
2017 } LDKCResult_SignatureNoneZPtr;
2020 * A CResult_SignatureNoneZ represents the result of a fallible operation,
2021 * containing a crate::c_types::Signature on success and a () on failure.
2022 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2024 typedef struct LDKCResult_SignatureNoneZ {
2026 * The contents of this CResult_SignatureNoneZ, accessible via either
2027 * `err` or `result` depending on the state of `result_ok`.
2029 union LDKCResult_SignatureNoneZPtr contents;
2031 * Whether this CResult_SignatureNoneZ represents a success state.
2034 } LDKCResult_SignatureNoneZ;
2039 * The unsigned part of a channel_announcement
2041 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
2043 * A pointer to the opaque Rust object.
2044 * Nearly everywhere, inner must be non-null, however in places where
2045 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2047 LDKnativeUnsignedChannelAnnouncement *inner;
2049 * Indicates that this is the only struct which contains the same pointer.
2050 * Rust functions which take ownership of an object provided via an argument require
2051 * this to be true and invalidate the object pointed to by inner.
2054 } LDKUnsignedChannelAnnouncement;
2057 * A trait to sign lightning channel transactions as described in BOLT 3.
2059 * Signing services could be implemented on a hardware wallet. In this case,
2060 * the current Sign would be a front-end on top of a communication
2061 * channel connected to your secure device and lightning key material wouldn't
2062 * reside on a hot server. Nevertheless, a this deployment would still need
2063 * to trust the ChannelManager to avoid loss of funds as this latest component
2064 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
2066 * A more secure iteration would be to use hashlock (or payment points) to pair
2067 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
2068 * at the price of more state and computation on the hardware wallet side. In the future,
2069 * we are looking forward to design such interface.
2071 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
2072 * to act, as liveness and breach reply correctness are always going to be hard requirements
2073 * of LN security model, orthogonal of key management issues.
2075 typedef struct LDKBaseSign {
2077 * An opaque pointer which is passed to your function implementations as an argument.
2078 * This has no meaning in the LDK, and can be NULL or any other value.
2082 * Gets the per-commitment point for a specific commitment number
2084 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2086 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
2088 * Gets the commitment secret for a specific commitment number as part of the revocation process
2090 * An external signer implementation should error here if the commitment was already signed
2091 * and should refuse to sign it in the future.
2093 * May be called more than once for the same index.
2095 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2097 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
2099 * Gets the holder's channel public keys and basepoints
2101 struct LDKChannelPublicKeys pubkeys;
2103 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
2104 * Note that this takes a pointer to this object, not the this_ptr like other methods do
2105 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
2107 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
2109 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
2110 * some SpendableOutputDescriptor types. This should be sufficient to identify this
2111 * Sign object uniquely and lookup or re-derive its keys.
2113 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
2115 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
2117 * Note that if signing fails or is rejected, the channel will be force-closed.
2119 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
2121 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
2122 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
2123 * latest commitment_tx when we initiate a force-close.
2124 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
2125 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
2127 * This may be called multiple times for the same transaction.
2129 * An external signer implementation should check that the commitment has not been revoked.
2131 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
2133 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
2135 * Create a signature for the given input in a transaction spending an HTLC or commitment
2136 * transaction output when our counterparty broadcasts an old state.
2138 * A justice transaction may claim multiples outputs at the same time if timelocks are
2139 * similar, but only a signature for the input at index `input` should be signed for here.
2140 * It may be called multiples time for same output(s) if a fee-bump is needed with regards
2141 * to an upcoming timelock expiration.
2143 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2145 * per_commitment_key is revocation secret which was provided by our counterparty when they
2146 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2147 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
2150 * htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus
2151 * changing the format of the witness script (which is committed to in the BIP 143
2154 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);
2156 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
2157 * transaction, either offered or received.
2159 * Such a transaction may claim multiples offered outputs at same time if we know the
2160 * preimage for each when we create it, but only the input at index `input` should be
2161 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
2162 * needed with regards to an upcoming timelock expiration.
2164 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
2167 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2169 * Per_commitment_point is the dynamic point corresponding to the channel state
2170 * detected onchain. It has been generated by our counterparty and is used to derive
2171 * channel state keys, which are then included in the witness script and committed to in the
2172 * BIP 143 signature.
2174 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);
2176 * Create a signature for a (proposed) closing transaction.
2178 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
2179 * chosen to forgo their output as dust.
2181 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
2183 * Signs a channel announcement message with our funding key, proving it comes from one
2184 * of the channel participants.
2186 * Note that if this fails or is rejected, the channel will not be publicly announced and
2187 * our counterparty may (though likely will not) close the channel on us for violating the
2190 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
2192 * Set the counterparty static channel data, including basepoints,
2193 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
2194 * This is done as soon as the funding outpoint is known. Since these are static channel data,
2195 * they MUST NOT be allowed to change to different values once set.
2197 * channel_parameters.is_populated() MUST be true.
2199 * We bind holder_selected_contest_delay late here for API convenience.
2201 * Will be called before any signatures are applied.
2203 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
2205 * Frees any resources associated with this object given its this_arg pointer.
2206 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2208 void (*free)(void *this_arg);
2212 * A cloneable signer.
2214 * Although we require signers to be cloneable, it may be useful for developers to be able to use
2215 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
2216 * which implies Sized, into this derived trait.
2218 typedef struct LDKSign {
2220 * An opaque pointer which is passed to your function implementations as an argument.
2221 * This has no meaning in the LDK, and can be NULL or any other value.
2225 * Implementation of BaseSign for this object.
2227 struct LDKBaseSign BaseSign;
2229 * Creates a copy of the BaseSign, for a copy of this Sign.
2230 * Because BaseSign doesn't natively support copying itself, you have to provide a full copy implementation here.
2232 struct LDKBaseSign (*BaseSign_clone)(const struct LDKBaseSign *NONNULL_PTR orig_BaseSign);
2234 * Serialize the object into a byte array
2236 struct LDKCVec_u8Z (*write)(const void *this_arg);
2238 * Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
2239 * Note that the ultimate copy of the Sign will have all function pointers the same as the original.
2240 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
2242 void *(*clone)(const void *this_arg);
2244 * Frees any resources associated with this object given its this_arg pointer.
2245 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2247 void (*free)(void *this_arg);
2253 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
2254 * on-chain transactions to ensure no loss of funds occurs.
2256 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
2257 * information and are actively monitoring the chain.
2259 * Pending Events or updated HTLCs which have not yet been read out by
2260 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
2261 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
2262 * gotten are fully handled before re-serializing the new state.
2264 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
2265 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
2266 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
2267 * returned block hash and the the current chain and then reconnecting blocks to get to the
2268 * best chain) upon deserializing the object!
2270 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
2272 * A pointer to the opaque Rust object.
2273 * Nearly everywhere, inner must be non-null, however in places where
2274 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2276 LDKnativeChannelMonitor *inner;
2278 * Indicates that this is the only struct which contains the same pointer.
2279 * Rust functions which take ownership of an object provided via an argument require
2280 * this to be true and invalidate the object pointed to by inner.
2283 } LDKChannelMonitor;
2286 * A tuple of 2 elements. See the individual fields for the types contained.
2288 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
2290 * The element at position 0
2292 struct LDKThirtyTwoBytes a;
2294 * The element at position 1
2296 struct LDKChannelMonitor b;
2297 } LDKC2Tuple_BlockHashChannelMonitorZ;
2300 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
2302 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
2304 * A pointer to the contents in the success state.
2305 * Reading from this pointer when `result_ok` is not set is undefined.
2307 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
2309 * A pointer to the contents in the error state.
2310 * Reading from this pointer when `result_ok` is set is undefined.
2312 struct LDKDecodeError *err;
2313 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
2316 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
2317 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2318 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2320 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
2322 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
2323 * `err` or `result` depending on the state of `result_ok`.
2325 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
2327 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
2330 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
2337 typedef struct MUST_USE_STRUCT LDKRouteHop {
2339 * A pointer to the opaque Rust object.
2340 * Nearly everywhere, inner must be non-null, however in places where
2341 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2343 LDKnativeRouteHop *inner;
2345 * Indicates that this is the only struct which contains the same pointer.
2346 * Rust functions which take ownership of an object provided via an argument require
2347 * this to be true and invalidate the object pointed to by inner.
2353 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
2354 * This corresponds to std::vector in C++
2356 typedef struct LDKCVec_RouteHopZ {
2358 * The elements in the array.
2359 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2361 struct LDKRouteHop *data;
2363 * The number of elements pointed to by `data`.
2366 } LDKCVec_RouteHopZ;
2369 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
2370 * This corresponds to std::vector in C++
2372 typedef struct LDKCVec_CVec_RouteHopZZ {
2374 * The elements in the array.
2375 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2377 struct LDKCVec_RouteHopZ *data;
2379 * The number of elements pointed to by `data`.
2382 } LDKCVec_CVec_RouteHopZZ;
2387 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
2388 * it can take multiple paths. Each path is composed of one or more hops through the network.
2390 typedef struct MUST_USE_STRUCT LDKRoute {
2392 * A pointer to the opaque Rust object.
2393 * Nearly everywhere, inner must be non-null, however in places where
2394 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2396 LDKnativeRoute *inner;
2398 * Indicates that this is the only struct which contains the same pointer.
2399 * Rust functions which take ownership of an object provided via an argument require
2400 * this to be true and invalidate the object pointed to by inner.
2406 * The contents of CResult_RouteDecodeErrorZ
2408 typedef union LDKCResult_RouteDecodeErrorZPtr {
2410 * A pointer to the contents in the success state.
2411 * Reading from this pointer when `result_ok` is not set is undefined.
2413 struct LDKRoute *result;
2415 * A pointer to the contents in the error state.
2416 * Reading from this pointer when `result_ok` is set is undefined.
2418 struct LDKDecodeError *err;
2419 } LDKCResult_RouteDecodeErrorZPtr;
2422 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
2423 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
2424 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2426 typedef struct LDKCResult_RouteDecodeErrorZ {
2428 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
2429 * `err` or `result` depending on the state of `result_ok`.
2431 union LDKCResult_RouteDecodeErrorZPtr contents;
2433 * Whether this CResult_RouteDecodeErrorZ represents a success state.
2436 } LDKCResult_RouteDecodeErrorZ;
2439 * An enum which can either contain a u64 or not
2441 typedef enum LDKCOption_u64Z_Tag {
2443 * When we're in this state, this COption_u64Z contains a u64
2445 LDKCOption_u64Z_Some,
2447 * When we're in this state, this COption_u64Z contains nothing
2449 LDKCOption_u64Z_None,
2451 * Must be last for serialization purposes
2453 LDKCOption_u64Z_Sentinel,
2454 } LDKCOption_u64Z_Tag;
2456 typedef struct LDKCOption_u64Z {
2457 LDKCOption_u64Z_Tag tag;
2468 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2470 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2472 * A pointer to the opaque Rust object.
2473 * Nearly everywhere, inner must be non-null, however in places where
2474 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2476 LDKnativeChannelDetails *inner;
2478 * Indicates that this is the only struct which contains the same pointer.
2479 * Rust functions which take ownership of an object provided via an argument require
2480 * this to be true and invalidate the object pointed to by inner.
2483 } LDKChannelDetails;
2486 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
2487 * This corresponds to std::vector in C++
2489 typedef struct LDKCVec_ChannelDetailsZ {
2491 * The elements in the array.
2492 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2494 struct LDKChannelDetails *data;
2496 * The number of elements pointed to by `data`.
2499 } LDKCVec_ChannelDetailsZ;
2504 * A channel descriptor which provides a last-hop route to get_route
2506 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
2508 * A pointer to the opaque Rust object.
2509 * Nearly everywhere, inner must be non-null, however in places where
2510 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2512 LDKnativeRouteHintHop *inner;
2514 * Indicates that this is the only struct which contains the same pointer.
2515 * Rust functions which take ownership of an object provided via an argument require
2516 * this to be true and invalidate the object pointed to by inner.
2522 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
2523 * This corresponds to std::vector in C++
2525 typedef struct LDKCVec_RouteHintHopZ {
2527 * The elements in the array.
2528 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2530 struct LDKRouteHintHop *data;
2532 * The number of elements pointed to by `data`.
2535 } LDKCVec_RouteHintHopZ;
2540 * An Err type for failure to process messages.
2542 typedef struct MUST_USE_STRUCT LDKLightningError {
2544 * A pointer to the opaque Rust object.
2545 * Nearly everywhere, inner must be non-null, however in places where
2546 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2548 LDKnativeLightningError *inner;
2550 * Indicates that this is the only struct which contains the same pointer.
2551 * Rust functions which take ownership of an object provided via an argument require
2552 * this to be true and invalidate the object pointed to by inner.
2555 } LDKLightningError;
2558 * The contents of CResult_RouteLightningErrorZ
2560 typedef union LDKCResult_RouteLightningErrorZPtr {
2562 * A pointer to the contents in the success state.
2563 * Reading from this pointer when `result_ok` is not set is undefined.
2565 struct LDKRoute *result;
2567 * A pointer to the contents in the error state.
2568 * Reading from this pointer when `result_ok` is set is undefined.
2570 struct LDKLightningError *err;
2571 } LDKCResult_RouteLightningErrorZPtr;
2574 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
2575 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
2576 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2578 typedef struct LDKCResult_RouteLightningErrorZ {
2580 * The contents of this CResult_RouteLightningErrorZ, accessible via either
2581 * `err` or `result` depending on the state of `result_ok`.
2583 union LDKCResult_RouteLightningErrorZPtr contents;
2585 * Whether this CResult_RouteLightningErrorZ represents a success state.
2588 } LDKCResult_RouteLightningErrorZ;
2593 * An accept_channel message to be sent or received from a peer
2595 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
2597 * A pointer to the opaque Rust object.
2598 * Nearly everywhere, inner must be non-null, however in places where
2599 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2601 LDKnativeAcceptChannel *inner;
2603 * Indicates that this is the only struct which contains the same pointer.
2604 * Rust functions which take ownership of an object provided via an argument require
2605 * this to be true and invalidate the object pointed to by inner.
2613 * An open_channel message to be sent or received from a peer
2615 typedef struct MUST_USE_STRUCT LDKOpenChannel {
2617 * A pointer to the opaque Rust object.
2618 * Nearly everywhere, inner must be non-null, however in places where
2619 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2621 LDKnativeOpenChannel *inner;
2623 * Indicates that this is the only struct which contains the same pointer.
2624 * Rust functions which take ownership of an object provided via an argument require
2625 * this to be true and invalidate the object pointed to by inner.
2633 * A funding_created message to be sent or received from a peer
2635 typedef struct MUST_USE_STRUCT LDKFundingCreated {
2637 * A pointer to the opaque Rust object.
2638 * Nearly everywhere, inner must be non-null, however in places where
2639 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2641 LDKnativeFundingCreated *inner;
2643 * Indicates that this is the only struct which contains the same pointer.
2644 * Rust functions which take ownership of an object provided via an argument require
2645 * this to be true and invalidate the object pointed to by inner.
2648 } LDKFundingCreated;
2653 * A funding_signed message to be sent or received from a peer
2655 typedef struct MUST_USE_STRUCT LDKFundingSigned {
2657 * A pointer to the opaque Rust object.
2658 * Nearly everywhere, inner must be non-null, however in places where
2659 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2661 LDKnativeFundingSigned *inner;
2663 * Indicates that this is the only struct which contains the same pointer.
2664 * Rust functions which take ownership of an object provided via an argument require
2665 * this to be true and invalidate the object pointed to by inner.
2673 * A funding_locked message to be sent or received from a peer
2675 typedef struct MUST_USE_STRUCT LDKFundingLocked {
2677 * A pointer to the opaque Rust object.
2678 * Nearly everywhere, inner must be non-null, however in places where
2679 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2681 LDKnativeFundingLocked *inner;
2683 * Indicates that this is the only struct which contains the same pointer.
2684 * Rust functions which take ownership of an object provided via an argument require
2685 * this to be true and invalidate the object pointed to by inner.
2693 * An announcement_signatures message to be sent or received from a peer
2695 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
2697 * A pointer to the opaque Rust object.
2698 * Nearly everywhere, inner must be non-null, however in places where
2699 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2701 LDKnativeAnnouncementSignatures *inner;
2703 * Indicates that this is the only struct which contains the same pointer.
2704 * Rust functions which take ownership of an object provided via an argument require
2705 * this to be true and invalidate the object pointed to by inner.
2708 } LDKAnnouncementSignatures;
2713 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
2714 * transaction updates if they were pending.
2716 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
2718 * A pointer to the opaque Rust object.
2719 * Nearly everywhere, inner must be non-null, however in places where
2720 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2722 LDKnativeCommitmentUpdate *inner;
2724 * Indicates that this is the only struct which contains the same pointer.
2725 * Rust functions which take ownership of an object provided via an argument require
2726 * this to be true and invalidate the object pointed to by inner.
2729 } LDKCommitmentUpdate;
2734 * A revoke_and_ack message to be sent or received from a peer
2736 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
2738 * A pointer to the opaque Rust object.
2739 * Nearly everywhere, inner must be non-null, however in places where
2740 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2742 LDKnativeRevokeAndACK *inner;
2744 * Indicates that this is the only struct which contains the same pointer.
2745 * Rust functions which take ownership of an object provided via an argument require
2746 * this to be true and invalidate the object pointed to by inner.
2754 * A closing_signed message to be sent or received from a peer
2756 typedef struct MUST_USE_STRUCT LDKClosingSigned {
2758 * A pointer to the opaque Rust object.
2759 * Nearly everywhere, inner must be non-null, however in places where
2760 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2762 LDKnativeClosingSigned *inner;
2764 * Indicates that this is the only struct which contains the same pointer.
2765 * Rust functions which take ownership of an object provided via an argument require
2766 * this to be true and invalidate the object pointed to by inner.
2774 * A shutdown message to be sent or received from a peer
2776 typedef struct MUST_USE_STRUCT LDKShutdown {
2778 * A pointer to the opaque Rust object.
2779 * Nearly everywhere, inner must be non-null, however in places where
2780 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2782 LDKnativeShutdown *inner;
2784 * Indicates that this is the only struct which contains the same pointer.
2785 * Rust functions which take ownership of an object provided via an argument require
2786 * this to be true and invalidate the object pointed to by inner.
2794 * A channel_reestablish message to be sent or received from a peer
2796 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
2798 * A pointer to the opaque Rust object.
2799 * Nearly everywhere, inner must be non-null, however in places where
2800 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2802 LDKnativeChannelReestablish *inner;
2804 * Indicates that this is the only struct which contains the same pointer.
2805 * Rust functions which take ownership of an object provided via an argument require
2806 * this to be true and invalidate the object pointed to by inner.
2809 } LDKChannelReestablish;
2814 * A channel_announcement message to be sent or received from a peer
2816 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
2818 * A pointer to the opaque Rust object.
2819 * Nearly everywhere, inner must be non-null, however in places where
2820 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2822 LDKnativeChannelAnnouncement *inner;
2824 * Indicates that this is the only struct which contains the same pointer.
2825 * Rust functions which take ownership of an object provided via an argument require
2826 * this to be true and invalidate the object pointed to by inner.
2829 } LDKChannelAnnouncement;
2834 * A channel_update message to be sent or received from a peer
2836 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2838 * A pointer to the opaque Rust object.
2839 * Nearly everywhere, inner must be non-null, however in places where
2840 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2842 LDKnativeChannelUpdate *inner;
2844 * Indicates that this is the only struct which contains the same pointer.
2845 * Rust functions which take ownership of an object provided via an argument require
2846 * this to be true and invalidate the object pointed to by inner.
2854 * A node_announcement message to be sent or received from a peer
2856 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
2858 * A pointer to the opaque Rust object.
2859 * Nearly everywhere, inner must be non-null, however in places where
2860 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2862 LDKnativeNodeAnnouncement *inner;
2864 * Indicates that this is the only struct which contains the same pointer.
2865 * Rust functions which take ownership of an object provided via an argument require
2866 * this to be true and invalidate the object pointed to by inner.
2869 } LDKNodeAnnouncement;
2874 * An error message to be sent or received from a peer
2876 typedef struct MUST_USE_STRUCT LDKErrorMessage {
2878 * A pointer to the opaque Rust object.
2879 * Nearly everywhere, inner must be non-null, however in places where
2880 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2882 LDKnativeErrorMessage *inner;
2884 * Indicates that this is the only struct which contains the same pointer.
2885 * Rust functions which take ownership of an object provided via an argument require
2886 * this to be true and invalidate the object pointed to by inner.
2892 * Used to put an error message in a LightningError
2894 typedef enum LDKErrorAction_Tag {
2896 * The peer took some action which made us think they were useless. Disconnect them.
2898 LDKErrorAction_DisconnectPeer,
2900 * The peer did something harmless that we weren't able to process, just log and ignore
2902 LDKErrorAction_IgnoreError,
2904 * The peer did something incorrect. Tell them.
2906 LDKErrorAction_SendErrorMessage,
2908 * Must be last for serialization purposes
2910 LDKErrorAction_Sentinel,
2911 } LDKErrorAction_Tag;
2913 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
2915 * An error message which we should make an effort to send before we disconnect.
2917 struct LDKErrorMessage msg;
2918 } LDKErrorAction_LDKDisconnectPeer_Body;
2920 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
2922 * The message to send.
2924 struct LDKErrorMessage msg;
2925 } LDKErrorAction_LDKSendErrorMessage_Body;
2927 typedef struct MUST_USE_STRUCT LDKErrorAction {
2928 LDKErrorAction_Tag tag;
2930 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
2931 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
2936 * The information we received from a peer along the route of a payment we originated. This is
2937 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
2938 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
2940 typedef enum LDKHTLCFailChannelUpdate_Tag {
2942 * We received an error which included a full ChannelUpdate message.
2944 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
2946 * We received an error which indicated only that a channel has been closed
2948 LDKHTLCFailChannelUpdate_ChannelClosed,
2950 * We received an error which indicated only that a node has failed
2952 LDKHTLCFailChannelUpdate_NodeFailure,
2954 * Must be last for serialization purposes
2956 LDKHTLCFailChannelUpdate_Sentinel,
2957 } LDKHTLCFailChannelUpdate_Tag;
2959 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
2961 * The unwrapped message we received
2963 struct LDKChannelUpdate msg;
2964 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
2966 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
2968 * The short_channel_id which has now closed.
2970 uint64_t short_channel_id;
2972 * when this true, this channel should be permanently removed from the
2973 * consideration. Otherwise, this channel can be restored as new channel_update is received
2976 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
2978 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
2980 * The node_id that has failed.
2982 struct LDKPublicKey node_id;
2984 * when this true, node should be permanently removed from the
2985 * consideration. Otherwise, the channels connected to this node can be
2986 * restored as new channel_update is received
2989 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
2991 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
2992 LDKHTLCFailChannelUpdate_Tag tag;
2994 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2995 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
2996 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
2998 } LDKHTLCFailChannelUpdate;
3003 * A query_channel_range message is used to query a peer for channel
3004 * UTXOs in a range of blocks. The recipient of a query makes a best
3005 * effort to reply to the query using one or more reply_channel_range
3008 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
3010 * A pointer to the opaque Rust object.
3011 * Nearly everywhere, inner must be non-null, however in places where
3012 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3014 LDKnativeQueryChannelRange *inner;
3016 * Indicates that this is the only struct which contains the same pointer.
3017 * Rust functions which take ownership of an object provided via an argument require
3018 * this to be true and invalidate the object pointed to by inner.
3021 } LDKQueryChannelRange;
3026 * A query_short_channel_ids message is used to query a peer for
3027 * routing gossip messages related to one or more short_channel_ids.
3028 * The query recipient will reply with the latest, if available,
3029 * channel_announcement, channel_update and node_announcement messages
3030 * it maintains for the requested short_channel_ids followed by a
3031 * reply_short_channel_ids_end message. The short_channel_ids sent in
3032 * this query are encoded. We only support encoding_type=0 uncompressed
3033 * serialization and do not support encoding_type=1 zlib serialization.
3035 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
3037 * A pointer to the opaque Rust object.
3038 * Nearly everywhere, inner must be non-null, however in places where
3039 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3041 LDKnativeQueryShortChannelIds *inner;
3043 * Indicates that this is the only struct which contains the same pointer.
3044 * Rust functions which take ownership of an object provided via an argument require
3045 * this to be true and invalidate the object pointed to by inner.
3048 } LDKQueryShortChannelIds;
3053 * A reply_channel_range message is a reply to a query_channel_range
3054 * message. Multiple reply_channel_range messages can be sent in reply
3055 * to a single query_channel_range message. The query recipient makes a
3056 * best effort to respond based on their local network view which may
3057 * not be a perfect view of the network. The short_channel_ids in the
3058 * reply are encoded. We only support encoding_type=0 uncompressed
3059 * serialization and do not support encoding_type=1 zlib serialization.
3061 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3063 * A pointer to the opaque Rust object.
3064 * Nearly everywhere, inner must be non-null, however in places where
3065 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3067 LDKnativeReplyChannelRange *inner;
3069 * Indicates that this is the only struct which contains the same pointer.
3070 * Rust functions which take ownership of an object provided via an argument require
3071 * this to be true and invalidate the object pointed to by inner.
3074 } LDKReplyChannelRange;
3077 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
3078 * broadcast to most peers).
3079 * These events are handled by PeerManager::process_events if you are using a PeerManager.
3081 typedef enum LDKMessageSendEvent_Tag {
3083 * Used to indicate that we've accepted a channel open and should send the accept_channel
3084 * message provided to the given peer.
3086 LDKMessageSendEvent_SendAcceptChannel,
3088 * Used to indicate that we've initiated a channel open and should send the open_channel
3089 * message provided to the given peer.
3091 LDKMessageSendEvent_SendOpenChannel,
3093 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
3095 LDKMessageSendEvent_SendFundingCreated,
3097 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
3099 LDKMessageSendEvent_SendFundingSigned,
3101 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
3103 LDKMessageSendEvent_SendFundingLocked,
3105 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
3107 LDKMessageSendEvent_SendAnnouncementSignatures,
3109 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
3110 * message should be sent to the peer with the given node_id.
3112 LDKMessageSendEvent_UpdateHTLCs,
3114 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
3116 LDKMessageSendEvent_SendRevokeAndACK,
3118 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
3120 LDKMessageSendEvent_SendClosingSigned,
3122 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
3124 LDKMessageSendEvent_SendShutdown,
3126 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
3128 LDKMessageSendEvent_SendChannelReestablish,
3130 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
3131 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
3133 * Note that after doing so, you very likely (unless you did so very recently) want to call
3134 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
3135 * This ensures that any nodes which see our channel_announcement also have a relevant
3136 * node_announcement, including relevant feature flags which may be important for routing
3139 LDKMessageSendEvent_BroadcastChannelAnnouncement,
3141 * Used to indicate that a node_announcement should be broadcast to all peers.
3143 LDKMessageSendEvent_BroadcastNodeAnnouncement,
3145 * Used to indicate that a channel_update should be broadcast to all peers.
3147 LDKMessageSendEvent_BroadcastChannelUpdate,
3149 * Broadcast an error downstream to be handled
3151 LDKMessageSendEvent_HandleError,
3153 * When a payment fails we may receive updates back from the hop where it failed. In such
3154 * cases this event is generated so that we can inform the network graph of this information.
3156 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
3158 * Query a peer for channels with funding transaction UTXOs in a block range.
3160 LDKMessageSendEvent_SendChannelRangeQuery,
3162 * Request routing gossip messages from a peer for a list of channels identified by
3163 * their short_channel_ids.
3165 LDKMessageSendEvent_SendShortIdsQuery,
3167 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
3168 * emitted during processing of the query.
3170 LDKMessageSendEvent_SendReplyChannelRange,
3172 * Must be last for serialization purposes
3174 LDKMessageSendEvent_Sentinel,
3175 } LDKMessageSendEvent_Tag;
3177 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
3179 * The node_id of the node which should receive this message
3181 struct LDKPublicKey node_id;
3183 * The message which should be sent.
3185 struct LDKAcceptChannel msg;
3186 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
3188 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
3190 * The node_id of the node which should receive this message
3192 struct LDKPublicKey node_id;
3194 * The message which should be sent.
3196 struct LDKOpenChannel msg;
3197 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
3199 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
3201 * The node_id of the node which should receive this message
3203 struct LDKPublicKey node_id;
3205 * The message which should be sent.
3207 struct LDKFundingCreated msg;
3208 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
3210 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
3212 * The node_id of the node which should receive this message
3214 struct LDKPublicKey node_id;
3216 * The message which should be sent.
3218 struct LDKFundingSigned msg;
3219 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
3221 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
3223 * The node_id of the node which should receive these message(s)
3225 struct LDKPublicKey node_id;
3227 * The funding_locked message which should be sent.
3229 struct LDKFundingLocked msg;
3230 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
3232 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
3234 * The node_id of the node which should receive these message(s)
3236 struct LDKPublicKey node_id;
3238 * The announcement_signatures message which should be sent.
3240 struct LDKAnnouncementSignatures msg;
3241 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
3243 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
3245 * The node_id of the node which should receive these message(s)
3247 struct LDKPublicKey node_id;
3249 * The update messages which should be sent. ALL messages in the struct should be sent!
3251 struct LDKCommitmentUpdate updates;
3252 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
3254 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
3256 * The node_id of the node which should receive this message
3258 struct LDKPublicKey node_id;
3260 * The message which should be sent.
3262 struct LDKRevokeAndACK msg;
3263 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
3265 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
3267 * The node_id of the node which should receive this message
3269 struct LDKPublicKey node_id;
3271 * The message which should be sent.
3273 struct LDKClosingSigned msg;
3274 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
3276 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
3278 * The node_id of the node which should receive this message
3280 struct LDKPublicKey node_id;
3282 * The message which should be sent.
3284 struct LDKShutdown msg;
3285 } LDKMessageSendEvent_LDKSendShutdown_Body;
3287 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
3289 * The node_id of the node which should receive this message
3291 struct LDKPublicKey node_id;
3293 * The message which should be sent.
3295 struct LDKChannelReestablish msg;
3296 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
3298 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
3300 * The channel_announcement which should be sent.
3302 struct LDKChannelAnnouncement msg;
3304 * The followup channel_update which should be sent.
3306 struct LDKChannelUpdate update_msg;
3307 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
3309 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
3311 * The node_announcement which should be sent.
3313 struct LDKNodeAnnouncement msg;
3314 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
3316 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
3318 * The channel_update which should be sent.
3320 struct LDKChannelUpdate msg;
3321 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
3323 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
3325 * The node_id of the node which should receive this message
3327 struct LDKPublicKey node_id;
3329 * The action which should be taken.
3331 struct LDKErrorAction action;
3332 } LDKMessageSendEvent_LDKHandleError_Body;
3334 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
3336 * The channel/node update which should be sent to NetGraphMsgHandler
3338 struct LDKHTLCFailChannelUpdate update;
3339 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
3341 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
3343 * The node_id of this message recipient
3345 struct LDKPublicKey node_id;
3347 * The query_channel_range which should be sent.
3349 struct LDKQueryChannelRange msg;
3350 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
3352 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
3354 * The node_id of this message recipient
3356 struct LDKPublicKey node_id;
3358 * The query_short_channel_ids which should be sent.
3360 struct LDKQueryShortChannelIds msg;
3361 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
3363 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
3365 * The node_id of this message recipient
3367 struct LDKPublicKey node_id;
3369 * The reply_channel_range which should be sent.
3371 struct LDKReplyChannelRange msg;
3372 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
3374 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
3375 LDKMessageSendEvent_Tag tag;
3377 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
3378 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
3379 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
3380 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
3381 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
3382 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
3383 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
3384 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
3385 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
3386 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
3387 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
3388 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
3389 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
3390 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
3391 LDKMessageSendEvent_LDKHandleError_Body handle_error;
3392 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
3393 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
3394 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
3395 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
3397 } LDKMessageSendEvent;
3400 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
3401 * This corresponds to std::vector in C++
3403 typedef struct LDKCVec_MessageSendEventZ {
3405 * The elements in the array.
3406 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3408 struct LDKMessageSendEvent *data;
3410 * The number of elements pointed to by `data`.
3413 } LDKCVec_MessageSendEventZ;
3416 * The contents of CResult_boolLightningErrorZ
3418 typedef union LDKCResult_boolLightningErrorZPtr {
3420 * A pointer to the contents in the success state.
3421 * Reading from this pointer when `result_ok` is not set is undefined.
3425 * A pointer to the contents in the error state.
3426 * Reading from this pointer when `result_ok` is set is undefined.
3428 struct LDKLightningError *err;
3429 } LDKCResult_boolLightningErrorZPtr;
3432 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
3433 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
3434 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3436 typedef struct LDKCResult_boolLightningErrorZ {
3438 * The contents of this CResult_boolLightningErrorZ, accessible via either
3439 * `err` or `result` depending on the state of `result_ok`.
3441 union LDKCResult_boolLightningErrorZPtr contents;
3443 * Whether this CResult_boolLightningErrorZ represents a success state.
3446 } LDKCResult_boolLightningErrorZ;
3449 * A tuple of 3 elements. See the individual fields for the types contained.
3451 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
3453 * The element at position 0
3455 struct LDKChannelAnnouncement a;
3457 * The element at position 1
3459 struct LDKChannelUpdate b;
3461 * The element at position 2
3463 struct LDKChannelUpdate c;
3464 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
3467 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
3468 * This corresponds to std::vector in C++
3470 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
3472 * The elements in the array.
3473 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3475 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
3477 * The number of elements pointed to by `data`.
3480 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
3483 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
3484 * This corresponds to std::vector in C++
3486 typedef struct LDKCVec_NodeAnnouncementZ {
3488 * The elements in the array.
3489 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3491 struct LDKNodeAnnouncement *data;
3493 * The number of elements pointed to by `data`.
3496 } LDKCVec_NodeAnnouncementZ;
3499 * The contents of CResult_NoneLightningErrorZ
3501 typedef union LDKCResult_NoneLightningErrorZPtr {
3503 * Note that this value is always NULL, as there are no contents in the OK variant
3507 * A pointer to the contents in the error state.
3508 * Reading from this pointer when `result_ok` is set is undefined.
3510 struct LDKLightningError *err;
3511 } LDKCResult_NoneLightningErrorZPtr;
3514 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
3515 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
3516 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3518 typedef struct LDKCResult_NoneLightningErrorZ {
3520 * The contents of this CResult_NoneLightningErrorZ, accessible via either
3521 * `err` or `result` depending on the state of `result_ok`.
3523 union LDKCResult_NoneLightningErrorZPtr contents;
3525 * Whether this CResult_NoneLightningErrorZ represents a success state.
3528 } LDKCResult_NoneLightningErrorZ;
3531 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
3532 * This corresponds to std::vector in C++
3534 typedef struct LDKCVec_PublicKeyZ {
3536 * The elements in the array.
3537 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3539 struct LDKPublicKey *data;
3541 * The number of elements pointed to by `data`.
3544 } LDKCVec_PublicKeyZ;
3549 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
3550 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
3553 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
3555 * A pointer to the opaque Rust object.
3556 * Nearly everywhere, inner must be non-null, however in places where
3557 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3559 LDKnativePeerHandleError *inner;
3561 * Indicates that this is the only struct which contains the same pointer.
3562 * Rust functions which take ownership of an object provided via an argument require
3563 * this to be true and invalidate the object pointed to by inner.
3566 } LDKPeerHandleError;
3569 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
3571 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
3573 * A pointer to the contents in the success state.
3574 * Reading from this pointer when `result_ok` is not set is undefined.
3576 struct LDKCVec_u8Z *result;
3578 * A pointer to the contents in the error state.
3579 * Reading from this pointer when `result_ok` is set is undefined.
3581 struct LDKPeerHandleError *err;
3582 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
3585 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
3586 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
3587 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3589 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
3591 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
3592 * `err` or `result` depending on the state of `result_ok`.
3594 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
3596 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
3599 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
3602 * The contents of CResult_NonePeerHandleErrorZ
3604 typedef union LDKCResult_NonePeerHandleErrorZPtr {
3606 * Note that this value is always NULL, as there are no contents in the OK variant
3610 * A pointer to the contents in the error state.
3611 * Reading from this pointer when `result_ok` is set is undefined.
3613 struct LDKPeerHandleError *err;
3614 } LDKCResult_NonePeerHandleErrorZPtr;
3617 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
3618 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
3619 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3621 typedef struct LDKCResult_NonePeerHandleErrorZ {
3623 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
3624 * `err` or `result` depending on the state of `result_ok`.
3626 union LDKCResult_NonePeerHandleErrorZPtr contents;
3628 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
3631 } LDKCResult_NonePeerHandleErrorZ;
3634 * The contents of CResult_boolPeerHandleErrorZ
3636 typedef union LDKCResult_boolPeerHandleErrorZPtr {
3638 * A pointer to the contents in the success state.
3639 * Reading from this pointer when `result_ok` is not set is undefined.
3643 * A pointer to the contents in the error state.
3644 * Reading from this pointer when `result_ok` is set is undefined.
3646 struct LDKPeerHandleError *err;
3647 } LDKCResult_boolPeerHandleErrorZPtr;
3650 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
3651 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
3652 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3654 typedef struct LDKCResult_boolPeerHandleErrorZ {
3656 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
3657 * `err` or `result` depending on the state of `result_ok`.
3659 union LDKCResult_boolPeerHandleErrorZPtr contents;
3661 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
3664 } LDKCResult_boolPeerHandleErrorZ;
3667 * The contents of CResult_TxOutAccessErrorZ
3669 typedef union LDKCResult_TxOutAccessErrorZPtr {
3671 * A pointer to the contents in the success state.
3672 * Reading from this pointer when `result_ok` is not set is undefined.
3674 struct LDKTxOut *result;
3676 * A pointer to the contents in the error state.
3677 * Reading from this pointer when `result_ok` is set is undefined.
3679 enum LDKAccessError *err;
3680 } LDKCResult_TxOutAccessErrorZPtr;
3683 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
3684 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
3685 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3687 typedef struct LDKCResult_TxOutAccessErrorZ {
3689 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
3690 * `err` or `result` depending on the state of `result_ok`.
3692 union LDKCResult_TxOutAccessErrorZPtr contents;
3694 * Whether this CResult_TxOutAccessErrorZ represents a success state.
3697 } LDKCResult_TxOutAccessErrorZ;
3700 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
3702 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
3704 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
3706 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
3708 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
3710 LDKCOption_C2Tuple_usizeTransactionZZ_None,
3712 * Must be last for serialization purposes
3714 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
3715 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
3717 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
3718 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
3721 struct LDKC2Tuple_usizeTransactionZ some;
3724 } LDKCOption_C2Tuple_usizeTransactionZZ;
3729 * Details about one direction of a channel. Received
3730 * within a channel update.
3732 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
3734 * A pointer to the opaque Rust object.
3735 * Nearly everywhere, inner must be non-null, however in places where
3736 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3738 LDKnativeDirectionalChannelInfo *inner;
3740 * Indicates that this is the only struct which contains the same pointer.
3741 * Rust functions which take ownership of an object provided via an argument require
3742 * this to be true and invalidate the object pointed to by inner.
3745 } LDKDirectionalChannelInfo;
3748 * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
3750 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
3752 * A pointer to the contents in the success state.
3753 * Reading from this pointer when `result_ok` is not set is undefined.
3755 struct LDKDirectionalChannelInfo *result;
3757 * A pointer to the contents in the error state.
3758 * Reading from this pointer when `result_ok` is set is undefined.
3760 struct LDKDecodeError *err;
3761 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
3764 * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
3765 * containing a crate::lightning::routing::network_graph::DirectionalChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
3766 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3768 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
3770 * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
3771 * `err` or `result` depending on the state of `result_ok`.
3773 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
3775 * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
3778 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
3783 * Details about a channel (both directions).
3784 * Received within a channel announcement.
3786 typedef struct MUST_USE_STRUCT LDKChannelInfo {
3788 * A pointer to the opaque Rust object.
3789 * Nearly everywhere, inner must be non-null, however in places where
3790 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3792 LDKnativeChannelInfo *inner;
3794 * Indicates that this is the only struct which contains the same pointer.
3795 * Rust functions which take ownership of an object provided via an argument require
3796 * this to be true and invalidate the object pointed to by inner.
3802 * The contents of CResult_ChannelInfoDecodeErrorZ
3804 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
3806 * A pointer to the contents in the success state.
3807 * Reading from this pointer when `result_ok` is not set is undefined.
3809 struct LDKChannelInfo *result;
3811 * A pointer to the contents in the error state.
3812 * Reading from this pointer when `result_ok` is set is undefined.
3814 struct LDKDecodeError *err;
3815 } LDKCResult_ChannelInfoDecodeErrorZPtr;
3818 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
3819 * containing a crate::lightning::routing::network_graph::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
3820 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3822 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
3824 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
3825 * `err` or `result` depending on the state of `result_ok`.
3827 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
3829 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
3832 } LDKCResult_ChannelInfoDecodeErrorZ;
3837 * Fees for routing via a given channel or a node
3839 typedef struct MUST_USE_STRUCT LDKRoutingFees {
3841 * A pointer to the opaque Rust object.
3842 * Nearly everywhere, inner must be non-null, however in places where
3843 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3845 LDKnativeRoutingFees *inner;
3847 * Indicates that this is the only struct which contains the same pointer.
3848 * Rust functions which take ownership of an object provided via an argument require
3849 * this to be true and invalidate the object pointed to by inner.
3855 * The contents of CResult_RoutingFeesDecodeErrorZ
3857 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
3859 * A pointer to the contents in the success state.
3860 * Reading from this pointer when `result_ok` is not set is undefined.
3862 struct LDKRoutingFees *result;
3864 * A pointer to the contents in the error state.
3865 * Reading from this pointer when `result_ok` is set is undefined.
3867 struct LDKDecodeError *err;
3868 } LDKCResult_RoutingFeesDecodeErrorZPtr;
3871 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
3872 * containing a crate::lightning::routing::network_graph::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
3873 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3875 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
3877 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
3878 * `err` or `result` depending on the state of `result_ok`.
3880 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
3882 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
3885 } LDKCResult_RoutingFeesDecodeErrorZ;
3888 * A 4-byte byte array.
3890 typedef struct LDKFourBytes {
3898 * A 16-byte byte array.
3900 typedef struct LDKSixteenBytes {
3908 * A 10-byte byte array.
3910 typedef struct LDKTenBytes {
3918 * An address which can be used to connect to a remote peer
3920 typedef enum LDKNetAddress_Tag {
3922 * An IPv4 address/port on which the peer is listening.
3926 * An IPv6 address/port on which the peer is listening.
3930 * An old-style Tor onion address/port on which the peer is listening.
3932 LDKNetAddress_OnionV2,
3934 * A new-style Tor onion address/port on which the peer is listening.
3935 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
3936 * wrap as base32 and append \".onion\".
3938 LDKNetAddress_OnionV3,
3940 * Must be last for serialization purposes
3942 LDKNetAddress_Sentinel,
3943 } LDKNetAddress_Tag;
3945 typedef struct LDKNetAddress_LDKIPv4_Body {
3947 * The 4-byte IPv4 address
3949 struct LDKFourBytes addr;
3951 * The port on which the node is listening
3954 } LDKNetAddress_LDKIPv4_Body;
3956 typedef struct LDKNetAddress_LDKIPv6_Body {
3958 * The 16-byte IPv6 address
3960 struct LDKSixteenBytes addr;
3962 * The port on which the node is listening
3965 } LDKNetAddress_LDKIPv6_Body;
3967 typedef struct LDKNetAddress_LDKOnionV2_Body {
3969 * The bytes (usually encoded in base32 with \".onion\" appended)
3971 struct LDKTenBytes addr;
3973 * The port on which the node is listening
3976 } LDKNetAddress_LDKOnionV2_Body;
3978 typedef struct LDKNetAddress_LDKOnionV3_Body {
3980 * The ed25519 long-term public key of the peer
3982 struct LDKThirtyTwoBytes ed25519_pubkey;
3984 * The checksum of the pubkey and version, as included in the onion address
3988 * The version byte, as defined by the Tor Onion v3 spec.
3992 * The port on which the node is listening
3995 } LDKNetAddress_LDKOnionV3_Body;
3997 typedef struct MUST_USE_STRUCT LDKNetAddress {
3998 LDKNetAddress_Tag tag;
4000 LDKNetAddress_LDKIPv4_Body i_pv4;
4001 LDKNetAddress_LDKIPv6_Body i_pv6;
4002 LDKNetAddress_LDKOnionV2_Body onion_v2;
4003 LDKNetAddress_LDKOnionV3_Body onion_v3;
4008 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
4009 * This corresponds to std::vector in C++
4011 typedef struct LDKCVec_NetAddressZ {
4013 * The elements in the array.
4014 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4016 struct LDKNetAddress *data;
4018 * The number of elements pointed to by `data`.
4021 } LDKCVec_NetAddressZ;
4026 * Information received in the latest node_announcement from this node.
4028 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
4030 * A pointer to the opaque Rust object.
4031 * Nearly everywhere, inner must be non-null, however in places where
4032 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4034 LDKnativeNodeAnnouncementInfo *inner;
4036 * Indicates that this is the only struct which contains the same pointer.
4037 * Rust functions which take ownership of an object provided via an argument require
4038 * this to be true and invalidate the object pointed to by inner.
4041 } LDKNodeAnnouncementInfo;
4044 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
4046 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
4048 * A pointer to the contents in the success state.
4049 * Reading from this pointer when `result_ok` is not set is undefined.
4051 struct LDKNodeAnnouncementInfo *result;
4053 * A pointer to the contents in the error state.
4054 * Reading from this pointer when `result_ok` is set is undefined.
4056 struct LDKDecodeError *err;
4057 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
4060 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
4061 * containing a crate::lightning::routing::network_graph::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4062 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4064 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
4066 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
4067 * `err` or `result` depending on the state of `result_ok`.
4069 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
4071 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
4074 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
4077 * A dynamically-allocated array of u64s of arbitrary size.
4078 * This corresponds to std::vector in C++
4080 typedef struct LDKCVec_u64Z {
4082 * The elements in the array.
4083 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4087 * The number of elements pointed to by `data`.
4095 * Details about a node in the network, known from the network announcement.
4097 typedef struct MUST_USE_STRUCT LDKNodeInfo {
4099 * A pointer to the opaque Rust object.
4100 * Nearly everywhere, inner must be non-null, however in places where
4101 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4103 LDKnativeNodeInfo *inner;
4105 * Indicates that this is the only struct which contains the same pointer.
4106 * Rust functions which take ownership of an object provided via an argument require
4107 * this to be true and invalidate the object pointed to by inner.
4113 * The contents of CResult_NodeInfoDecodeErrorZ
4115 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
4117 * A pointer to the contents in the success state.
4118 * Reading from this pointer when `result_ok` is not set is undefined.
4120 struct LDKNodeInfo *result;
4122 * A pointer to the contents in the error state.
4123 * Reading from this pointer when `result_ok` is set is undefined.
4125 struct LDKDecodeError *err;
4126 } LDKCResult_NodeInfoDecodeErrorZPtr;
4129 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
4130 * containing a crate::lightning::routing::network_graph::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4131 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4133 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
4135 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
4136 * `err` or `result` depending on the state of `result_ok`.
4138 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
4140 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
4143 } LDKCResult_NodeInfoDecodeErrorZ;
4148 * Represents the network as nodes and channels between them
4150 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4152 * A pointer to the opaque Rust object.
4153 * Nearly everywhere, inner must be non-null, however in places where
4154 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4156 LDKnativeNetworkGraph *inner;
4158 * Indicates that this is the only struct which contains the same pointer.
4159 * Rust functions which take ownership of an object provided via an argument require
4160 * this to be true and invalidate the object pointed to by inner.
4166 * The contents of CResult_NetworkGraphDecodeErrorZ
4168 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
4170 * A pointer to the contents in the success state.
4171 * Reading from this pointer when `result_ok` is not set is undefined.
4173 struct LDKNetworkGraph *result;
4175 * A pointer to the contents in the error state.
4176 * Reading from this pointer when `result_ok` is set is undefined.
4178 struct LDKDecodeError *err;
4179 } LDKCResult_NetworkGraphDecodeErrorZPtr;
4182 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
4183 * containing a crate::lightning::routing::network_graph::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
4184 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4186 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
4188 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
4189 * `err` or `result` depending on the state of `result_ok`.
4191 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
4193 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
4196 } LDKCResult_NetworkGraphDecodeErrorZ;
4201 * Features used within an `init` message.
4203 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4205 * A pointer to the opaque Rust object.
4206 * Nearly everywhere, inner must be non-null, however in places where
4207 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4209 LDKnativeInitFeatures *inner;
4211 * Indicates that this is the only struct which contains the same pointer.
4212 * Rust functions which take ownership of an object provided via an argument require
4213 * this to be true and invalidate the object pointed to by inner.
4219 * The contents of CResult_InitFeaturesDecodeErrorZ
4221 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4223 * A pointer to the contents in the success state.
4224 * Reading from this pointer when `result_ok` is not set is undefined.
4226 struct LDKInitFeatures *result;
4228 * A pointer to the contents in the error state.
4229 * Reading from this pointer when `result_ok` is set is undefined.
4231 struct LDKDecodeError *err;
4232 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4235 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4236 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4237 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4239 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4241 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4242 * `err` or `result` depending on the state of `result_ok`.
4244 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4246 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4249 } LDKCResult_InitFeaturesDecodeErrorZ;
4254 * Features used within a `node_announcement` message.
4256 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4258 * A pointer to the opaque Rust object.
4259 * Nearly everywhere, inner must be non-null, however in places where
4260 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4262 LDKnativeNodeFeatures *inner;
4264 * Indicates that this is the only struct which contains the same pointer.
4265 * Rust functions which take ownership of an object provided via an argument require
4266 * this to be true and invalidate the object pointed to by inner.
4272 * The contents of CResult_NodeFeaturesDecodeErrorZ
4274 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
4276 * A pointer to the contents in the success state.
4277 * Reading from this pointer when `result_ok` is not set is undefined.
4279 struct LDKNodeFeatures *result;
4281 * A pointer to the contents in the error state.
4282 * Reading from this pointer when `result_ok` is set is undefined.
4284 struct LDKDecodeError *err;
4285 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
4288 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
4289 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4290 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4292 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
4294 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
4295 * `err` or `result` depending on the state of `result_ok`.
4297 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
4299 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
4302 } LDKCResult_NodeFeaturesDecodeErrorZ;
4307 * Features used within a `channel_announcement` message.
4309 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4311 * A pointer to the opaque Rust object.
4312 * Nearly everywhere, inner must be non-null, however in places where
4313 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4315 LDKnativeChannelFeatures *inner;
4317 * Indicates that this is the only struct which contains the same pointer.
4318 * Rust functions which take ownership of an object provided via an argument require
4319 * this to be true and invalidate the object pointed to by inner.
4322 } LDKChannelFeatures;
4325 * The contents of CResult_ChannelFeaturesDecodeErrorZ
4327 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4329 * A pointer to the contents in the success state.
4330 * Reading from this pointer when `result_ok` is not set is undefined.
4332 struct LDKChannelFeatures *result;
4334 * A pointer to the contents in the error state.
4335 * Reading from this pointer when `result_ok` is set is undefined.
4337 struct LDKDecodeError *err;
4338 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4341 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4342 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4343 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4345 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4347 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4348 * `err` or `result` depending on the state of `result_ok`.
4350 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4352 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4355 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4360 * Features used within an invoice.
4362 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
4364 * A pointer to the opaque Rust object.
4365 * Nearly everywhere, inner must be non-null, however in places where
4366 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4368 LDKnativeInvoiceFeatures *inner;
4370 * Indicates that this is the only struct which contains the same pointer.
4371 * Rust functions which take ownership of an object provided via an argument require
4372 * this to be true and invalidate the object pointed to by inner.
4375 } LDKInvoiceFeatures;
4378 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
4380 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
4382 * A pointer to the contents in the success state.
4383 * Reading from this pointer when `result_ok` is not set is undefined.
4385 struct LDKInvoiceFeatures *result;
4387 * A pointer to the contents in the error state.
4388 * Reading from this pointer when `result_ok` is set is undefined.
4390 struct LDKDecodeError *err;
4391 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
4394 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4395 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4396 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4398 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
4400 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
4401 * `err` or `result` depending on the state of `result_ok`.
4403 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
4405 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
4408 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
4411 * The contents of CResult_NetAddressu8Z
4413 typedef union LDKCResult_NetAddressu8ZPtr {
4415 * A pointer to the contents in the success state.
4416 * Reading from this pointer when `result_ok` is not set is undefined.
4418 struct LDKNetAddress *result;
4420 * A pointer to the contents in the error state.
4421 * Reading from this pointer when `result_ok` is set is undefined.
4424 } LDKCResult_NetAddressu8ZPtr;
4427 * A CResult_NetAddressu8Z represents the result of a fallible operation,
4428 * containing a crate::lightning::ln::msgs::NetAddress on success and a u8 on failure.
4429 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4431 typedef struct LDKCResult_NetAddressu8Z {
4433 * The contents of this CResult_NetAddressu8Z, accessible via either
4434 * `err` or `result` depending on the state of `result_ok`.
4436 union LDKCResult_NetAddressu8ZPtr contents;
4438 * Whether this CResult_NetAddressu8Z represents a success state.
4441 } LDKCResult_NetAddressu8Z;
4444 * The contents of CResult_CResult_NetAddressu8ZDecodeErrorZ
4446 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4448 * A pointer to the contents in the success state.
4449 * Reading from this pointer when `result_ok` is not set is undefined.
4451 struct LDKCResult_NetAddressu8Z *result;
4453 * A pointer to the contents in the error state.
4454 * Reading from this pointer when `result_ok` is set is undefined.
4456 struct LDKDecodeError *err;
4457 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
4460 * A CResult_CResult_NetAddressu8ZDecodeErrorZ represents the result of a fallible operation,
4461 * containing a crate::c_types::derived::CResult_NetAddressu8Z on success and a crate::lightning::ln::msgs::DecodeError on failure.
4462 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4464 typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
4466 * The contents of this CResult_CResult_NetAddressu8ZDecodeErrorZ, accessible via either
4467 * `err` or `result` depending on the state of `result_ok`.
4469 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
4471 * Whether this CResult_CResult_NetAddressu8ZDecodeErrorZ represents a success state.
4474 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
4479 * An update_add_htlc message to be sent or received from a peer
4481 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
4483 * A pointer to the opaque Rust object.
4484 * Nearly everywhere, inner must be non-null, however in places where
4485 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4487 LDKnativeUpdateAddHTLC *inner;
4489 * Indicates that this is the only struct which contains the same pointer.
4490 * Rust functions which take ownership of an object provided via an argument require
4491 * this to be true and invalidate the object pointed to by inner.
4497 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
4498 * This corresponds to std::vector in C++
4500 typedef struct LDKCVec_UpdateAddHTLCZ {
4502 * The elements in the array.
4503 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4505 struct LDKUpdateAddHTLC *data;
4507 * The number of elements pointed to by `data`.
4510 } LDKCVec_UpdateAddHTLCZ;
4515 * An update_fulfill_htlc message to be sent or received from a peer
4517 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
4519 * A pointer to the opaque Rust object.
4520 * Nearly everywhere, inner must be non-null, however in places where
4521 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4523 LDKnativeUpdateFulfillHTLC *inner;
4525 * Indicates that this is the only struct which contains the same pointer.
4526 * Rust functions which take ownership of an object provided via an argument require
4527 * this to be true and invalidate the object pointed to by inner.
4530 } LDKUpdateFulfillHTLC;
4533 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
4534 * This corresponds to std::vector in C++
4536 typedef struct LDKCVec_UpdateFulfillHTLCZ {
4538 * The elements in the array.
4539 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4541 struct LDKUpdateFulfillHTLC *data;
4543 * The number of elements pointed to by `data`.
4546 } LDKCVec_UpdateFulfillHTLCZ;
4551 * An update_fail_htlc message to be sent or received from a peer
4553 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
4555 * A pointer to the opaque Rust object.
4556 * Nearly everywhere, inner must be non-null, however in places where
4557 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4559 LDKnativeUpdateFailHTLC *inner;
4561 * Indicates that this is the only struct which contains the same pointer.
4562 * Rust functions which take ownership of an object provided via an argument require
4563 * this to be true and invalidate the object pointed to by inner.
4566 } LDKUpdateFailHTLC;
4569 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
4570 * This corresponds to std::vector in C++
4572 typedef struct LDKCVec_UpdateFailHTLCZ {
4574 * The elements in the array.
4575 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4577 struct LDKUpdateFailHTLC *data;
4579 * The number of elements pointed to by `data`.
4582 } LDKCVec_UpdateFailHTLCZ;
4587 * An update_fail_malformed_htlc message to be sent or received from a peer
4589 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
4591 * A pointer to the opaque Rust object.
4592 * Nearly everywhere, inner must be non-null, however in places where
4593 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4595 LDKnativeUpdateFailMalformedHTLC *inner;
4597 * Indicates that this is the only struct which contains the same pointer.
4598 * Rust functions which take ownership of an object provided via an argument require
4599 * this to be true and invalidate the object pointed to by inner.
4602 } LDKUpdateFailMalformedHTLC;
4605 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
4606 * This corresponds to std::vector in C++
4608 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
4610 * The elements in the array.
4611 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4613 struct LDKUpdateFailMalformedHTLC *data;
4615 * The number of elements pointed to by `data`.
4618 } LDKCVec_UpdateFailMalformedHTLCZ;
4621 * The contents of CResult_AcceptChannelDecodeErrorZ
4623 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
4625 * A pointer to the contents in the success state.
4626 * Reading from this pointer when `result_ok` is not set is undefined.
4628 struct LDKAcceptChannel *result;
4630 * A pointer to the contents in the error state.
4631 * Reading from this pointer when `result_ok` is set is undefined.
4633 struct LDKDecodeError *err;
4634 } LDKCResult_AcceptChannelDecodeErrorZPtr;
4637 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
4638 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
4639 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4641 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
4643 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
4644 * `err` or `result` depending on the state of `result_ok`.
4646 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
4648 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
4651 } LDKCResult_AcceptChannelDecodeErrorZ;
4654 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
4656 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
4658 * A pointer to the contents in the success state.
4659 * Reading from this pointer when `result_ok` is not set is undefined.
4661 struct LDKAnnouncementSignatures *result;
4663 * A pointer to the contents in the error state.
4664 * Reading from this pointer when `result_ok` is set is undefined.
4666 struct LDKDecodeError *err;
4667 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
4670 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
4671 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4672 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4674 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
4676 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
4677 * `err` or `result` depending on the state of `result_ok`.
4679 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
4681 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
4684 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
4687 * The contents of CResult_ChannelReestablishDecodeErrorZ
4689 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
4691 * A pointer to the contents in the success state.
4692 * Reading from this pointer when `result_ok` is not set is undefined.
4694 struct LDKChannelReestablish *result;
4696 * A pointer to the contents in the error state.
4697 * Reading from this pointer when `result_ok` is set is undefined.
4699 struct LDKDecodeError *err;
4700 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
4703 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
4704 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
4705 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4707 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
4709 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
4710 * `err` or `result` depending on the state of `result_ok`.
4712 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
4714 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
4717 } LDKCResult_ChannelReestablishDecodeErrorZ;
4720 * The contents of CResult_ClosingSignedDecodeErrorZ
4722 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
4724 * A pointer to the contents in the success state.
4725 * Reading from this pointer when `result_ok` is not set is undefined.
4727 struct LDKClosingSigned *result;
4729 * A pointer to the contents in the error state.
4730 * Reading from this pointer when `result_ok` is set is undefined.
4732 struct LDKDecodeError *err;
4733 } LDKCResult_ClosingSignedDecodeErrorZPtr;
4736 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
4737 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
4738 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4740 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
4742 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
4743 * `err` or `result` depending on the state of `result_ok`.
4745 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
4747 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
4750 } LDKCResult_ClosingSignedDecodeErrorZ;
4755 * A commitment_signed message to be sent or received from a peer
4757 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
4759 * A pointer to the opaque Rust object.
4760 * Nearly everywhere, inner must be non-null, however in places where
4761 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4763 LDKnativeCommitmentSigned *inner;
4765 * Indicates that this is the only struct which contains the same pointer.
4766 * Rust functions which take ownership of an object provided via an argument require
4767 * this to be true and invalidate the object pointed to by inner.
4770 } LDKCommitmentSigned;
4773 * The contents of CResult_CommitmentSignedDecodeErrorZ
4775 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
4777 * A pointer to the contents in the success state.
4778 * Reading from this pointer when `result_ok` is not set is undefined.
4780 struct LDKCommitmentSigned *result;
4782 * A pointer to the contents in the error state.
4783 * Reading from this pointer when `result_ok` is set is undefined.
4785 struct LDKDecodeError *err;
4786 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
4789 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
4790 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
4791 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4793 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
4795 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
4796 * `err` or `result` depending on the state of `result_ok`.
4798 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
4800 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
4803 } LDKCResult_CommitmentSignedDecodeErrorZ;
4806 * The contents of CResult_FundingCreatedDecodeErrorZ
4808 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
4810 * A pointer to the contents in the success state.
4811 * Reading from this pointer when `result_ok` is not set is undefined.
4813 struct LDKFundingCreated *result;
4815 * A pointer to the contents in the error state.
4816 * Reading from this pointer when `result_ok` is set is undefined.
4818 struct LDKDecodeError *err;
4819 } LDKCResult_FundingCreatedDecodeErrorZPtr;
4822 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
4823 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
4824 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4826 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
4828 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
4829 * `err` or `result` depending on the state of `result_ok`.
4831 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
4833 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
4836 } LDKCResult_FundingCreatedDecodeErrorZ;
4839 * The contents of CResult_FundingSignedDecodeErrorZ
4841 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
4843 * A pointer to the contents in the success state.
4844 * Reading from this pointer when `result_ok` is not set is undefined.
4846 struct LDKFundingSigned *result;
4848 * A pointer to the contents in the error state.
4849 * Reading from this pointer when `result_ok` is set is undefined.
4851 struct LDKDecodeError *err;
4852 } LDKCResult_FundingSignedDecodeErrorZPtr;
4855 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
4856 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
4857 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4859 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
4861 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
4862 * `err` or `result` depending on the state of `result_ok`.
4864 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
4866 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
4869 } LDKCResult_FundingSignedDecodeErrorZ;
4872 * The contents of CResult_FundingLockedDecodeErrorZ
4874 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
4876 * A pointer to the contents in the success state.
4877 * Reading from this pointer when `result_ok` is not set is undefined.
4879 struct LDKFundingLocked *result;
4881 * A pointer to the contents in the error state.
4882 * Reading from this pointer when `result_ok` is set is undefined.
4884 struct LDKDecodeError *err;
4885 } LDKCResult_FundingLockedDecodeErrorZPtr;
4888 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
4889 * containing a crate::lightning::ln::msgs::FundingLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
4890 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4892 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
4894 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
4895 * `err` or `result` depending on the state of `result_ok`.
4897 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
4899 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
4902 } LDKCResult_FundingLockedDecodeErrorZ;
4907 * An init message to be sent or received from a peer
4909 typedef struct MUST_USE_STRUCT LDKInit {
4911 * A pointer to the opaque Rust object.
4912 * Nearly everywhere, inner must be non-null, however in places where
4913 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4915 LDKnativeInit *inner;
4917 * Indicates that this is the only struct which contains the same pointer.
4918 * Rust functions which take ownership of an object provided via an argument require
4919 * this to be true and invalidate the object pointed to by inner.
4925 * The contents of CResult_InitDecodeErrorZ
4927 typedef union LDKCResult_InitDecodeErrorZPtr {
4929 * A pointer to the contents in the success state.
4930 * Reading from this pointer when `result_ok` is not set is undefined.
4932 struct LDKInit *result;
4934 * A pointer to the contents in the error state.
4935 * Reading from this pointer when `result_ok` is set is undefined.
4937 struct LDKDecodeError *err;
4938 } LDKCResult_InitDecodeErrorZPtr;
4941 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
4942 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
4943 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4945 typedef struct LDKCResult_InitDecodeErrorZ {
4947 * The contents of this CResult_InitDecodeErrorZ, accessible via either
4948 * `err` or `result` depending on the state of `result_ok`.
4950 union LDKCResult_InitDecodeErrorZPtr contents;
4952 * Whether this CResult_InitDecodeErrorZ represents a success state.
4955 } LDKCResult_InitDecodeErrorZ;
4958 * The contents of CResult_OpenChannelDecodeErrorZ
4960 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
4962 * A pointer to the contents in the success state.
4963 * Reading from this pointer when `result_ok` is not set is undefined.
4965 struct LDKOpenChannel *result;
4967 * A pointer to the contents in the error state.
4968 * Reading from this pointer when `result_ok` is set is undefined.
4970 struct LDKDecodeError *err;
4971 } LDKCResult_OpenChannelDecodeErrorZPtr;
4974 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
4975 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
4976 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4978 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
4980 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
4981 * `err` or `result` depending on the state of `result_ok`.
4983 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
4985 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
4988 } LDKCResult_OpenChannelDecodeErrorZ;
4991 * The contents of CResult_RevokeAndACKDecodeErrorZ
4993 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
4995 * A pointer to the contents in the success state.
4996 * Reading from this pointer when `result_ok` is not set is undefined.
4998 struct LDKRevokeAndACK *result;
5000 * A pointer to the contents in the error state.
5001 * Reading from this pointer when `result_ok` is set is undefined.
5003 struct LDKDecodeError *err;
5004 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
5007 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
5008 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
5009 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5011 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
5013 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
5014 * `err` or `result` depending on the state of `result_ok`.
5016 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
5018 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
5021 } LDKCResult_RevokeAndACKDecodeErrorZ;
5024 * The contents of CResult_ShutdownDecodeErrorZ
5026 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
5028 * A pointer to the contents in the success state.
5029 * Reading from this pointer when `result_ok` is not set is undefined.
5031 struct LDKShutdown *result;
5033 * A pointer to the contents in the error state.
5034 * Reading from this pointer when `result_ok` is set is undefined.
5036 struct LDKDecodeError *err;
5037 } LDKCResult_ShutdownDecodeErrorZPtr;
5040 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
5041 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
5042 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5044 typedef struct LDKCResult_ShutdownDecodeErrorZ {
5046 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
5047 * `err` or `result` depending on the state of `result_ok`.
5049 union LDKCResult_ShutdownDecodeErrorZPtr contents;
5051 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
5054 } LDKCResult_ShutdownDecodeErrorZ;
5057 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
5059 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
5061 * A pointer to the contents in the success state.
5062 * Reading from this pointer when `result_ok` is not set is undefined.
5064 struct LDKUpdateFailHTLC *result;
5066 * A pointer to the contents in the error state.
5067 * Reading from this pointer when `result_ok` is set is undefined.
5069 struct LDKDecodeError *err;
5070 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
5073 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
5074 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5075 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5077 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
5079 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
5080 * `err` or `result` depending on the state of `result_ok`.
5082 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
5084 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
5087 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
5090 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
5092 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5094 * A pointer to the contents in the success state.
5095 * Reading from this pointer when `result_ok` is not set is undefined.
5097 struct LDKUpdateFailMalformedHTLC *result;
5099 * A pointer to the contents in the error state.
5100 * Reading from this pointer when `result_ok` is set is undefined.
5102 struct LDKDecodeError *err;
5103 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
5106 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
5107 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5108 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5110 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
5112 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
5113 * `err` or `result` depending on the state of `result_ok`.
5115 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
5117 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
5120 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
5125 * An update_fee message to be sent or received from a peer
5127 typedef struct MUST_USE_STRUCT LDKUpdateFee {
5129 * A pointer to the opaque Rust object.
5130 * Nearly everywhere, inner must be non-null, however in places where
5131 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5133 LDKnativeUpdateFee *inner;
5135 * Indicates that this is the only struct which contains the same pointer.
5136 * Rust functions which take ownership of an object provided via an argument require
5137 * this to be true and invalidate the object pointed to by inner.
5143 * The contents of CResult_UpdateFeeDecodeErrorZ
5145 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
5147 * A pointer to the contents in the success state.
5148 * Reading from this pointer when `result_ok` is not set is undefined.
5150 struct LDKUpdateFee *result;
5152 * A pointer to the contents in the error state.
5153 * Reading from this pointer when `result_ok` is set is undefined.
5155 struct LDKDecodeError *err;
5156 } LDKCResult_UpdateFeeDecodeErrorZPtr;
5159 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
5160 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
5161 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5163 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
5165 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
5166 * `err` or `result` depending on the state of `result_ok`.
5168 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
5170 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
5173 } LDKCResult_UpdateFeeDecodeErrorZ;
5176 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
5178 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
5180 * A pointer to the contents in the success state.
5181 * Reading from this pointer when `result_ok` is not set is undefined.
5183 struct LDKUpdateFulfillHTLC *result;
5185 * A pointer to the contents in the error state.
5186 * Reading from this pointer when `result_ok` is set is undefined.
5188 struct LDKDecodeError *err;
5189 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
5192 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
5193 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5194 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5196 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
5198 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
5199 * `err` or `result` depending on the state of `result_ok`.
5201 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
5203 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
5206 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
5209 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
5211 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
5213 * A pointer to the contents in the success state.
5214 * Reading from this pointer when `result_ok` is not set is undefined.
5216 struct LDKUpdateAddHTLC *result;
5218 * A pointer to the contents in the error state.
5219 * Reading from this pointer when `result_ok` is set is undefined.
5221 struct LDKDecodeError *err;
5222 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
5225 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
5226 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5227 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5229 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
5231 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
5232 * `err` or `result` depending on the state of `result_ok`.
5234 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
5236 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
5239 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
5244 * A ping message to be sent or received from a peer
5246 typedef struct MUST_USE_STRUCT LDKPing {
5248 * A pointer to the opaque Rust object.
5249 * Nearly everywhere, inner must be non-null, however in places where
5250 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5252 LDKnativePing *inner;
5254 * Indicates that this is the only struct which contains the same pointer.
5255 * Rust functions which take ownership of an object provided via an argument require
5256 * this to be true and invalidate the object pointed to by inner.
5262 * The contents of CResult_PingDecodeErrorZ
5264 typedef union LDKCResult_PingDecodeErrorZPtr {
5266 * A pointer to the contents in the success state.
5267 * Reading from this pointer when `result_ok` is not set is undefined.
5269 struct LDKPing *result;
5271 * A pointer to the contents in the error state.
5272 * Reading from this pointer when `result_ok` is set is undefined.
5274 struct LDKDecodeError *err;
5275 } LDKCResult_PingDecodeErrorZPtr;
5278 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
5279 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
5280 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5282 typedef struct LDKCResult_PingDecodeErrorZ {
5284 * The contents of this CResult_PingDecodeErrorZ, accessible via either
5285 * `err` or `result` depending on the state of `result_ok`.
5287 union LDKCResult_PingDecodeErrorZPtr contents;
5289 * Whether this CResult_PingDecodeErrorZ represents a success state.
5292 } LDKCResult_PingDecodeErrorZ;
5297 * A pong message to be sent or received from a peer
5299 typedef struct MUST_USE_STRUCT LDKPong {
5301 * A pointer to the opaque Rust object.
5302 * Nearly everywhere, inner must be non-null, however in places where
5303 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5305 LDKnativePong *inner;
5307 * Indicates that this is the only struct which contains the same pointer.
5308 * Rust functions which take ownership of an object provided via an argument require
5309 * this to be true and invalidate the object pointed to by inner.
5315 * The contents of CResult_PongDecodeErrorZ
5317 typedef union LDKCResult_PongDecodeErrorZPtr {
5319 * A pointer to the contents in the success state.
5320 * Reading from this pointer when `result_ok` is not set is undefined.
5322 struct LDKPong *result;
5324 * A pointer to the contents in the error state.
5325 * Reading from this pointer when `result_ok` is set is undefined.
5327 struct LDKDecodeError *err;
5328 } LDKCResult_PongDecodeErrorZPtr;
5331 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
5332 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
5333 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5335 typedef struct LDKCResult_PongDecodeErrorZ {
5337 * The contents of this CResult_PongDecodeErrorZ, accessible via either
5338 * `err` or `result` depending on the state of `result_ok`.
5340 union LDKCResult_PongDecodeErrorZPtr contents;
5342 * Whether this CResult_PongDecodeErrorZ represents a success state.
5345 } LDKCResult_PongDecodeErrorZ;
5348 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
5350 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
5352 * A pointer to the contents in the success state.
5353 * Reading from this pointer when `result_ok` is not set is undefined.
5355 struct LDKUnsignedChannelAnnouncement *result;
5357 * A pointer to the contents in the error state.
5358 * Reading from this pointer when `result_ok` is set is undefined.
5360 struct LDKDecodeError *err;
5361 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
5364 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
5365 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5366 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5368 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
5370 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
5371 * `err` or `result` depending on the state of `result_ok`.
5373 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
5375 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
5378 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
5381 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
5383 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
5385 * A pointer to the contents in the success state.
5386 * Reading from this pointer when `result_ok` is not set is undefined.
5388 struct LDKChannelAnnouncement *result;
5390 * A pointer to the contents in the error state.
5391 * Reading from this pointer when `result_ok` is set is undefined.
5393 struct LDKDecodeError *err;
5394 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
5397 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
5398 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5399 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5401 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
5403 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
5404 * `err` or `result` depending on the state of `result_ok`.
5406 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
5408 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
5411 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
5416 * The unsigned part of a channel_update
5418 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
5420 * A pointer to the opaque Rust object.
5421 * Nearly everywhere, inner must be non-null, however in places where
5422 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5424 LDKnativeUnsignedChannelUpdate *inner;
5426 * Indicates that this is the only struct which contains the same pointer.
5427 * Rust functions which take ownership of an object provided via an argument require
5428 * this to be true and invalidate the object pointed to by inner.
5431 } LDKUnsignedChannelUpdate;
5434 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
5436 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
5438 * A pointer to the contents in the success state.
5439 * Reading from this pointer when `result_ok` is not set is undefined.
5441 struct LDKUnsignedChannelUpdate *result;
5443 * A pointer to the contents in the error state.
5444 * Reading from this pointer when `result_ok` is set is undefined.
5446 struct LDKDecodeError *err;
5447 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
5450 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
5451 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5452 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5454 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
5456 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
5457 * `err` or `result` depending on the state of `result_ok`.
5459 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
5461 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
5464 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
5467 * The contents of CResult_ChannelUpdateDecodeErrorZ
5469 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
5471 * A pointer to the contents in the success state.
5472 * Reading from this pointer when `result_ok` is not set is undefined.
5474 struct LDKChannelUpdate *result;
5476 * A pointer to the contents in the error state.
5477 * Reading from this pointer when `result_ok` is set is undefined.
5479 struct LDKDecodeError *err;
5480 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
5483 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
5484 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5485 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5487 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
5489 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
5490 * `err` or `result` depending on the state of `result_ok`.
5492 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
5494 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
5497 } LDKCResult_ChannelUpdateDecodeErrorZ;
5500 * The contents of CResult_ErrorMessageDecodeErrorZ
5502 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
5504 * A pointer to the contents in the success state.
5505 * Reading from this pointer when `result_ok` is not set is undefined.
5507 struct LDKErrorMessage *result;
5509 * A pointer to the contents in the error state.
5510 * Reading from this pointer when `result_ok` is set is undefined.
5512 struct LDKDecodeError *err;
5513 } LDKCResult_ErrorMessageDecodeErrorZPtr;
5516 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
5517 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
5518 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5520 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
5522 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
5523 * `err` or `result` depending on the state of `result_ok`.
5525 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
5527 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
5530 } LDKCResult_ErrorMessageDecodeErrorZ;
5535 * The unsigned part of a node_announcement
5537 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
5539 * A pointer to the opaque Rust object.
5540 * Nearly everywhere, inner must be non-null, however in places where
5541 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5543 LDKnativeUnsignedNodeAnnouncement *inner;
5545 * Indicates that this is the only struct which contains the same pointer.
5546 * Rust functions which take ownership of an object provided via an argument require
5547 * this to be true and invalidate the object pointed to by inner.
5550 } LDKUnsignedNodeAnnouncement;
5553 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
5555 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
5557 * A pointer to the contents in the success state.
5558 * Reading from this pointer when `result_ok` is not set is undefined.
5560 struct LDKUnsignedNodeAnnouncement *result;
5562 * A pointer to the contents in the error state.
5563 * Reading from this pointer when `result_ok` is set is undefined.
5565 struct LDKDecodeError *err;
5566 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
5569 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
5570 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5571 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5573 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
5575 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
5576 * `err` or `result` depending on the state of `result_ok`.
5578 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
5580 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
5583 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
5586 * The contents of CResult_NodeAnnouncementDecodeErrorZ
5588 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
5590 * A pointer to the contents in the success state.
5591 * Reading from this pointer when `result_ok` is not set is undefined.
5593 struct LDKNodeAnnouncement *result;
5595 * A pointer to the contents in the error state.
5596 * Reading from this pointer when `result_ok` is set is undefined.
5598 struct LDKDecodeError *err;
5599 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
5602 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
5603 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5604 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5606 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
5608 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
5609 * `err` or `result` depending on the state of `result_ok`.
5611 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
5613 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
5616 } LDKCResult_NodeAnnouncementDecodeErrorZ;
5619 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
5621 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
5623 * A pointer to the contents in the success state.
5624 * Reading from this pointer when `result_ok` is not set is undefined.
5626 struct LDKQueryShortChannelIds *result;
5628 * A pointer to the contents in the error state.
5629 * Reading from this pointer when `result_ok` is set is undefined.
5631 struct LDKDecodeError *err;
5632 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
5635 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
5636 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
5637 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5639 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
5641 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
5642 * `err` or `result` depending on the state of `result_ok`.
5644 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
5646 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
5649 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
5654 * A reply_short_channel_ids_end message is sent as a reply to a
5655 * query_short_channel_ids message. The query recipient makes a best
5656 * effort to respond based on their local network view which may not be
5657 * a perfect view of the network.
5659 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
5661 * A pointer to the opaque Rust object.
5662 * Nearly everywhere, inner must be non-null, however in places where
5663 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5665 LDKnativeReplyShortChannelIdsEnd *inner;
5667 * Indicates that this is the only struct which contains the same pointer.
5668 * Rust functions which take ownership of an object provided via an argument require
5669 * this to be true and invalidate the object pointed to by inner.
5672 } LDKReplyShortChannelIdsEnd;
5675 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
5677 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
5679 * A pointer to the contents in the success state.
5680 * Reading from this pointer when `result_ok` is not set is undefined.
5682 struct LDKReplyShortChannelIdsEnd *result;
5684 * A pointer to the contents in the error state.
5685 * Reading from this pointer when `result_ok` is set is undefined.
5687 struct LDKDecodeError *err;
5688 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
5691 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
5692 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
5693 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5695 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
5697 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
5698 * `err` or `result` depending on the state of `result_ok`.
5700 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
5702 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
5705 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
5708 * The contents of CResult_QueryChannelRangeDecodeErrorZ
5710 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
5712 * A pointer to the contents in the success state.
5713 * Reading from this pointer when `result_ok` is not set is undefined.
5715 struct LDKQueryChannelRange *result;
5717 * A pointer to the contents in the error state.
5718 * Reading from this pointer when `result_ok` is set is undefined.
5720 struct LDKDecodeError *err;
5721 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
5724 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
5725 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
5726 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5728 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
5730 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
5731 * `err` or `result` depending on the state of `result_ok`.
5733 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
5735 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
5738 } LDKCResult_QueryChannelRangeDecodeErrorZ;
5741 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
5743 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
5745 * A pointer to the contents in the success state.
5746 * Reading from this pointer when `result_ok` is not set is undefined.
5748 struct LDKReplyChannelRange *result;
5750 * A pointer to the contents in the error state.
5751 * Reading from this pointer when `result_ok` is set is undefined.
5753 struct LDKDecodeError *err;
5754 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
5757 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
5758 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
5759 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5761 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
5763 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
5764 * `err` or `result` depending on the state of `result_ok`.
5766 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
5768 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
5771 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
5776 * A gossip_timestamp_filter message is used by a node to request
5777 * gossip relay for messages in the requested time range when the
5778 * gossip_queries feature has been negotiated.
5780 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
5782 * A pointer to the opaque Rust object.
5783 * Nearly everywhere, inner must be non-null, however in places where
5784 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5786 LDKnativeGossipTimestampFilter *inner;
5788 * Indicates that this is the only struct which contains the same pointer.
5789 * Rust functions which take ownership of an object provided via an argument require
5790 * this to be true and invalidate the object pointed to by inner.
5793 } LDKGossipTimestampFilter;
5796 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
5798 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
5800 * A pointer to the contents in the success state.
5801 * Reading from this pointer when `result_ok` is not set is undefined.
5803 struct LDKGossipTimestampFilter *result;
5805 * A pointer to the contents in the error state.
5806 * Reading from this pointer when `result_ok` is set is undefined.
5808 struct LDKDecodeError *err;
5809 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
5812 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
5813 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
5814 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5816 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
5818 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
5819 * `err` or `result` depending on the state of `result_ok`.
5821 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
5823 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
5826 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
5829 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
5831 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
5833 * A pointer to the contents in the success state.
5834 * Reading from this pointer when `result_ok` is not set is undefined.
5836 struct LDKSpendableOutputDescriptor *result;
5838 * A pointer to the contents in the error state.
5839 * Reading from this pointer when `result_ok` is set is undefined.
5841 struct LDKDecodeError *err;
5842 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
5845 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5846 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5847 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5849 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
5851 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
5852 * `err` or `result` depending on the state of `result_ok`.
5854 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
5856 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
5859 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
5862 * The contents of CResult_SignDecodeErrorZ
5864 typedef union LDKCResult_SignDecodeErrorZPtr {
5866 * A pointer to the contents in the success state.
5867 * Reading from this pointer when `result_ok` is not set is undefined.
5869 struct LDKSign *result;
5871 * A pointer to the contents in the error state.
5872 * Reading from this pointer when `result_ok` is set is undefined.
5874 struct LDKDecodeError *err;
5875 } LDKCResult_SignDecodeErrorZPtr;
5878 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
5879 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
5880 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5882 typedef struct LDKCResult_SignDecodeErrorZ {
5884 * The contents of this CResult_SignDecodeErrorZ, accessible via either
5885 * `err` or `result` depending on the state of `result_ok`.
5887 union LDKCResult_SignDecodeErrorZPtr contents;
5889 * Whether this CResult_SignDecodeErrorZ represents a success state.
5892 } LDKCResult_SignDecodeErrorZ;
5895 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
5896 * This corresponds to std::vector in C++
5898 typedef struct LDKCVec_CVec_u8ZZ {
5900 * The elements in the array.
5901 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5903 struct LDKCVec_u8Z *data;
5905 * The number of elements pointed to by `data`.
5908 } LDKCVec_CVec_u8ZZ;
5911 * The contents of CResult_CVec_CVec_u8ZZNoneZ
5913 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
5915 * A pointer to the contents in the success state.
5916 * Reading from this pointer when `result_ok` is not set is undefined.
5918 struct LDKCVec_CVec_u8ZZ *result;
5920 * Note that this value is always NULL, as there are no contents in the Err variant
5923 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
5926 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
5927 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
5928 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5930 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
5932 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
5933 * `err` or `result` depending on the state of `result_ok`.
5935 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
5937 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
5940 } LDKCResult_CVec_CVec_u8ZZNoneZ;
5945 * A simple implementation of Sign that just keeps the private keys in memory.
5947 * This implementation performs no policy checks and is insufficient by itself as
5948 * a secure external signer.
5950 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
5952 * A pointer to the opaque Rust object.
5953 * Nearly everywhere, inner must be non-null, however in places where
5954 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5956 LDKnativeInMemorySigner *inner;
5958 * Indicates that this is the only struct which contains the same pointer.
5959 * Rust functions which take ownership of an object provided via an argument require
5960 * this to be true and invalidate the object pointed to by inner.
5963 } LDKInMemorySigner;
5966 * The contents of CResult_InMemorySignerDecodeErrorZ
5968 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
5970 * A pointer to the contents in the success state.
5971 * Reading from this pointer when `result_ok` is not set is undefined.
5973 struct LDKInMemorySigner *result;
5975 * A pointer to the contents in the error state.
5976 * Reading from this pointer when `result_ok` is set is undefined.
5978 struct LDKDecodeError *err;
5979 } LDKCResult_InMemorySignerDecodeErrorZPtr;
5982 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
5983 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
5984 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5986 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
5988 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
5989 * `err` or `result` depending on the state of `result_ok`.
5991 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
5993 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
5996 } LDKCResult_InMemorySignerDecodeErrorZ;
5999 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
6000 * This corresponds to std::vector in C++
6002 typedef struct LDKCVec_TxOutZ {
6004 * The elements in the array.
6005 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6007 struct LDKTxOut *data;
6009 * The number of elements pointed to by `data`.
6015 * The contents of CResult_TransactionNoneZ
6017 typedef union LDKCResult_TransactionNoneZPtr {
6019 * A pointer to the contents in the success state.
6020 * Reading from this pointer when `result_ok` is not set is undefined.
6022 struct LDKTransaction *result;
6024 * Note that this value is always NULL, as there are no contents in the Err variant
6027 } LDKCResult_TransactionNoneZPtr;
6030 * A CResult_TransactionNoneZ represents the result of a fallible operation,
6031 * containing a crate::c_types::Transaction on success and a () on failure.
6032 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6034 typedef struct LDKCResult_TransactionNoneZ {
6036 * The contents of this CResult_TransactionNoneZ, accessible via either
6037 * `err` or `result` depending on the state of `result_ok`.
6039 union LDKCResult_TransactionNoneZPtr contents;
6041 * Whether this CResult_TransactionNoneZ represents a success state.
6044 } LDKCResult_TransactionNoneZ;
6047 * The contents of CResult_NoneErrorZ
6049 typedef union LDKCResult_NoneErrorZPtr {
6051 * Note that this value is always NULL, as there are no contents in the OK variant
6055 * A pointer to the contents in the error state.
6056 * Reading from this pointer when `result_ok` is set is undefined.
6058 enum LDKIOError *err;
6059 } LDKCResult_NoneErrorZPtr;
6062 * A CResult_NoneErrorZ represents the result of a fallible operation,
6063 * containing a () on success and a crate::c_types::IOError on failure.
6064 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6066 typedef struct LDKCResult_NoneErrorZ {
6068 * The contents of this CResult_NoneErrorZ, accessible via either
6069 * `err` or `result` depending on the state of `result_ok`.
6071 union LDKCResult_NoneErrorZPtr contents;
6073 * Whether this CResult_NoneErrorZ represents a success state.
6076 } LDKCResult_NoneErrorZ;
6079 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
6080 * This corresponds to std::vector in C++
6082 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
6084 * The elements in the array.
6085 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6087 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
6089 * The number of elements pointed to by `data`.
6092 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
6095 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
6097 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
6099 * A pointer to the contents in the success state.
6100 * Reading from this pointer when `result_ok` is not set is undefined.
6102 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
6104 * A pointer to the contents in the error state.
6105 * Reading from this pointer when `result_ok` is set is undefined.
6107 enum LDKIOError *err;
6108 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
6111 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
6112 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
6113 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6115 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
6117 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
6118 * `err` or `result` depending on the state of `result_ok`.
6120 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
6122 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
6125 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
6128 * A Rust str object, ie a reference to a UTF8-valid string.
6129 * This is *not* null-terminated so cannot be used directly as a C string!
6131 typedef struct LDKStr {
6133 * A pointer to the string's bytes, in UTF8 encoding
6135 const uint8_t *chars;
6137 * The number of bytes (not characters!) pointed to by `chars`
6143 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
6146 typedef enum LDKAPIError_Tag {
6148 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
6149 * are documented, but generally indicates some precondition of a function was violated.
6151 LDKAPIError_APIMisuseError,
6153 * Due to a high feerate, we were unable to complete the request.
6154 * For example, this may be returned if the feerate implies we cannot open a channel at the
6155 * requested value, but opening a larger channel would succeed.
6157 LDKAPIError_FeeRateTooHigh,
6159 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
6160 * too-many-hops, etc).
6162 LDKAPIError_RouteError,
6164 * We were unable to complete the request as the Channel required to do so is unable to
6165 * complete the request (or was not found). This can take many forms, including disconnected
6166 * peer, channel at capacity, channel shutting down, etc.
6168 LDKAPIError_ChannelUnavailable,
6170 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
6171 * attempted action to fail.
6173 LDKAPIError_MonitorUpdateFailed,
6175 * Must be last for serialization purposes
6177 LDKAPIError_Sentinel,
6180 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
6182 * A human-readable error message
6184 struct LDKCVec_u8Z err;
6185 } LDKAPIError_LDKAPIMisuseError_Body;
6187 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
6189 * A human-readable error message
6191 struct LDKCVec_u8Z err;
6193 * The feerate which was too high.
6196 } LDKAPIError_LDKFeeRateTooHigh_Body;
6198 typedef struct LDKAPIError_LDKRouteError_Body {
6200 * A human-readable error message
6203 } LDKAPIError_LDKRouteError_Body;
6205 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
6207 * A human-readable error message
6209 struct LDKCVec_u8Z err;
6210 } LDKAPIError_LDKChannelUnavailable_Body;
6212 typedef struct MUST_USE_STRUCT LDKAPIError {
6213 LDKAPIError_Tag tag;
6215 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
6216 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
6217 LDKAPIError_LDKRouteError_Body route_error;
6218 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
6223 * The contents of CResult_NoneAPIErrorZ
6225 typedef union LDKCResult_NoneAPIErrorZPtr {
6227 * Note that this value is always NULL, as there are no contents in the OK variant
6231 * A pointer to the contents in the error state.
6232 * Reading from this pointer when `result_ok` is set is undefined.
6234 struct LDKAPIError *err;
6235 } LDKCResult_NoneAPIErrorZPtr;
6238 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
6239 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
6240 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6242 typedef struct LDKCResult_NoneAPIErrorZ {
6244 * The contents of this CResult_NoneAPIErrorZ, accessible via either
6245 * `err` or `result` depending on the state of `result_ok`.
6247 union LDKCResult_NoneAPIErrorZPtr contents;
6249 * Whether this CResult_NoneAPIErrorZ represents a success state.
6252 } LDKCResult_NoneAPIErrorZ;
6255 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
6256 * This corresponds to std::vector in C++
6258 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
6260 * The elements in the array.
6261 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6263 struct LDKCResult_NoneAPIErrorZ *data;
6265 * The number of elements pointed to by `data`.
6268 } LDKCVec_CResult_NoneAPIErrorZZ;
6271 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
6272 * This corresponds to std::vector in C++
6274 typedef struct LDKCVec_APIErrorZ {
6276 * The elements in the array.
6277 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6279 struct LDKAPIError *data;
6281 * The number of elements pointed to by `data`.
6284 } LDKCVec_APIErrorZ;
6287 * If a payment fails to send, it can be in one of several states. This enum is returned as the
6288 * Err() type describing which state the payment is in, see the description of individual enum
6291 typedef enum LDKPaymentSendFailure_Tag {
6293 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
6294 * send the payment at all. No channel state has been changed or messages sent to peers, and
6295 * once you've changed the parameter at error, you can freely retry the payment in full.
6297 LDKPaymentSendFailure_ParameterError,
6299 * A parameter in a single path which was passed to send_payment was invalid, preventing us
6300 * from attempting to send the payment at all. No channel state has been changed or messages
6301 * sent to peers, and once you've changed the parameter at error, you can freely retry the
6304 * The results here are ordered the same as the paths in the route object which was passed to
6307 LDKPaymentSendFailure_PathParameterError,
6309 * All paths which were attempted failed to send, with no channel state change taking place.
6310 * You can freely retry the payment in full (though you probably want to do so over different
6311 * paths than the ones selected).
6313 LDKPaymentSendFailure_AllFailedRetrySafe,
6315 * Some paths which were attempted failed to send, though possibly not all. At least some
6316 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
6317 * in over-/re-payment.
6319 * The results here are ordered the same as the paths in the route object which was passed to
6320 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
6321 * retried (though there is currently no API with which to do so).
6323 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
6324 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
6325 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
6326 * with the latest update_id.
6328 LDKPaymentSendFailure_PartialFailure,
6330 * Must be last for serialization purposes
6332 LDKPaymentSendFailure_Sentinel,
6333 } LDKPaymentSendFailure_Tag;
6335 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
6336 LDKPaymentSendFailure_Tag tag;
6339 struct LDKAPIError parameter_error;
6342 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
6345 struct LDKCVec_APIErrorZ all_failed_retry_safe;
6348 struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
6351 } LDKPaymentSendFailure;
6354 * The contents of CResult_NonePaymentSendFailureZ
6356 typedef union LDKCResult_NonePaymentSendFailureZPtr {
6358 * Note that this value is always NULL, as there are no contents in the OK variant
6362 * A pointer to the contents in the error state.
6363 * Reading from this pointer when `result_ok` is set is undefined.
6365 struct LDKPaymentSendFailure *err;
6366 } LDKCResult_NonePaymentSendFailureZPtr;
6369 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
6370 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
6371 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6373 typedef struct LDKCResult_NonePaymentSendFailureZ {
6375 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
6376 * `err` or `result` depending on the state of `result_ok`.
6378 union LDKCResult_NonePaymentSendFailureZPtr contents;
6380 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
6383 } LDKCResult_NonePaymentSendFailureZ;
6386 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
6387 * This corresponds to std::vector in C++
6389 typedef struct LDKCVec_ChannelMonitorZ {
6391 * The elements in the array.
6392 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6394 struct LDKChannelMonitor *data;
6396 * The number of elements pointed to by `data`.
6399 } LDKCVec_ChannelMonitorZ;
6402 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
6403 * blocks are connected and disconnected.
6405 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
6406 * responsible for maintaining a set of monitors such that they can be updated accordingly as
6407 * channel state changes and HTLCs are resolved. See method documentation for specific
6410 * Implementations **must** ensure that updates are successfully applied and persisted upon method
6411 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
6412 * without taking any further action such as persisting the current state.
6414 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
6415 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
6416 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
6417 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
6418 * multiple instances.
6420 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
6421 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
6422 * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
6424 typedef struct LDKWatch {
6426 * An opaque pointer which is passed to your function implementations as an argument.
6427 * This has no meaning in the LDK, and can be NULL or any other value.
6431 * Watches a channel identified by `funding_txo` using `monitor`.
6433 * Implementations are responsible for watching the chain for the funding transaction along
6434 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
6435 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
6437 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
6438 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
6439 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
6441 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
6443 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
6445 * Implementations must call [`update_monitor`] with the given update. See
6446 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
6448 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
6449 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
6451 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
6453 * Returns any monitor events since the last call. Subsequent calls must only return new
6456 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
6458 * Frees any resources associated with this object given its this_arg pointer.
6459 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6461 void (*free)(void *this_arg);
6465 * An interface to send a transaction to the Bitcoin network.
6467 typedef struct LDKBroadcasterInterface {
6469 * An opaque pointer which is passed to your function implementations as an argument.
6470 * This has no meaning in the LDK, and can be NULL or any other value.
6474 * Sends a transaction out to (hopefully) be mined.
6476 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
6478 * Frees any resources associated with this object given its this_arg pointer.
6479 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6481 void (*free)(void *this_arg);
6482 } LDKBroadcasterInterface;
6485 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
6486 * own the memory pointed to by data.
6488 typedef struct LDKu8slice {
6490 * A pointer to the byte buffer
6492 const uint8_t *data;
6494 * The number of bytes pointed to by `data`.
6500 * A trait to describe an object which can get user secrets and key material.
6502 typedef struct LDKKeysInterface {
6504 * An opaque pointer which is passed to your function implementations as an argument.
6505 * This has no meaning in the LDK, and can be NULL or any other value.
6509 * Get node secret key (aka node_id or network_key).
6511 * This method must return the same value each time it is called.
6513 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
6515 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
6517 * This method should return a different value each time it is called, to avoid linking
6518 * on-chain funds across channels as controlled to the same user.
6520 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
6522 * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
6525 * This method should return a different value each time it is called, to avoid linking
6526 * on-chain funds across channels as controlled to the same user.
6528 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
6530 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
6531 * restarted with some stale data!
6533 * This method must return a different value each time it is called.
6535 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
6537 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
6538 * onion packets and for temporary channel IDs. There is no requirement that these be
6539 * persisted anywhere, though they must be unique across restarts.
6541 * This method must return a different value each time it is called.
6543 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
6545 * Reads a `Signer` for this `KeysInterface` from the given input stream.
6546 * This is only called during deserialization of other objects which contain
6547 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
6548 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
6549 * contain no versioning scheme. You may wish to include your own version prefix and ensure
6550 * you've read all of the provided bytes to ensure no corruption occurred.
6552 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
6554 * Frees any resources associated with this object given its this_arg pointer.
6555 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6557 void (*free)(void *this_arg);
6561 * A trait which should be implemented to provide feerate information on a number of time
6564 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
6565 * called from inside the library in response to chain events, P2P events, or timer events).
6567 typedef struct LDKFeeEstimator {
6569 * An opaque pointer which is passed to your function implementations as an argument.
6570 * This has no meaning in the LDK, and can be NULL or any other value.
6574 * Gets estimated satoshis of fee required per 1000 Weight-Units.
6576 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
6577 * don't put us below 1 satoshi-per-byte).
6579 * This translates to:
6580 * * satoshis-per-byte * 250
6581 * * ceil(satoshis-per-kbyte / 4)
6583 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
6585 * Frees any resources associated with this object given its this_arg pointer.
6586 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6588 void (*free)(void *this_arg);
6592 * A trait encapsulating the operations required of a logger
6594 typedef struct LDKLogger {
6596 * An opaque pointer which is passed to your function implementations as an argument.
6597 * This has no meaning in the LDK, and can be NULL or any other value.
6603 void (*log)(const void *this_arg, const char *record);
6605 * Frees any resources associated with this object given its this_arg pointer.
6606 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6608 void (*free)(void *this_arg);
6614 * Manager which keeps track of a number of channels and sends messages to the appropriate
6615 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
6617 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
6618 * to individual Channels.
6620 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
6621 * all peers during write/read (though does not modify this instance, only the instance being
6622 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
6623 * called funding_transaction_generated for outbound channels).
6625 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
6626 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
6627 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
6628 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
6629 * the serialization process). If the deserialized version is out-of-date compared to the
6630 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
6631 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
6633 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
6634 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
6635 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
6636 * block_connected() to step towards your best block) upon deserialization before using the
6639 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
6640 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
6641 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
6642 * offline for a full minute. In order to track this, you must call
6643 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
6645 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
6646 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
6647 * essentially you should default to using a SimpleRefChannelManager, and use a
6648 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
6649 * you're using lightning-net-tokio.
6651 typedef struct MUST_USE_STRUCT LDKChannelManager {
6653 * A pointer to the opaque Rust object.
6654 * Nearly everywhere, inner must be non-null, however in places where
6655 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6657 LDKnativeChannelManager *inner;
6659 * Indicates that this is the only struct which contains the same pointer.
6660 * Rust functions which take ownership of an object provided via an argument require
6661 * this to be true and invalidate the object pointed to by inner.
6664 } LDKChannelManager;
6667 * A tuple of 2 elements. See the individual fields for the types contained.
6669 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
6671 * The element at position 0
6673 struct LDKThirtyTwoBytes a;
6675 * The element at position 1
6677 struct LDKChannelManager b;
6678 } LDKC2Tuple_BlockHashChannelManagerZ;
6681 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
6683 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
6685 * A pointer to the contents in the success state.
6686 * Reading from this pointer when `result_ok` is not set is undefined.
6688 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
6690 * A pointer to the contents in the error state.
6691 * Reading from this pointer when `result_ok` is set is undefined.
6693 struct LDKDecodeError *err;
6694 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
6697 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
6698 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
6699 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6701 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
6703 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
6704 * `err` or `result` depending on the state of `result_ok`.
6706 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
6708 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
6711 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
6714 * A trait indicating an object may generate message send events
6716 typedef struct LDKMessageSendEventsProvider {
6718 * An opaque pointer which is passed to your function implementations as an argument.
6719 * This has no meaning in the LDK, and can be NULL or any other value.
6723 * Gets the list of pending events which were generated by previous actions, clearing the list
6726 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
6728 * Frees any resources associated with this object given its this_arg pointer.
6729 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6731 void (*free)(void *this_arg);
6732 } LDKMessageSendEventsProvider;
6735 * A trait indicating an object may generate events
6737 typedef struct LDKEventsProvider {
6739 * An opaque pointer which is passed to your function implementations as an argument.
6740 * This has no meaning in the LDK, and can be NULL or any other value.
6744 * Gets the list of pending events which were generated by previous actions, clearing the list
6747 struct LDKCVec_EventZ (*get_and_clear_pending_events)(const void *this_arg);
6749 * Frees any resources associated with this object given its this_arg pointer.
6750 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6752 void (*free)(void *this_arg);
6753 } LDKEventsProvider;
6758 * Configuration we set when applicable.
6760 * Default::default() provides sane defaults.
6762 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
6764 * A pointer to the opaque Rust object.
6765 * Nearly everywhere, inner must be non-null, however in places where
6766 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6768 LDKnativeChannelHandshakeConfig *inner;
6770 * Indicates that this is the only struct which contains the same pointer.
6771 * Rust functions which take ownership of an object provided via an argument require
6772 * this to be true and invalidate the object pointed to by inner.
6775 } LDKChannelHandshakeConfig;
6780 * Optional channel limits which are applied during channel creation.
6782 * These limits are only applied to our counterparty's limits, not our own.
6784 * Use 0/<type>::max_value() as appropriate to skip checking.
6786 * Provides sane defaults for most configurations.
6788 * Most additional limits are disabled except those with which specify a default in individual
6789 * field documentation. Note that this may result in barely-usable channels, but since they
6790 * are applied mostly only to incoming channels that's not much of a problem.
6792 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
6794 * A pointer to the opaque Rust object.
6795 * Nearly everywhere, inner must be non-null, however in places where
6796 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6798 LDKnativeChannelHandshakeLimits *inner;
6800 * Indicates that this is the only struct which contains the same pointer.
6801 * Rust functions which take ownership of an object provided via an argument require
6802 * this to be true and invalidate the object pointed to by inner.
6805 } LDKChannelHandshakeLimits;
6810 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
6812 * Default::default() provides sane defaults for most configurations
6813 * (but currently with 0 relay fees!)
6815 typedef struct MUST_USE_STRUCT LDKUserConfig {
6817 * A pointer to the opaque Rust object.
6818 * Nearly everywhere, inner must be non-null, however in places where
6819 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6821 LDKnativeUserConfig *inner;
6823 * Indicates that this is the only struct which contains the same pointer.
6824 * Rust functions which take ownership of an object provided via an argument require
6825 * this to be true and invalidate the object pointed to by inner.
6831 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
6834 typedef struct LDKAccess {
6836 * An opaque pointer which is passed to your function implementations as an argument.
6837 * This has no meaning in the LDK, and can be NULL or any other value.
6841 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
6842 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
6845 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
6847 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
6849 * Frees any resources associated with this object given its this_arg pointer.
6850 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6852 void (*free)(void *this_arg);
6856 * The `Listen` trait is used to be notified of when blocks have been connected or disconnected
6859 * Useful when needing to replay chain data upon startup or as new chain events occur.
6861 typedef struct LDKListen {
6863 * An opaque pointer which is passed to your function implementations as an argument.
6864 * This has no meaning in the LDK, and can be NULL or any other value.
6868 * Notifies the listener that a block was added at the given height.
6870 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
6872 * Notifies the listener that a block was removed at the given height.
6874 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
6876 * Frees any resources associated with this object given its this_arg pointer.
6877 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6879 void (*free)(void *this_arg);
6885 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
6887 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
6888 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
6889 * the return value of [`Filter::register_output`].
6891 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
6892 * may have been spent there. See [`Filter::register_output`] for details.
6894 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
6895 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
6897 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
6899 * A pointer to the opaque Rust object.
6900 * Nearly everywhere, inner must be non-null, however in places where
6901 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6903 LDKnativeWatchedOutput *inner;
6905 * Indicates that this is the only struct which contains the same pointer.
6906 * Rust functions which take ownership of an object provided via an argument require
6907 * this to be true and invalidate the object pointed to by inner.
6913 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
6916 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
6917 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
6918 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
6919 * receiving full blocks from a chain source, any further filtering is unnecessary.
6921 * After an output has been registered, subsequent block retrievals from the chain source must not
6922 * exclude any transactions matching the new criteria nor any in-block descendants of such
6925 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
6926 * should not block on I/O. Implementations should instead queue the newly monitored data to be
6927 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
6928 * invocation that has called the `Filter` must return [`TemporaryFailure`].
6930 * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
6931 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
6932 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
6934 typedef struct LDKFilter {
6936 * An opaque pointer which is passed to your function implementations as an argument.
6937 * This has no meaning in the LDK, and can be NULL or any other value.
6941 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
6942 * a spending condition.
6944 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
6946 * Registers interest in spends of a transaction output.
6948 * Optionally, when `output.block_hash` is set, should return any transaction spending the
6949 * output that is found in the corresponding block along with its index.
6951 * This return value is useful for Electrum clients in order to supply in-block descendant
6952 * transactions which otherwise were not included. This is not necessary for other clients if
6953 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
6956 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
6958 * Frees any resources associated with this object given its this_arg pointer.
6959 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6961 void (*free)(void *this_arg);
6965 * `Persist` defines behavior for persisting channel monitors: this could mean
6966 * writing once to disk, and/or uploading to one or more backup services.
6968 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
6969 * to disk/backups. And, on every update, you **must** persist either the
6970 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
6971 * of situations such as revoking a transaction, then crashing before this
6972 * revocation can be persisted, then unintentionally broadcasting a revoked
6973 * transaction and losing money. This is a risk because previous channel states
6974 * are toxic, so it's important that whatever channel state is persisted is
6977 typedef struct LDKPersist {
6979 * An opaque pointer which is passed to your function implementations as an argument.
6980 * This has no meaning in the LDK, and can be NULL or any other value.
6984 * Persist a new channel's data. The data can be stored any way you want, but
6985 * the identifier provided by Rust-Lightning is the channel's outpoint (and
6986 * it is up to you to maintain a correct mapping between the outpoint and the
6987 * stored channel data). Note that you **must** persist every new monitor to
6988 * disk. See the `Persist` trait documentation for more details.
6990 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
6991 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
6993 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
6995 * Update one channel's data. The provided `ChannelMonitor` has already
6996 * applied the given update.
6998 * Note that on every update, you **must** persist either the
6999 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
7000 * the `Persist` trait documentation for more details.
7002 * If an implementer chooses to persist the updates only, they need to make
7003 * sure that all the updates are applied to the `ChannelMonitors` *before*
7004 * the set of channel monitors is given to the `ChannelManager`
7005 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
7006 * applying a monitor update to a monitor. If full `ChannelMonitors` are
7007 * persisted, then there is no need to persist individual updates.
7009 * Note that there could be a performance tradeoff between persisting complete
7010 * channel monitors on every update vs. persisting only updates and applying
7011 * them in batches. The size of each monitor grows `O(number of state updates)`
7012 * whereas updates are small and `O(1)`.
7014 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
7015 * [`ChannelMonitorUpdate::write`] for writing out an update, and
7016 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
7018 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data);
7020 * Frees any resources associated with this object given its this_arg pointer.
7021 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7023 void (*free)(void *this_arg);
7029 * An implementation of [`chain::Watch`] for monitoring channels.
7031 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
7032 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
7033 * or used independently to monitor channels remotely. See the [module-level documentation] for
7036 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
7037 * [module-level documentation]: crate::chain::chainmonitor
7039 typedef struct MUST_USE_STRUCT LDKChainMonitor {
7041 * A pointer to the opaque Rust object.
7042 * Nearly everywhere, inner must be non-null, however in places where
7043 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7045 LDKnativeChainMonitor *inner;
7047 * Indicates that this is the only struct which contains the same pointer.
7048 * Rust functions which take ownership of an object provided via an argument require
7049 * this to be true and invalidate the object pointed to by inner.
7057 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
7058 * and derives keys from that.
7060 * Your node_id is seed/0'
7061 * ChannelMonitor closes may use seed/1'
7062 * Cooperative closes may use seed/2'
7063 * The two close keys may be needed to claim on-chain funds!
7065 typedef struct MUST_USE_STRUCT LDKKeysManager {
7067 * A pointer to the opaque Rust object.
7068 * Nearly everywhere, inner must be non-null, however in places where
7069 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7071 LDKnativeKeysManager *inner;
7073 * Indicates that this is the only struct which contains the same pointer.
7074 * Rust functions which take ownership of an object provided via an argument require
7075 * this to be true and invalidate the object pointed to by inner.
7083 * Chain-related parameters used to construct a new `ChannelManager`.
7085 * Typically, the block-specific parameters are derived from the best block hash for the network,
7086 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
7087 * are not needed when deserializing a previously constructed `ChannelManager`.
7089 typedef struct MUST_USE_STRUCT LDKChainParameters {
7091 * A pointer to the opaque Rust object.
7092 * Nearly everywhere, inner must be non-null, however in places where
7093 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7095 LDKnativeChainParameters *inner;
7097 * Indicates that this is the only struct which contains the same pointer.
7098 * Rust functions which take ownership of an object provided via an argument require
7099 * this to be true and invalidate the object pointed to by inner.
7102 } LDKChainParameters;
7107 * The best known block as identified by its hash and height.
7109 typedef struct MUST_USE_STRUCT LDKBestBlock {
7111 * A pointer to the opaque Rust object.
7112 * Nearly everywhere, inner must be non-null, however in places where
7113 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7115 LDKnativeBestBlock *inner;
7117 * Indicates that this is the only struct which contains the same pointer.
7118 * Rust functions which take ownership of an object provided via an argument require
7119 * this to be true and invalidate the object pointed to by inner.
7125 * A 3-byte byte array.
7127 typedef struct LDKThreeBytes {
7135 * A trait to describe an object which can receive channel messages.
7137 * Messages MAY be called in parallel when they originate from different their_node_ids, however
7138 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
7140 typedef struct LDKChannelMessageHandler {
7142 * An opaque pointer which is passed to your function implementations as an argument.
7143 * This has no meaning in the LDK, and can be NULL or any other value.
7147 * Handle an incoming open_channel message from the given peer.
7149 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
7151 * Handle an incoming accept_channel message from the given peer.
7153 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
7155 * Handle an incoming funding_created message from the given peer.
7157 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
7159 * Handle an incoming funding_signed message from the given peer.
7161 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
7163 * Handle an incoming funding_locked message from the given peer.
7165 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
7167 * Handle an incoming shutdown message from the given peer.
7169 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);
7171 * Handle an incoming closing_signed message from the given peer.
7173 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
7175 * Handle an incoming update_add_htlc message from the given peer.
7177 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
7179 * Handle an incoming update_fulfill_htlc message from the given peer.
7181 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
7183 * Handle an incoming update_fail_htlc message from the given peer.
7185 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
7187 * Handle an incoming update_fail_malformed_htlc message from the given peer.
7189 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
7191 * Handle an incoming commitment_signed message from the given peer.
7193 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
7195 * Handle an incoming revoke_and_ack message from the given peer.
7197 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
7199 * Handle an incoming update_fee message from the given peer.
7201 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
7203 * Handle an incoming announcement_signatures message from the given peer.
7205 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
7207 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
7208 * is believed to be possible in the future (eg they're sending us messages we don't
7209 * understand or indicate they require unknown feature bits), no_connection_possible is set
7210 * and any outstanding channels should be failed.
7212 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
7214 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
7216 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
7218 * Handle an incoming channel_reestablish message from the given peer.
7220 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
7222 * Handle an incoming channel update from the given peer.
7224 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
7226 * Handle an incoming error message from the given peer.
7228 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
7230 * Implementation of MessageSendEventsProvider for this object.
7232 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
7234 * Frees any resources associated with this object given its this_arg pointer.
7235 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7237 void (*free)(void *this_arg);
7238 } LDKChannelMessageHandler;
7243 * Arguments for the creation of a ChannelManager that are not deserialized.
7245 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
7247 * 1) Deserialize all stored ChannelMonitors.
7248 * 2) Deserialize the ChannelManager by filling in this struct and calling:
7249 * <(BlockHash, ChannelManager)>::read(reader, args)
7250 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
7251 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
7252 * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
7253 * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
7254 * ChannelMonitor::get_funding_txo().
7255 * 4) Reconnect blocks on your ChannelMonitors.
7256 * 5) Disconnect/connect blocks on the ChannelManager.
7257 * 6) Move the ChannelMonitors into your local chain::Watch.
7259 * Note that the ordering of #4-6 is not of importance, however all three must occur before you
7260 * call any other methods on the newly-deserialized ChannelManager.
7262 * Note that because some channels may be closed during deserialization, it is critical that you
7263 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
7264 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
7265 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
7266 * not force-close the same channels but consider them live), you may end up revoking a state for
7267 * which you've already broadcasted the transaction.
7269 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
7271 * A pointer to the opaque Rust object.
7272 * Nearly everywhere, inner must be non-null, however in places where
7273 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7275 LDKnativeChannelManagerReadArgs *inner;
7277 * Indicates that this is the only struct which contains the same pointer.
7278 * Rust functions which take ownership of an object provided via an argument require
7279 * this to be true and invalidate the object pointed to by inner.
7282 } LDKChannelManagerReadArgs;
7287 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
7288 * This is used to convince the recipient that the channel is at a certain commitment
7289 * number even if they lost that data due to a local failure. Of course, the peer may lie
7290 * and even later commitments may have been revoked.
7292 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
7294 * A pointer to the opaque Rust object.
7295 * Nearly everywhere, inner must be non-null, however in places where
7296 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7298 LDKnativeDataLossProtect *inner;
7300 * Indicates that this is the only struct which contains the same pointer.
7301 * Rust functions which take ownership of an object provided via an argument require
7302 * this to be true and invalidate the object pointed to by inner.
7305 } LDKDataLossProtect;
7308 * A trait to describe an object which can receive routing messages.
7310 * # Implementor DoS Warnings
7312 * For `gossip_queries` messages there are potential DoS vectors when handling
7313 * inbound queries. Implementors using an on-disk network graph should be aware of
7314 * repeated disk I/O for queries accessing different parts of the network graph.
7316 typedef struct LDKRoutingMessageHandler {
7318 * An opaque pointer which is passed to your function implementations as an argument.
7319 * This has no meaning in the LDK, and can be NULL or any other value.
7323 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
7324 * false or returning an Err otherwise.
7326 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
7328 * Handle a channel_announcement message, returning true if it should be forwarded on, false
7329 * or returning an Err otherwise.
7331 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
7333 * Handle an incoming channel_update message, returning true if it should be forwarded on,
7334 * false or returning an Err otherwise.
7336 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
7338 * Handle some updates to the route graph that we learned due to an outbound failed payment.
7340 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
7342 * Gets a subset of the channel announcements and updates required to dump our routing table
7343 * to a remote node, starting at the short_channel_id indicated by starting_point and
7344 * including the batch_amount entries immediately higher in numerical value than starting_point.
7346 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
7348 * Gets a subset of the node announcements required to dump our routing table to a remote node,
7349 * starting at the node *after* the provided publickey and including batch_amount entries
7350 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
7351 * If None is provided for starting_point, we start at the first node.
7353 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
7355 * Called when a connection is established with a peer. This can be used to
7356 * perform routing table synchronization using a strategy defined by the
7359 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
7361 * Handles the reply of a query we initiated to learn about channels
7362 * for a given range of blocks. We can expect to receive one or more
7363 * replies to a single query.
7365 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
7367 * Handles the reply of a query we initiated asking for routing gossip
7368 * messages for a list of channels. We should receive this message when
7369 * a node has completed its best effort to send us the pertaining routing
7372 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
7374 * Handles when a peer asks us to send a list of short_channel_ids
7375 * for the requested range of blocks.
7377 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
7379 * Handles when a peer asks us to send routing gossip messages for a
7380 * list of short_channel_ids.
7382 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
7384 * Implementation of MessageSendEventsProvider for this object.
7386 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
7388 * Frees any resources associated with this object given its this_arg pointer.
7389 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7391 void (*free)(void *this_arg);
7392 } LDKRoutingMessageHandler;
7397 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
7398 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
7400 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
7402 * A pointer to the opaque Rust object.
7403 * Nearly everywhere, inner must be non-null, however in places where
7404 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7406 LDKnativeIgnoringMessageHandler *inner;
7408 * Indicates that this is the only struct which contains the same pointer.
7409 * Rust functions which take ownership of an object provided via an argument require
7410 * this to be true and invalidate the object pointed to by inner.
7413 } LDKIgnoringMessageHandler;
7418 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
7419 * You can provide one of these as the route_handler in a MessageHandler.
7421 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
7423 * A pointer to the opaque Rust object.
7424 * Nearly everywhere, inner must be non-null, however in places where
7425 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7427 LDKnativeErroringMessageHandler *inner;
7429 * Indicates that this is the only struct which contains the same pointer.
7430 * Rust functions which take ownership of an object provided via an argument require
7431 * this to be true and invalidate the object pointed to by inner.
7434 } LDKErroringMessageHandler;
7439 * Provides references to trait impls which handle different types of messages.
7441 typedef struct MUST_USE_STRUCT LDKMessageHandler {
7443 * A pointer to the opaque Rust object.
7444 * Nearly everywhere, inner must be non-null, however in places where
7445 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7447 LDKnativeMessageHandler *inner;
7449 * Indicates that this is the only struct which contains the same pointer.
7450 * Rust functions which take ownership of an object provided via an argument require
7451 * this to be true and invalidate the object pointed to by inner.
7454 } LDKMessageHandler;
7457 * Provides an object which can be used to send data to and which uniquely identifies a connection
7458 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
7459 * implement Hash to meet the PeerManager API.
7461 * For efficiency, Clone should be relatively cheap for this type.
7463 * You probably want to just extend an int and put a file descriptor in a struct and implement
7464 * send_data. Note that if you are using a higher-level net library that may call close() itself,
7465 * be careful to ensure you don't have races whereby you might register a new connection with an
7466 * fd which is the same as a previous one which has yet to be removed via
7467 * PeerManager::socket_disconnected().
7469 typedef struct LDKSocketDescriptor {
7471 * An opaque pointer which is passed to your function implementations as an argument.
7472 * This has no meaning in the LDK, and can be NULL or any other value.
7476 * Attempts to send some data from the given slice to the peer.
7478 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
7479 * Note that in the disconnected case, socket_disconnected must still fire and further write
7480 * attempts may occur until that time.
7482 * If the returned size is smaller than data.len(), a write_available event must
7483 * trigger the next time more data can be written. Additionally, until the a send_data event
7484 * completes fully, no further read_events should trigger on the same peer!
7486 * If a read_event on this descriptor had previously returned true (indicating that read
7487 * events should be paused to prevent DoS in the send buffer), resume_read may be set
7488 * indicating that read events on this descriptor should resume. A resume_read of false does
7489 * *not* imply that further read events should be paused.
7491 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
7493 * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no
7494 * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with
7495 * this descriptor. No socket_disconnected call should be generated as a result of this call,
7496 * though races may occur whereby disconnect_socket is called after a call to
7497 * socket_disconnected but prior to socket_disconnected returning.
7499 void (*disconnect_socket)(void *this_arg);
7501 * Checks if two objects are equal given this object's this_arg pointer and another object.
7503 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
7505 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
7506 * This is used, for example, for inclusion of this object in a hash map.
7508 uint64_t (*hash)(const void *this_arg);
7510 * Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
7511 * Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
7512 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
7514 void *(*clone)(const void *this_arg);
7516 * Frees any resources associated with this object given its this_arg pointer.
7517 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7519 void (*free)(void *this_arg);
7520 } LDKSocketDescriptor;
7525 * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket
7526 * events into messages which it passes on to its MessageHandlers.
7528 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
7529 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
7530 * essentially you should default to using a SimpleRefPeerManager, and use a
7531 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
7532 * you're using lightning-net-tokio.
7534 typedef struct MUST_USE_STRUCT LDKPeerManager {
7536 * A pointer to the opaque Rust object.
7537 * Nearly everywhere, inner must be non-null, however in places where
7538 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7540 LDKnativePeerManager *inner;
7542 * Indicates that this is the only struct which contains the same pointer.
7543 * Rust functions which take ownership of an object provided via an argument require
7544 * this to be true and invalidate the object pointed to by inner.
7552 * Static channel fields used to build transactions given per-commitment fields, organized by
7553 * broadcaster/countersignatory.
7555 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
7556 * as_holder_broadcastable and as_counterparty_broadcastable functions.
7558 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
7560 * A pointer to the opaque Rust object.
7561 * Nearly everywhere, inner must be non-null, however in places where
7562 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7564 LDKnativeDirectedChannelTransactionParameters *inner;
7566 * Indicates that this is the only struct which contains the same pointer.
7567 * Rust functions which take ownership of an object provided via an argument require
7568 * this to be true and invalidate the object pointed to by inner.
7571 } LDKDirectedChannelTransactionParameters;
7576 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
7577 * This exists only to make accessing a RwLock<NetworkGraph> possible from
7578 * the C bindings, as it can be done directly in Rust code.
7580 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
7582 * A pointer to the opaque Rust object.
7583 * Nearly everywhere, inner must be non-null, however in places where
7584 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7586 LDKnativeLockedNetworkGraph *inner;
7588 * Indicates that this is the only struct which contains the same pointer.
7589 * Rust functions which take ownership of an object provided via an argument require
7590 * this to be true and invalidate the object pointed to by inner.
7593 } LDKLockedNetworkGraph;
7598 * Receives and validates network updates from peers,
7599 * stores authentic and relevant data as a network graph.
7600 * This network graph is then used for routing payments.
7601 * Provides interface to help with initial routing sync by
7602 * serving historical announcements.
7604 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
7606 * A pointer to the opaque Rust object.
7607 * Nearly everywhere, inner must be non-null, however in places where
7608 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7610 LDKnativeNetGraphMsgHandler *inner;
7612 * Indicates that this is the only struct which contains the same pointer.
7613 * Rust functions which take ownership of an object provided via an argument require
7614 * this to be true and invalidate the object pointed to by inner.
7617 } LDKNetGraphMsgHandler;
7622 * FilesystemPersister persists channel data on disk, where each channel's
7623 * data is stored in a file named after its funding outpoint.
7625 * Warning: this module does the best it can with calls to persist data, but it
7626 * can only guarantee that the data is passed to the drive. It is up to the
7627 * drive manufacturers to do the actual persistence properly, which they often
7628 * don't (especially on consumer-grade hardware). Therefore, it is up to the
7629 * user to validate their entire storage stack, to ensure the writes are
7631 * Corollary: especially when dealing with larger amounts of money, it is best
7632 * practice to have multiple channel data backups and not rely only on one
7633 * FilesystemPersister.
7635 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
7637 * A pointer to the opaque Rust object.
7638 * Nearly everywhere, inner must be non-null, however in places where
7639 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7641 LDKnativeFilesystemPersister *inner;
7643 * Indicates that this is the only struct which contains the same pointer.
7644 * Rust functions which take ownership of an object provided via an argument require
7645 * this to be true and invalidate the object pointed to by inner.
7648 } LDKFilesystemPersister;
7650 extern const uintptr_t MAX_BUF_SIZE;
7652 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
7654 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
7656 extern const uint16_t BREAKDOWN_TIMEOUT;
7658 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
7660 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
7663 * Frees the data buffer, if data_is_owned is set and datalen > 0.
7665 void Transaction_free(struct LDKTransaction _res);
7668 * Frees the data pointed to by script_pubkey.
7670 void TxOut_free(struct LDKTxOut _res);
7673 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
7675 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
7678 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
7680 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
7683 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
7685 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
7688 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
7690 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
7693 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
7694 * but with all dynamically-allocated buffers duplicated in new buffers.
7696 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
7699 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
7701 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
7704 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
7706 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
7709 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
7711 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
7714 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
7715 * but with all dynamically-allocated buffers duplicated in new buffers.
7717 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
7720 * Creates a new CResult_SecretKeyErrorZ in the success state.
7722 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
7725 * Creates a new CResult_SecretKeyErrorZ in the error state.
7727 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
7730 * Frees any resources used by the CResult_SecretKeyErrorZ.
7732 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
7735 * Creates a new CResult_PublicKeyErrorZ in the success state.
7737 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
7740 * Creates a new CResult_PublicKeyErrorZ in the error state.
7742 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
7745 * Frees any resources used by the CResult_PublicKeyErrorZ.
7747 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
7750 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
7752 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
7755 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
7757 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
7760 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
7762 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
7765 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
7766 * but with all dynamically-allocated buffers duplicated in new buffers.
7768 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
7771 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
7773 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
7776 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
7778 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
7781 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
7783 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
7786 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
7787 * but with all dynamically-allocated buffers duplicated in new buffers.
7789 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
7792 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
7794 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
7797 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
7799 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
7802 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
7804 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
7807 * Constructs a new COption_u32Z containing a u32
7809 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
7812 * Constructs a new COption_u32Z containing nothing
7814 struct LDKCOption_u32Z COption_u32Z_none(void);
7817 * Frees any resources associated with the u32, if we are in the Some state
7819 void COption_u32Z_free(struct LDKCOption_u32Z _res);
7822 * Creates a new COption_u32Z which has the same data as `orig`
7823 * but with all dynamically-allocated buffers duplicated in new buffers.
7825 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
7828 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
7830 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
7833 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
7835 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
7838 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
7840 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
7843 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
7844 * but with all dynamically-allocated buffers duplicated in new buffers.
7846 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
7849 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
7851 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
7854 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
7856 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
7859 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
7861 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
7864 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
7865 * but with all dynamically-allocated buffers duplicated in new buffers.
7867 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
7870 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
7872 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
7875 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
7877 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
7880 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
7882 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
7885 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
7886 * but with all dynamically-allocated buffers duplicated in new buffers.
7888 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
7891 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7893 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
7896 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
7898 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
7901 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
7903 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
7906 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
7908 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
7911 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
7912 * but with all dynamically-allocated buffers duplicated in new buffers.
7914 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
7917 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
7919 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
7922 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
7924 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
7927 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
7929 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
7932 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
7933 * but with all dynamically-allocated buffers duplicated in new buffers.
7935 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
7938 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
7940 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
7943 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
7945 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
7948 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
7950 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
7953 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
7954 * but with all dynamically-allocated buffers duplicated in new buffers.
7956 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
7959 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
7961 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
7964 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
7966 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
7969 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
7971 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
7974 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
7976 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
7979 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
7981 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
7984 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
7986 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
7989 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
7990 * but with all dynamically-allocated buffers duplicated in new buffers.
7992 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
7995 * Creates a new CResult_StringErrorZ in the success state.
7997 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKCVec_u8Z o);
8000 * Creates a new CResult_StringErrorZ in the error state.
8002 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
8005 * Frees any resources used by the CResult_StringErrorZ.
8007 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
8010 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
8012 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
8015 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
8017 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
8020 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
8022 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
8025 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
8026 * but with all dynamically-allocated buffers duplicated in new buffers.
8028 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
8031 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
8033 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
8036 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
8038 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
8041 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
8043 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
8046 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
8047 * but with all dynamically-allocated buffers duplicated in new buffers.
8049 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
8052 * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
8054 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
8057 * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
8059 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
8062 * Frees any resources used by the CResult_NoneMonitorUpdateErrorZ.
8064 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
8067 * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
8068 * but with all dynamically-allocated buffers duplicated in new buffers.
8070 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
8073 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
8075 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
8078 * Frees any resources used by the C2Tuple_OutPointScriptZ.
8080 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
8083 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
8085 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
8088 * Frees any resources used by the C2Tuple_u32ScriptZ.
8090 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
8093 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8095 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
8098 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
8100 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
8103 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
8105 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
8108 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8110 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
8113 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8115 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
8118 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8120 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
8123 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8125 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
8128 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
8130 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
8133 * Frees any resources used by the C2Tuple_usizeTransactionZ.
8135 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
8138 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8140 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
8143 * Creates a new tuple which has the same data as `orig`
8144 * but with all dynamically-allocated buffers duplicated in new buffers.
8146 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
8149 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
8151 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
8154 * Frees any resources used by the C2Tuple_u32TxOutZ.
8156 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
8159 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8161 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
8164 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
8166 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
8169 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
8171 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
8174 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8176 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
8179 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8181 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
8184 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
8186 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
8189 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
8191 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
8194 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
8196 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
8199 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
8200 * but with all dynamically-allocated buffers duplicated in new buffers.
8202 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
8205 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
8207 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
8210 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
8212 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
8215 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
8217 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
8220 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
8222 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
8225 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
8227 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
8230 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8232 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
8235 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8237 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
8240 * Creates a new CResult_RouteDecodeErrorZ in the success state.
8242 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
8245 * Creates a new CResult_RouteDecodeErrorZ in the error state.
8247 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
8250 * Frees any resources used by the CResult_RouteDecodeErrorZ.
8252 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
8255 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
8256 * but with all dynamically-allocated buffers duplicated in new buffers.
8258 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
8261 * Constructs a new COption_u64Z containing a u64
8263 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
8266 * Constructs a new COption_u64Z containing nothing
8268 struct LDKCOption_u64Z COption_u64Z_none(void);
8271 * Frees any resources associated with the u64, if we are in the Some state
8273 void COption_u64Z_free(struct LDKCOption_u64Z _res);
8276 * Creates a new COption_u64Z which has the same data as `orig`
8277 * but with all dynamically-allocated buffers duplicated in new buffers.
8279 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
8282 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8284 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
8287 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8289 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
8292 * Creates a new CResult_RouteLightningErrorZ in the success state.
8294 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
8297 * Creates a new CResult_RouteLightningErrorZ in the error state.
8299 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
8302 * Frees any resources used by the CResult_RouteLightningErrorZ.
8304 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
8307 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
8308 * but with all dynamically-allocated buffers duplicated in new buffers.
8310 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
8313 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8315 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
8318 * Creates a new CResult_boolLightningErrorZ in the success state.
8320 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
8323 * Creates a new CResult_boolLightningErrorZ in the error state.
8325 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
8328 * Frees any resources used by the CResult_boolLightningErrorZ.
8330 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
8333 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
8334 * but with all dynamically-allocated buffers duplicated in new buffers.
8336 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
8339 * Creates a new tuple which has the same data as `orig`
8340 * but with all dynamically-allocated buffers duplicated in new buffers.
8342 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
8345 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
8347 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
8350 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
8352 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
8355 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8357 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
8360 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8362 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
8365 * Creates a new CResult_NoneLightningErrorZ in the success state.
8367 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
8370 * Creates a new CResult_NoneLightningErrorZ in the error state.
8372 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
8375 * Frees any resources used by the CResult_NoneLightningErrorZ.
8377 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
8380 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
8381 * but with all dynamically-allocated buffers duplicated in new buffers.
8383 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
8386 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8388 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
8391 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8393 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
8396 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
8398 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
8401 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
8403 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
8406 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
8408 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
8411 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
8412 * but with all dynamically-allocated buffers duplicated in new buffers.
8414 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
8417 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
8419 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
8422 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
8424 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
8427 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
8429 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
8432 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
8433 * but with all dynamically-allocated buffers duplicated in new buffers.
8435 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
8438 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
8440 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
8443 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
8445 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
8448 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
8450 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
8453 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
8454 * but with all dynamically-allocated buffers duplicated in new buffers.
8456 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
8459 * Creates a new CResult_TxOutAccessErrorZ in the success state.
8461 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
8464 * Creates a new CResult_TxOutAccessErrorZ in the error state.
8466 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
8469 * Frees any resources used by the CResult_TxOutAccessErrorZ.
8471 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
8474 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
8475 * but with all dynamically-allocated buffers duplicated in new buffers.
8477 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
8480 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
8482 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
8485 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
8487 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
8490 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
8492 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
8495 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8497 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
8500 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
8502 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
8505 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
8507 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
8510 * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
8512 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
8515 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
8516 * but with all dynamically-allocated buffers duplicated in new buffers.
8518 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
8521 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
8523 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
8526 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
8528 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
8531 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
8533 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
8536 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
8537 * but with all dynamically-allocated buffers duplicated in new buffers.
8539 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
8542 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
8544 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
8547 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
8549 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
8552 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
8554 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
8557 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
8558 * but with all dynamically-allocated buffers duplicated in new buffers.
8560 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
8563 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8565 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
8568 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
8570 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
8573 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
8575 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
8578 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
8580 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
8583 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
8584 * but with all dynamically-allocated buffers duplicated in new buffers.
8586 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
8589 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8591 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
8594 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
8596 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
8599 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
8601 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
8604 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
8606 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
8609 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
8610 * but with all dynamically-allocated buffers duplicated in new buffers.
8612 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
8615 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
8617 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
8620 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
8622 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
8625 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
8627 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
8630 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
8631 * but with all dynamically-allocated buffers duplicated in new buffers.
8633 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
8636 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
8638 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
8641 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
8643 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8646 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
8648 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
8651 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
8653 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
8656 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
8658 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8661 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
8663 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
8666 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
8668 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
8671 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
8673 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8676 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
8678 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
8681 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
8683 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
8686 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
8688 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8691 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
8693 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
8696 * Creates a new CResult_NetAddressu8Z in the success state.
8698 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
8701 * Creates a new CResult_NetAddressu8Z in the error state.
8703 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
8706 * Frees any resources used by the CResult_NetAddressu8Z.
8708 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
8711 * Creates a new CResult_NetAddressu8Z which has the same data as `orig`
8712 * but with all dynamically-allocated buffers duplicated in new buffers.
8714 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
8717 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state.
8719 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
8722 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state.
8724 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
8727 * Frees any resources used by the CResult_CResult_NetAddressu8ZDecodeErrorZ.
8729 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
8732 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig`
8733 * but with all dynamically-allocated buffers duplicated in new buffers.
8735 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
8738 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8740 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
8743 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8745 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
8748 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8750 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
8753 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8755 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
8758 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
8760 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
8763 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
8765 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
8768 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
8770 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
8773 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
8774 * but with all dynamically-allocated buffers duplicated in new buffers.
8776 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
8779 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
8781 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
8784 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
8786 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
8789 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
8791 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
8794 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
8795 * but with all dynamically-allocated buffers duplicated in new buffers.
8797 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
8800 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
8802 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
8805 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
8807 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
8810 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
8812 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
8815 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
8816 * but with all dynamically-allocated buffers duplicated in new buffers.
8818 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
8821 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
8823 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
8826 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
8828 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
8831 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
8833 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
8836 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
8837 * but with all dynamically-allocated buffers duplicated in new buffers.
8839 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
8842 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
8844 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
8847 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
8849 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
8852 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
8854 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
8857 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
8858 * but with all dynamically-allocated buffers duplicated in new buffers.
8860 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
8863 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
8865 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
8868 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
8870 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
8873 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
8875 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
8878 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
8879 * but with all dynamically-allocated buffers duplicated in new buffers.
8881 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
8884 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
8886 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
8889 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
8891 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
8894 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
8896 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
8899 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
8900 * but with all dynamically-allocated buffers duplicated in new buffers.
8902 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
8905 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
8907 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
8910 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
8912 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
8915 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
8917 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
8920 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
8921 * but with all dynamically-allocated buffers duplicated in new buffers.
8923 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
8926 * Creates a new CResult_InitDecodeErrorZ in the success state.
8928 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
8931 * Creates a new CResult_InitDecodeErrorZ in the error state.
8933 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
8936 * Frees any resources used by the CResult_InitDecodeErrorZ.
8938 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
8941 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
8942 * but with all dynamically-allocated buffers duplicated in new buffers.
8944 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
8947 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
8949 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
8952 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
8954 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
8957 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
8959 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
8962 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
8963 * but with all dynamically-allocated buffers duplicated in new buffers.
8965 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
8968 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
8970 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
8973 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
8975 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
8978 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
8980 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
8983 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
8984 * but with all dynamically-allocated buffers duplicated in new buffers.
8986 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
8989 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
8991 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
8994 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
8996 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
8999 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
9001 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
9004 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
9005 * but with all dynamically-allocated buffers duplicated in new buffers.
9007 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
9010 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
9012 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
9015 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
9017 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
9020 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
9022 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
9025 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
9026 * but with all dynamically-allocated buffers duplicated in new buffers.
9028 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
9031 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
9033 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
9036 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
9038 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
9041 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
9043 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
9046 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
9047 * but with all dynamically-allocated buffers duplicated in new buffers.
9049 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
9052 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
9054 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
9057 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
9059 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
9062 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
9064 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
9067 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
9068 * but with all dynamically-allocated buffers duplicated in new buffers.
9070 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
9073 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
9075 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
9078 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
9080 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
9083 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
9085 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
9088 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
9089 * but with all dynamically-allocated buffers duplicated in new buffers.
9091 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
9094 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
9096 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
9099 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
9101 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
9104 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
9106 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
9109 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
9110 * but with all dynamically-allocated buffers duplicated in new buffers.
9112 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
9115 * Creates a new CResult_PingDecodeErrorZ in the success state.
9117 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
9120 * Creates a new CResult_PingDecodeErrorZ in the error state.
9122 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
9125 * Frees any resources used by the CResult_PingDecodeErrorZ.
9127 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
9130 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
9131 * but with all dynamically-allocated buffers duplicated in new buffers.
9133 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
9136 * Creates a new CResult_PongDecodeErrorZ in the success state.
9138 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
9141 * Creates a new CResult_PongDecodeErrorZ in the error state.
9143 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
9146 * Frees any resources used by the CResult_PongDecodeErrorZ.
9148 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
9151 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
9152 * but with all dynamically-allocated buffers duplicated in new buffers.
9154 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
9157 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
9159 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
9162 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
9164 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9167 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
9169 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
9172 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
9173 * but with all dynamically-allocated buffers duplicated in new buffers.
9175 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9178 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
9180 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
9183 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
9185 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9188 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
9190 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
9193 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
9194 * but with all dynamically-allocated buffers duplicated in new buffers.
9196 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9199 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
9201 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
9204 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
9206 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9209 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
9211 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
9214 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
9215 * but with all dynamically-allocated buffers duplicated in new buffers.
9217 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
9220 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
9222 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
9225 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
9227 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9230 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
9232 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
9235 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
9236 * but with all dynamically-allocated buffers duplicated in new buffers.
9238 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
9241 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
9243 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
9246 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
9248 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
9251 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
9253 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
9256 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
9257 * but with all dynamically-allocated buffers duplicated in new buffers.
9259 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
9262 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
9264 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
9267 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
9269 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9272 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
9274 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
9277 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
9278 * but with all dynamically-allocated buffers duplicated in new buffers.
9280 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9283 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
9285 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
9288 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
9290 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9293 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
9295 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
9298 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
9299 * but with all dynamically-allocated buffers duplicated in new buffers.
9301 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9304 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
9306 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
9309 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
9311 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
9314 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
9316 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
9319 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
9320 * but with all dynamically-allocated buffers duplicated in new buffers.
9322 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
9325 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
9327 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
9330 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
9332 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
9335 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
9337 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
9340 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
9341 * but with all dynamically-allocated buffers duplicated in new buffers.
9343 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
9346 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
9348 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
9351 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
9353 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
9356 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
9358 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
9361 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
9362 * but with all dynamically-allocated buffers duplicated in new buffers.
9364 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
9367 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
9369 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
9372 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
9374 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
9377 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
9379 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
9382 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
9383 * but with all dynamically-allocated buffers duplicated in new buffers.
9385 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
9388 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
9390 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
9393 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
9395 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
9398 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
9400 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
9403 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
9404 * but with all dynamically-allocated buffers duplicated in new buffers.
9406 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
9409 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
9411 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
9414 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
9416 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
9419 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
9421 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
9424 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
9425 * but with all dynamically-allocated buffers duplicated in new buffers.
9427 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
9430 * Creates a new tuple which has the same data as `orig`
9431 * but with all dynamically-allocated buffers duplicated in new buffers.
9433 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
9436 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
9438 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
9441 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
9443 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
9446 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
9448 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
9451 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
9453 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
9456 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
9458 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
9461 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
9462 * but with all dynamically-allocated buffers duplicated in new buffers.
9464 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
9467 * Creates a new CResult_SignatureNoneZ in the success state.
9469 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
9472 * Creates a new CResult_SignatureNoneZ in the error state.
9474 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
9477 * Frees any resources used by the CResult_SignatureNoneZ.
9479 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
9482 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
9483 * but with all dynamically-allocated buffers duplicated in new buffers.
9485 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
9488 * Creates a new CResult_SignDecodeErrorZ in the success state.
9490 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
9493 * Creates a new CResult_SignDecodeErrorZ in the error state.
9495 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
9498 * Frees any resources used by the CResult_SignDecodeErrorZ.
9500 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
9503 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
9504 * but with all dynamically-allocated buffers duplicated in new buffers.
9506 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
9509 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9511 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
9514 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
9516 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
9519 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
9521 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
9524 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
9526 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
9529 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
9530 * but with all dynamically-allocated buffers duplicated in new buffers.
9532 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
9535 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
9537 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
9540 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
9542 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
9545 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
9547 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
9550 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
9551 * but with all dynamically-allocated buffers duplicated in new buffers.
9553 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
9556 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9558 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
9561 * Creates a new CResult_TransactionNoneZ in the success state.
9563 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
9566 * Creates a new CResult_TransactionNoneZ in the error state.
9568 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
9571 * Frees any resources used by the CResult_TransactionNoneZ.
9573 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
9576 * Creates a new CResult_NoneErrorZ in the success state.
9578 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
9581 * Creates a new CResult_NoneErrorZ in the error state.
9583 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
9586 * Frees any resources used by the CResult_NoneErrorZ.
9588 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
9591 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9593 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
9596 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
9598 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
9601 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
9603 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
9606 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
9608 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
9611 * Creates a new CResult_NoneAPIErrorZ in the success state.
9613 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
9616 * Creates a new CResult_NoneAPIErrorZ in the error state.
9618 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
9621 * Frees any resources used by the CResult_NoneAPIErrorZ.
9623 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
9626 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
9627 * but with all dynamically-allocated buffers duplicated in new buffers.
9629 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
9632 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9634 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
9637 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9639 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
9642 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
9644 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
9647 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
9649 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
9652 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
9654 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
9657 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
9658 * but with all dynamically-allocated buffers duplicated in new buffers.
9660 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
9663 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9665 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
9668 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
9670 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
9673 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
9675 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
9678 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
9680 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
9683 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
9685 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
9688 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
9690 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
9693 * Frees any resources used by the Event
9695 void Event_free(struct LDKEvent this_ptr);
9698 * Creates a copy of the Event
9700 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
9703 * Serialize the Event object into a byte array which can be read by Event_read
9705 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
9708 * Frees any resources used by the MessageSendEvent
9710 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
9713 * Creates a copy of the MessageSendEvent
9715 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
9718 * Calls the free function if one is set
9720 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
9723 * Calls the free function if one is set
9725 void EventsProvider_free(struct LDKEventsProvider this_ptr);
9728 * Frees any resources used by the APIError
9730 void APIError_free(struct LDKAPIError this_ptr);
9733 * Creates a copy of the APIError
9735 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
9738 * Creates a digital signature of a message given a SecretKey, like the node's secret.
9739 * A receiver knowing the PublicKey (e.g. the node's id) and the message can be sure that the signature was generated by the caller.
9740 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
9742 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, struct LDKSecretKey sk);
9745 * Recovers the PublicKey of the signer of the message given the message and the signature.
9747 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
9750 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
9751 * and the PublicKey.
9753 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
9756 * Creates a copy of the Level
9758 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
9761 * Returns the most verbose logging level.
9763 MUST_USE_RES enum LDKLevel Level_max(void);
9766 * Calls the free function if one is set
9768 void Logger_free(struct LDKLogger this_ptr);
9771 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
9773 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
9776 * Confirmations we will wait for before considering the channel locked in.
9777 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
9778 * equivalent limit applied to outbound channels).
9782 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
9785 * Confirmations we will wait for before considering the channel locked in.
9786 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
9787 * equivalent limit applied to outbound channels).
9791 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
9794 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
9795 * the number of blocks we have to punish our counterparty if they broadcast a revoked
9798 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
9799 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
9800 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
9801 * possibly with time in between to RBF the spending transaction).
9803 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
9804 * case of an honest unilateral channel close, which implicitly decrease the economic value of
9807 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
9808 * can tweak config to ask for more security, not less.
9810 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
9813 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
9814 * the number of blocks we have to punish our counterparty if they broadcast a revoked
9817 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
9818 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
9819 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
9820 * possibly with time in between to RBF the spending transaction).
9822 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
9823 * case of an honest unilateral channel close, which implicitly decrease the economic value of
9826 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
9827 * can tweak config to ask for more security, not less.
9829 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
9832 * Set to the smallest value HTLC we will accept to process.
9834 * This value is sent to our counterparty on channel-open and we close the channel any time
9835 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
9837 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
9840 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
9843 * Set to the smallest value HTLC we will accept to process.
9845 * This value is sent to our counterparty on channel-open and we close the channel any time
9846 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
9848 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
9851 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
9854 * Constructs a new ChannelHandshakeConfig given each field
9856 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);
9859 * Creates a copy of the ChannelHandshakeConfig
9861 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
9864 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
9866 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
9869 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
9871 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
9874 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
9875 * only applies to inbound channels.
9879 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9882 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
9883 * only applies to inbound channels.
9887 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9890 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
9891 * you to limit the maximum minimum-size they can require.
9893 * Default value: u64::max_value.
9895 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9898 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
9899 * you to limit the maximum minimum-size they can require.
9901 * Default value: u64::max_value.
9903 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9906 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
9907 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
9911 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9914 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
9915 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
9919 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9922 * The remote node will require we keep a certain amount in direct payment to ourselves at all
9923 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
9924 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
9926 * Default value: u64::max_value.
9928 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9931 * The remote node will require we keep a certain amount in direct payment to ourselves at all
9932 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
9933 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
9935 * Default value: u64::max_value.
9937 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9940 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
9941 * time. This allows you to set a minimum such value.
9945 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9948 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
9949 * time. This allows you to set a minimum such value.
9953 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
9956 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
9957 * required to always be higher than this value so this only applies to HTLC outputs (and
9958 * potentially to-self outputs before any payments have been made).
9959 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9960 * This setting allows you to set a minimum dust limit for their commitment transactions,
9961 * reflecting the reality that tiny outputs are not considered standard transactions and will
9962 * not propagate through the Bitcoin network.
9964 * Default value: 546, the current dust limit on the Bitcoin network.
9966 uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9969 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
9970 * required to always be higher than this value so this only applies to HTLC outputs (and
9971 * potentially to-self outputs before any payments have been made).
9972 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9973 * This setting allows you to set a minimum dust limit for their commitment transactions,
9974 * reflecting the reality that tiny outputs are not considered standard transactions and will
9975 * not propagate through the Bitcoin network.
9977 * Default value: 546, the current dust limit on the Bitcoin network.
9979 void ChannelHandshakeLimits_set_min_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9982 * Maximum allowed threshold above which outputs will not be generated in their commitment
9984 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9986 * Default value: u64::max_value.
9988 uint64_t ChannelHandshakeLimits_get_max_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9991 * Maximum allowed threshold above which outputs will not be generated in their commitment
9993 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9995 * Default value: u64::max_value.
9997 void ChannelHandshakeLimits_set_max_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
10000 * Before a channel is usable the funding transaction will need to be confirmed by at least a
10001 * certain number of blocks, specified by the node which is not the funder (as the funder can
10002 * assume they aren't going to double-spend themselves).
10003 * This config allows you to set a limit on the maximum amount of time to wait.
10005 * Default value: 144, or roughly one day and only applies to outbound channels.
10007 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
10010 * Before a channel is usable the funding transaction will need to be confirmed by at least a
10011 * certain number of blocks, specified by the node which is not the funder (as the funder can
10012 * assume they aren't going to double-spend themselves).
10013 * This config allows you to set a limit on the maximum amount of time to wait.
10015 * Default value: 144, or roughly one day and only applies to outbound channels.
10017 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
10020 * Set to force the incoming channel to match our announced channel preference in
10023 * Default value: true, to make the default that no announced channels are possible (which is
10024 * appropriate for any nodes which are not online very reliably).
10026 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
10029 * Set to force the incoming channel to match our announced channel preference in
10032 * Default value: true, to make the default that no announced channels are possible (which is
10033 * appropriate for any nodes which are not online very reliably).
10035 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
10038 * Set to the amount of time we're willing to wait to claim money back to us.
10040 * Not checking this value would be a security issue, as our peer would be able to set it to
10041 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
10043 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
10044 * reduce the loss of having useless locked funds (if your peer accepts)
10046 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
10049 * Set to the amount of time we're willing to wait to claim money back to us.
10051 * Not checking this value would be a security issue, as our peer would be able to set it to
10052 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
10054 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
10055 * reduce the loss of having useless locked funds (if your peer accepts)
10057 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
10060 * Constructs a new ChannelHandshakeLimits given each field
10062 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);
10065 * Creates a copy of the ChannelHandshakeLimits
10067 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
10070 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
10072 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
10075 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
10077 void ChannelConfig_free(struct LDKChannelConfig this_obj);
10080 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
10081 * This may be allowed to change at runtime in a later update, however doing so must result in
10082 * update messages sent to notify all nodes of our updated relay fee.
10084 * Default value: 0.
10086 uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
10089 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
10090 * This may be allowed to change at runtime in a later update, however doing so must result in
10091 * update messages sent to notify all nodes of our updated relay fee.
10093 * Default value: 0.
10095 void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
10098 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
10099 * the channel this config applies to.
10101 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
10102 * HTLC balance when a channel appears on-chain whereas
10103 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
10104 * (non-HTLC-encumbered) balance.
10106 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
10107 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
10108 * commitment transaction at least once per this many blocks (minus some margin to allow us
10109 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
10110 * the spending transaction).
10112 * Default value: 72 (12 hours at an average of 6 blocks/hour).
10113 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
10114 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
10116 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
10118 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
10121 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
10122 * the channel this config applies to.
10124 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
10125 * HTLC balance when a channel appears on-chain whereas
10126 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
10127 * (non-HTLC-encumbered) balance.
10129 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
10130 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
10131 * commitment transaction at least once per this many blocks (minus some margin to allow us
10132 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
10133 * the spending transaction).
10135 * Default value: 72 (12 hours at an average of 6 blocks/hour).
10136 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
10137 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
10139 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
10141 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
10144 * Set to announce the channel publicly and notify all nodes that they can route via this
10147 * This should only be set to true for nodes which expect to be online reliably.
10149 * As the node which funds a channel picks this value this will only apply for new outbound
10150 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
10152 * This cannot be changed after the initial channel handshake.
10154 * Default value: false.
10156 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
10159 * Set to announce the channel publicly and notify all nodes that they can route via this
10162 * This should only be set to true for nodes which expect to be online reliably.
10164 * As the node which funds a channel picks this value this will only apply for new outbound
10165 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
10167 * This cannot be changed after the initial channel handshake.
10169 * Default value: false.
10171 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
10174 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
10175 * supports it, they will then enforce the mutual-close output to us matches what we provided
10176 * at intialization, preventing us from closing to an alternate pubkey.
10178 * This is set to true by default to provide a slight increase in security, though ultimately
10179 * any attacker who is able to take control of a channel can just as easily send the funds via
10180 * lightning payments, so we never require that our counterparties support this option.
10182 * This cannot be changed after a channel has been initialized.
10184 * Default value: true.
10186 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
10189 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
10190 * supports it, they will then enforce the mutual-close output to us matches what we provided
10191 * at intialization, preventing us from closing to an alternate pubkey.
10193 * This is set to true by default to provide a slight increase in security, though ultimately
10194 * any attacker who is able to take control of a channel can just as easily send the funds via
10195 * lightning payments, so we never require that our counterparties support this option.
10197 * This cannot be changed after a channel has been initialized.
10199 * Default value: true.
10201 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
10204 * Constructs a new ChannelConfig given each field
10206 MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
10209 * Creates a copy of the ChannelConfig
10211 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
10214 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
10216 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
10219 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
10221 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
10224 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
10226 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
10229 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
10231 void UserConfig_free(struct LDKUserConfig this_obj);
10234 * Channel config that we propose to our counterparty.
10236 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
10239 * Channel config that we propose to our counterparty.
10241 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
10244 * Limits applied to our counterparty's proposed channel config settings.
10246 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
10249 * Limits applied to our counterparty's proposed channel config settings.
10251 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
10254 * Channel config which affects behavior during channel lifetime.
10256 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
10259 * Channel config which affects behavior during channel lifetime.
10261 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
10264 * Constructs a new UserConfig given each field
10266 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);
10269 * Creates a copy of the UserConfig
10271 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
10274 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
10276 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
10279 * Creates a copy of the AccessError
10281 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
10284 * Calls the free function if one is set
10286 void Access_free(struct LDKAccess this_ptr);
10289 * Calls the free function if one is set
10291 void Listen_free(struct LDKListen this_ptr);
10294 * Calls the free function if one is set
10296 void Watch_free(struct LDKWatch this_ptr);
10299 * Calls the free function if one is set
10301 void Filter_free(struct LDKFilter this_ptr);
10304 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
10306 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
10309 * First block where the transaction output may have been spent.
10311 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
10314 * First block where the transaction output may have been spent.
10316 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10319 * Outpoint identifying the transaction output.
10321 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
10324 * Outpoint identifying the transaction output.
10326 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10329 * Spending condition of the transaction output.
10331 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
10334 * Spending condition of the transaction output.
10336 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
10339 * Constructs a new WatchedOutput given each field
10341 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
10344 * Calls the free function if one is set
10346 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
10349 * Creates a copy of the ConfirmationTarget
10351 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
10354 * Calls the free function if one is set
10356 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
10359 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
10361 void ChainMonitor_free(struct LDKChainMonitor this_obj);
10364 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10365 * of a channel and reacting accordingly based on transactions in the connected block. See
10366 * [`ChannelMonitor::block_connected`] for details. Any HTLCs that were resolved on chain will
10367 * be returned by [`chain::Watch::release_pending_monitor_events`].
10369 * Calls back to [`chain::Filter`] if any monitor indicated new outputs to watch. Subsequent
10370 * calls must not exclude any transactions matching the new outputs nor any in-block
10371 * descendants of such transactions. It is not necessary to re-fetch the block to obtain
10372 * updated `txdata`.
10374 void ChainMonitor_block_connected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
10377 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10378 * of a channel and reacting accordingly to newly confirmed transactions. For details, see
10379 * [`ChannelMonitor::transactions_confirmed`].
10381 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
10382 * blocks. May be called before or after [`update_best_block`] for transactions in the
10383 * corresponding block. See [`update_best_block`] for further calling expectations.
10385 * [`block_connected`]: Self::block_connected
10386 * [`update_best_block`]: Self::update_best_block
10388 void ChainMonitor_transactions_confirmed(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
10391 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10392 * of a channel and reacting accordingly based on the new chain tip. For details, see
10393 * [`ChannelMonitor::update_best_block`].
10395 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
10396 * blocks. May be called before or after [`transactions_confirmed`] for the corresponding
10399 * Must be called after new blocks become available for the most recent block. Intermediary
10400 * blocks, however, may be safely skipped. In the event of a chain re-organization, this only
10401 * needs to be called for the most recent block assuming `transaction_unconfirmed` is called
10402 * for any affected transactions.
10404 * [`block_connected`]: Self::block_connected
10405 * [`transactions_confirmed`]: Self::transactions_confirmed
10406 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
10408 void ChainMonitor_update_best_block(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height);
10411 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10412 * of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for
10415 void ChainMonitor_block_disconnected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t disconnected_height);
10418 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10419 * of a channel based on transactions unconfirmed as a result of a chain reorganization. See
10420 * [`ChannelMonitor::transaction_unconfirmed`] for details.
10422 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
10423 * than blocks. May be called before or after [`update_best_block`] for transactions in the
10424 * corresponding block. See [`update_best_block`] for further calling expectations.
10426 * [`block_disconnected`]: Self::block_disconnected
10427 * [`update_best_block`]: Self::update_best_block
10429 void ChainMonitor_transaction_unconfirmed(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32]);
10432 * Returns the set of txids that should be monitored for re-organization out of the chain.
10434 MUST_USE_RES struct LDKCVec_TxidZ ChainMonitor_get_relevant_txids(const struct LDKChainMonitor *NONNULL_PTR this_arg);
10437 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
10439 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
10440 * will call back to it indicating transactions and outputs of interest. This allows clients to
10441 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
10442 * always need to fetch full blocks absent another means for determining which blocks contain
10443 * transactions relevant to the watched channels.
10445 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
10448 * Constructs a new Watch which calls the relevant methods on this_arg.
10449 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
10451 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
10454 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
10455 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
10457 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
10460 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
10462 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
10465 * The sequence number of this update. Updates *must* be replayed in-order according to this
10466 * sequence number (and updates may panic if they are not). The update_id values are strictly
10467 * increasing and increase by one for each new update, with one exception specified below.
10469 * This sequence number is also used to track up to which points updates which returned
10470 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
10471 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
10473 * The only instance where update_id values are not strictly increasing is the case where we
10474 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
10475 * its docs for more details.
10477 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
10480 * The sequence number of this update. Updates *must* be replayed in-order according to this
10481 * sequence number (and updates may panic if they are not). The update_id values are strictly
10482 * increasing and increase by one for each new update, with one exception specified below.
10484 * This sequence number is also used to track up to which points updates which returned
10485 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
10486 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
10488 * The only instance where update_id values are not strictly increasing is the case where we
10489 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
10490 * its docs for more details.
10492 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
10495 * Creates a copy of the ChannelMonitorUpdate
10497 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
10500 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
10502 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
10505 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
10507 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
10510 * Creates a copy of the ChannelMonitorUpdateErr
10512 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
10515 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
10517 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
10520 * Creates a copy of the MonitorUpdateError
10522 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
10525 * Frees any resources used by the MonitorEvent
10527 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
10530 * Creates a copy of the MonitorEvent
10532 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
10535 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
10537 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
10540 * Creates a copy of the HTLCUpdate
10542 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
10545 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
10547 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
10550 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
10552 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
10555 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
10557 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
10560 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
10562 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
10565 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
10568 * panics if the given update is not the next update by update_id.
10570 MUST_USE_RES struct LDKCResult_NoneMonitorUpdateErrorZ ChannelMonitor_update_monitor(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
10573 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
10576 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10579 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
10581 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10584 * Gets a list of txids, with their output scripts (in the order they appear in the
10585 * transaction), which we must learn about spends of via block_connected().
10587 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10590 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
10591 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
10592 * have been registered.
10594 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
10597 * Get the list of HTLCs who's status has been updated on chain. This should be called by
10598 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
10600 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10603 * Gets the list of pending events which were generated by previous actions, clearing the list
10606 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
10607 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
10608 * no internal locking in ChannelMonitors.
10610 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10613 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
10614 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
10615 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
10616 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
10617 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
10618 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
10619 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
10620 * out-of-band the other node operator to coordinate with him if option is available to you.
10621 * In any-case, choice is up to the user.
10623 MUST_USE_RES struct LDKCVec_TransactionZ ChannelMonitor_get_latest_holder_commitment_txn(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger);
10626 * Processes transactions in a newly connected block, which may result in any of the following:
10627 * - update the monitor's state against resolved HTLCs
10628 * - punish the counterparty in the case of seeing a revoked commitment transaction
10629 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
10630 * - detect settled outputs for later spending
10631 * - schedule and bump any in-flight claims
10633 * Returns any new outputs to watch from `txdata`; after called, these are also included in
10634 * [`get_outputs_to_watch`].
10636 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
10638 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_block_connected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
10641 * Determines if the disconnected block contained any transactions of interest and updates
10644 void ChannelMonitor_block_disconnected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
10647 * Processes transactions confirmed in a block with the given header and height, returning new
10648 * outputs to watch. See [`block_connected`] for details.
10650 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
10651 * blocks. May be called before or after [`update_best_block`] for transactions in the
10652 * corresponding block. See [`update_best_block`] for further calling expectations.
10654 * [`block_connected`]: Self::block_connected
10655 * [`update_best_block`]: Self::update_best_block
10657 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_transactions_confirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
10660 * Processes a transaction that was reorganized out of the chain.
10662 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
10663 * than blocks. May be called before or after [`update_best_block`] for transactions in the
10664 * corresponding block. See [`update_best_block`] for further calling expectations.
10666 * [`block_disconnected`]: Self::block_disconnected
10667 * [`update_best_block`]: Self::update_best_block
10669 void ChannelMonitor_transaction_unconfirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
10672 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
10673 * [`block_connected`] for details.
10675 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
10676 * blocks. May be called before or after [`transactions_confirmed`] for the corresponding
10679 * Must be called after new blocks become available for the most recent block. Intermediary
10680 * blocks, however, may be safely skipped. In the event of a chain re-organization, this only
10681 * needs to be called for the most recent block assuming `transaction_unconfirmed` is called
10682 * for any affected transactions.
10684 * [`block_connected`]: Self::block_connected
10685 * [`transactions_confirmed`]: Self::transactions_confirmed
10686 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
10688 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_update_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
10691 * Returns the set of txids that should be monitored for re-organization out of the chain.
10693 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10696 * Calls the free function if one is set
10698 void Persist_free(struct LDKPersist this_ptr);
10701 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
10703 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
10706 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
10708 void OutPoint_free(struct LDKOutPoint this_obj);
10711 * The referenced transaction's txid.
10713 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
10716 * The referenced transaction's txid.
10718 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10721 * The index of the referenced output in its transaction's vout.
10723 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
10726 * The index of the referenced output in its transaction's vout.
10728 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
10731 * Constructs a new OutPoint given each field
10733 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
10736 * Creates a copy of the OutPoint
10738 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
10741 * Convert an `OutPoint` to a lightning channel id.
10743 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
10746 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
10748 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
10751 * Read a OutPoint from a byte array, created by OutPoint_write
10753 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
10756 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
10758 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
10761 * The outpoint which is spendable
10763 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10766 * The outpoint which is spendable
10768 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10771 * Per commitment point to derive delayed_payment_key by key holder
10773 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10776 * Per commitment point to derive delayed_payment_key by key holder
10778 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10781 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
10782 * the witness_script.
10784 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10787 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
10788 * the witness_script.
10790 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
10793 * The output which is referenced by the given outpoint
10795 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
10798 * The revocation point specific to the commitment transaction which was broadcast. Used to
10799 * derive the witnessScript for this output.
10801 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10804 * The revocation point specific to the commitment transaction which was broadcast. Used to
10805 * derive the witnessScript for this output.
10807 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10810 * Arbitrary identification information returned by a call to
10811 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10812 * the channel to spend the output.
10814 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
10817 * Arbitrary identification information returned by a call to
10818 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10819 * the channel to spend the output.
10821 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10824 * The value of the channel which this output originated from, possibly indirectly.
10826 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10829 * The value of the channel which this output originated from, possibly indirectly.
10831 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
10834 * Constructs a new DelayedPaymentOutputDescriptor given each field
10836 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);
10839 * Creates a copy of the DelayedPaymentOutputDescriptor
10841 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
10844 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
10846 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
10849 * The outpoint which is spendable
10851 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10854 * The outpoint which is spendable
10856 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10859 * The output which is referenced by the given outpoint
10861 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
10864 * Arbitrary identification information returned by a call to
10865 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10866 * the channel to spend the output.
10868 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
10871 * Arbitrary identification information returned by a call to
10872 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10873 * the channel to spend the output.
10875 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10878 * The value of the channel which this transactions spends.
10880 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10883 * The value of the channel which this transactions spends.
10885 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
10888 * Constructs a new StaticPaymentOutputDescriptor given each field
10890 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);
10893 * Creates a copy of the StaticPaymentOutputDescriptor
10895 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
10898 * Frees any resources used by the SpendableOutputDescriptor
10900 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
10903 * Creates a copy of the SpendableOutputDescriptor
10905 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
10908 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
10910 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
10913 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
10915 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
10918 * Calls the free function if one is set
10920 void BaseSign_free(struct LDKBaseSign this_ptr);
10923 * Creates a copy of a Sign
10925 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
10928 * Calls the free function if one is set
10930 void Sign_free(struct LDKSign this_ptr);
10933 * Calls the free function if one is set
10935 void KeysInterface_free(struct LDKKeysInterface this_ptr);
10938 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
10940 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
10943 * Private key of anchor tx
10945 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10948 * Private key of anchor tx
10950 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10953 * Holder secret key for blinded revocation pubkey
10955 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10958 * Holder secret key for blinded revocation pubkey
10960 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10963 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
10965 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10968 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
10970 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10973 * Holder secret key used in HTLC tx
10975 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10978 * Holder secret key used in HTLC tx
10980 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10983 * Holder htlc secret key used in commitment tx htlc outputs
10985 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10988 * Holder htlc secret key used in commitment tx htlc outputs
10990 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10995 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
11000 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11003 * Creates a copy of the InMemorySigner
11005 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
11008 * Create a new InMemorySigner
11010 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);
11013 * Counterparty pubkeys.
11014 * Will panic if ready_channel wasn't called.
11016 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11019 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
11020 * transactions, ie the amount of time that we have to wait to recover our funds if we
11021 * broadcast a transaction.
11022 * Will panic if ready_channel wasn't called.
11024 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11027 * The contest_delay value specified by us and applied on transactions broadcastable
11028 * by our counterparty, ie the amount of time that they have to wait to recover their funds
11029 * if they broadcast a transaction.
11030 * Will panic if ready_channel wasn't called.
11032 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11035 * Whether the holder is the initiator
11036 * Will panic if ready_channel wasn't called.
11038 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11042 * Will panic if ready_channel wasn't called.
11044 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11047 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
11048 * building transactions.
11050 * Will panic if ready_channel wasn't called.
11052 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11055 * Sign the single input of spend_tx at index `input_idx` which spends the output
11056 * described by descriptor, returning the witness stack for the input.
11058 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
11059 * or is not spending the outpoint described by `descriptor.outpoint`.
11061 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);
11064 * Sign the single input of spend_tx at index `input_idx` which spends the output
11065 * described by descriptor, returning the witness stack for the input.
11067 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
11068 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
11069 * sequence set to `descriptor.to_self_delay`.
11071 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);
11074 * Constructs a new BaseSign which calls the relevant methods on this_arg.
11075 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
11077 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11080 * Constructs a new Sign which calls the relevant methods on this_arg.
11081 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
11083 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11086 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
11088 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
11091 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
11093 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
11096 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
11098 void KeysManager_free(struct LDKKeysManager this_obj);
11101 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
11102 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
11103 * starting_time isn't strictly required to actually be a time, but it must absolutely,
11104 * without a doubt, be unique to this instance. ie if you start multiple times with the same
11105 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
11106 * simply use the current time (with very high precision).
11108 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
11109 * obviously, starting_time should be unique every time you reload the library - it is only
11110 * used to generate new ephemeral key data (which will be stored by the individual channel if
11113 * Note that the seed is required to recover certain on-chain funds independent of
11114 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
11115 * channel, and some on-chain during-closing funds.
11117 * Note that until the 0.1 release there is no guarantee of backward compatibility between
11118 * versions. Once the library is more fully supported, the docs will be updated to include a
11119 * detailed description of the guarantee.
11121 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
11124 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
11126 * Key derivation parameters are accessible through a per-channel secrets
11127 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
11128 * onchain output detection for which a corresponding delayed_payment_key must be derived.
11130 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]);
11133 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
11134 * output to the given change destination (if sufficient change value remains). The
11135 * transaction will have a feerate, at least, of the given value.
11137 * Returns `Err(())` if the output value is greater than the input value minus required fee or
11138 * if a descriptor was duplicated.
11140 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
11142 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
11143 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
11145 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);
11148 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
11149 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
11151 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
11154 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
11156 void ChannelManager_free(struct LDKChannelManager this_obj);
11159 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
11161 void ChainParameters_free(struct LDKChainParameters this_obj);
11164 * The network for determining the `chain_hash` in Lightning messages.
11166 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
11169 * The network for determining the `chain_hash` in Lightning messages.
11171 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
11174 * The hash and height of the latest block successfully connected.
11176 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
11178 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
11181 * The hash and height of the latest block successfully connected.
11183 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
11185 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
11188 * Constructs a new ChainParameters given each field
11190 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
11193 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
11195 void BestBlock_free(struct LDKBestBlock this_obj);
11198 * Creates a copy of the BestBlock
11200 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
11203 * Returns the best block from the genesis of the given network.
11205 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
11208 * Returns the best block as identified by the given block hash and height.
11210 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
11213 * Returns the best block hash.
11215 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
11218 * Returns the best block height.
11220 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
11223 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
11225 void ChannelDetails_free(struct LDKChannelDetails this_obj);
11228 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
11229 * thereafter this is the txid of the funding transaction xor the funding transaction output).
11230 * Note that this means this value is *not* persistent - it can change once during the
11231 * lifetime of the channel.
11233 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
11236 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
11237 * thereafter this is the txid of the funding transaction xor the funding transaction output).
11238 * Note that this means this value is *not* persistent - it can change once during the
11239 * lifetime of the channel.
11241 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11244 * The position of the funding transaction in the chain. None if the funding transaction has
11245 * not yet been confirmed and the channel fully opened.
11247 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11250 * The position of the funding transaction in the chain. None if the funding transaction has
11251 * not yet been confirmed and the channel fully opened.
11253 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
11256 * The node_id of our counterparty
11258 struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11261 * The node_id of our counterparty
11263 void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11266 * The Features the channel counterparty provided upon last connection.
11267 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
11268 * many routing-relevant features are present in the init context.
11270 struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11273 * The Features the channel counterparty provided upon last connection.
11274 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
11275 * many routing-relevant features are present in the init context.
11277 void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
11280 * The value, in satoshis, of this channel as appears in the funding output
11282 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11285 * The value, in satoshis, of this channel as appears in the funding output
11287 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11290 * The user_id passed in to create_channel, or 0 if the channel was inbound.
11292 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11295 * The user_id passed in to create_channel, or 0 if the channel was inbound.
11297 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11300 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
11301 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11302 * available for inclusion in new outbound HTLCs). This further does not include any pending
11303 * outgoing HTLCs which are awaiting some other resolution to be sent.
11305 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11308 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
11309 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11310 * available for inclusion in new outbound HTLCs). This further does not include any pending
11311 * outgoing HTLCs which are awaiting some other resolution to be sent.
11313 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11316 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
11317 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11318 * available for inclusion in new inbound HTLCs).
11319 * Note that there are some corner cases not fully handled here, so the actual available
11320 * inbound capacity may be slightly higher than this.
11322 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11325 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
11326 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11327 * available for inclusion in new inbound HTLCs).
11328 * Note that there are some corner cases not fully handled here, so the actual available
11329 * inbound capacity may be slightly higher than this.
11331 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11334 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
11335 * the peer is connected, and (c) no monitor update failure is pending resolution.
11337 bool ChannelDetails_get_is_live(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11340 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
11341 * the peer is connected, and (c) no monitor update failure is pending resolution.
11343 void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
11346 * Creates a copy of the ChannelDetails
11348 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
11351 * Frees any resources used by the PaymentSendFailure
11353 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
11356 * Creates a copy of the PaymentSendFailure
11358 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
11361 * Constructs a new ChannelManager to hold several channels and route between them.
11363 * This is the main \"logic hub\" for all channel-related actions, and implements
11364 * ChannelMessageHandler.
11366 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
11368 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
11370 * Users need to notify the new ChannelManager when a new block is connected or
11371 * disconnected using its `block_connected` and `block_disconnected` methods, starting
11372 * from after `params.latest_hash`.
11374 MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKKeysInterface keys_manager, struct LDKUserConfig config, struct LDKChainParameters params);
11377 * Gets the current configuration applied to all new channels, as
11379 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
11382 * Creates a new outbound channel to the given remote node and with the given value.
11384 * user_id will be provided back as user_channel_id in FundingGenerationReady events to allow
11385 * tracking of which events correspond with which create_channel call. Note that the
11386 * user_channel_id defaults to 0 for inbound channels, so you may wish to avoid using 0 for
11387 * user_id here. user_id has no meaning inside of LDK, it is simply copied to events and
11388 * otherwise ignored.
11390 * If successful, will generate a SendOpenChannel message event, so you should probably poll
11391 * PeerManager::process_events afterwards.
11393 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
11394 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
11396 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, uint64_t user_id, struct LDKUserConfig override_config);
11399 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
11400 * more information.
11402 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
11405 * Gets the list of usable channels, in random order. Useful as an argument to
11406 * get_route to ensure non-announced channels are used.
11408 * These are guaranteed to have their is_live value set to true, see the documentation for
11409 * ChannelDetails::is_live for more info on exactly what the criteria are.
11411 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
11414 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
11415 * will be accepted on the given channel, and after additional timeout/the closing of all
11416 * pending HTLCs, the channel will be closed on chain.
11418 * May generate a SendShutdown message event on success, which should be relayed.
11420 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
11423 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
11424 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
11426 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
11429 * Force close all channels, immediately broadcasting the latest local commitment transaction
11430 * for each to the chain and rejecting new HTLCs on each.
11432 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
11435 * Sends a payment along a given route.
11437 * Value parameters are provided via the last hop in route, see documentation for RouteHop
11438 * fields for more info.
11440 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
11441 * payment), we don't do anything to stop you! We always try to ensure that if the provided
11442 * next hop knows the preimage to payment_hash they can claim an additional amount as
11443 * specified in the last hop in the route! Thus, you should probably do your own
11444 * payment_preimage tracking (which you should already be doing as they represent \"proof of
11445 * payment\") and prevent double-sends yourself.
11447 * May generate SendHTLCs message(s) event on success, which should be relayed.
11449 * Each path may have a different return value, and PaymentSendValue may return a Vec with
11450 * each entry matching the corresponding-index entry in the route paths, see
11451 * PaymentSendFailure for more info.
11453 * In general, a path may raise:
11454 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
11455 * node public key) is specified.
11456 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
11457 * (including due to previous monitor update failure or new permanent monitor update
11459 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
11460 * relevant updates.
11462 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
11463 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
11464 * different route unless you intend to pay twice!
11466 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
11467 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
11468 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
11469 * must not contain multiple paths as multi-path payments require a recipient-provided
11471 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
11472 * bit set (either as required or as available). If multiple paths are present in the Route,
11473 * we assume the invoice had the basic_mpp feature set.
11475 MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
11478 * Call this upon creation of a funding transaction for the given channel.
11480 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
11481 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
11483 * Panics if a funding transaction has already been provided for this channel.
11485 * May panic if the output found in the funding transaction is duplicative with some other
11486 * channel (note that this should be trivially prevented by using unique funding transaction
11487 * keys per-channel).
11489 * Do NOT broadcast the funding transaction yourself. When we have safely received our
11490 * counterparty's signature the funding transaction will automatically be broadcast via the
11491 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
11493 * Note that this includes RBF or similar transaction replacement strategies - lightning does
11494 * not currently support replacing a funding transaction on an existing channel. Instead,
11495 * create a new channel with a conflicting funding transaction.
11497 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKTransaction funding_transaction);
11500 * Generates a signed node_announcement from the given arguments and creates a
11501 * BroadcastNodeAnnouncement event. Note that such messages will be ignored unless peers have
11502 * seen a channel_announcement from us (ie unless we have public channels open).
11504 * RGB is a node \"color\" and alias is a printable human-readable string to describe this node
11505 * to humans. They carry no in-protocol meaning.
11507 * addresses represent the set (possibly empty) of socket addresses on which this node accepts
11508 * incoming connections. These will be broadcast to the network, publicly tying these
11509 * addresses together. If you wish to preserve user privacy, addresses should likely contain
11510 * only Tor Onion addresses.
11512 * Panics if addresses is absurdly large (more than 500).
11514 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
11517 * Processes HTLCs which are pending waiting on random forward delay.
11519 * Should only really ever be called in response to a PendingHTLCsForwardable event.
11520 * Will likely generate further events.
11522 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
11525 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
11526 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
11527 * to inform the network about the uselessness of these channels.
11529 * This method handles all the details, and must be called roughly once per minute.
11531 * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
11533 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
11536 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
11537 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
11538 * along the path (including in our own channel on which we received it).
11539 * Returns false if no payment was found to fail backwards, true if the process of failing the
11540 * HTLC backwards has been started.
11542 MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKThirtyTwoBytes payment_secret);
11545 * Provides a payment preimage in response to a PaymentReceived event, returning true and
11546 * generating message events for the net layer to claim the payment, if possible. Thus, you
11547 * should probably kick the net layer to go send messages if this returns true!
11549 * You must specify the expected amounts for this HTLC, and we will only claim HTLCs
11550 * available within a few percent of the expected amount. This is critical for several
11551 * reasons : a) it avoids providing senders with `proof-of-payment` (in the form of the
11552 * payment_preimage without having provided the full value and b) it avoids certain
11553 * privacy-breaking recipient-probing attacks which may reveal payment activity to
11554 * motivated attackers.
11556 * Note that the privacy concerns in (b) are not relevant in payments with a payment_secret
11557 * set. Thus, for such payments we will claim any payments which do not under-pay.
11559 * May panic if called except in response to a PaymentReceived event.
11561 MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t expected_amount);
11564 * Gets the node_id held by this ChannelManager
11566 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
11569 * Restores a single, given channel to normal operation after a
11570 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
11573 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
11574 * fully committed in every copy of the given channels' ChannelMonitors.
11576 * Note that there is no effect to calling with a highest_applied_update_id other than the
11577 * current latest ChannelMonitorUpdate and one call to this function after multiple
11578 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
11579 * exists largely only to prevent races between this and concurrent update_monitor calls.
11581 * Thus, the anticipated use is, at a high level:
11582 * 1) You register a chain::Watch with this ChannelManager,
11583 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
11584 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
11585 * any time it cannot do so instantly,
11586 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
11587 * 4) once all remote copies are updated, you call this function with the update_id that
11588 * completed, and once it is the latest the Channel will be re-enabled.
11590 void ChannelManager_channel_monitor_updated(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOutPoint *NONNULL_PTR funding_txo, uint64_t highest_applied_update_id);
11593 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
11594 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
11596 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
11599 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
11600 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
11602 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
11605 * Constructs a new Listen which calls the relevant methods on this_arg.
11606 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
11608 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
11611 * Updates channel state to take note of transactions which were confirmed in the given block
11612 * at the given height.
11614 * Note that you must still call (or have called) [`update_best_block`] with the block
11615 * information which is included here.
11617 * This method may be called before or after [`update_best_block`] for a given block's
11618 * transaction data and may be called multiple times with additional transaction data for a
11621 * This method may be called for a previous block after an [`update_best_block`] call has
11622 * been made for a later block, however it must *not* be called with transaction data from a
11623 * block which is no longer in the best chain (ie where [`update_best_block`] has already
11624 * been informed about a blockchain reorganization which no longer includes the block which
11625 * corresponds to `header`).
11627 * [`update_best_block`]: `Self::update_best_block`
11629 void ChannelManager_transactions_confirmed(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKCVec_C2Tuple_usizeTransactionZZ txdata);
11632 * Updates channel state with the current best blockchain tip. You should attempt to call this
11633 * quickly after a new block becomes available, however if multiple new blocks become
11634 * available at the same time, only a single `update_best_block()` call needs to be made.
11636 * This method should also be called immediately after any block disconnections, once at the
11637 * reorganization fork point, and once with the new chain tip. Calling this method at the
11638 * blockchain reorganization fork point ensures we learn when a funding transaction which was
11639 * previously confirmed is reorganized out of the blockchain, ensuring we do not continue to
11640 * accept payments which cannot be enforced on-chain.
11642 * In both the block-connection and block-disconnection case, this method may be called either
11643 * once per block connected or disconnected, or simply at the fork point and new tip(s),
11644 * skipping any intermediary blocks.
11646 void ChannelManager_update_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height);
11649 * Gets the set of txids which should be monitored for their confirmation state.
11651 * If you're providing information about reorganizations via [`transaction_unconfirmed`], this
11652 * is the set of transactions which you may need to call [`transaction_unconfirmed`] for.
11654 * This may be useful to poll to determine the set of transactions which must be registered
11655 * with an Electrum server or for which an Electrum server needs to be polled to determine
11656 * transaction confirmation state.
11658 * This may update after any [`transactions_confirmed`] or [`block_connected`] call.
11660 * Note that this is NOT the set of transactions which must be included in calls to
11661 * [`transactions_confirmed`] if they are confirmed, but a small subset of it.
11663 * [`transactions_confirmed`]: Self::transactions_confirmed
11664 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
11665 * [`block_connected`]: chain::Listen::block_connected
11667 MUST_USE_RES struct LDKCVec_TxidZ ChannelManager_get_relevant_txids(const struct LDKChannelManager *NONNULL_PTR this_arg);
11670 * Marks a transaction as having been reorganized out of the blockchain.
11672 * If a transaction is included in [`get_relevant_txids`], and is no longer in the main branch
11673 * of the blockchain, this function should be called to indicate that the transaction should
11674 * be considered reorganized out.
11676 * Once this is called, the given transaction will no longer appear on [`get_relevant_txids`],
11677 * though this may be called repeatedly for a given transaction without issue.
11679 * Note that if the transaction is confirmed on the main chain in a different block (indicated
11680 * via a call to [`transactions_confirmed`]), it may re-appear in [`get_relevant_txids`], thus
11681 * be very wary of race-conditions wherein the final state of a transaction indicated via
11682 * these APIs is not the same as its state on the blockchain.
11684 * [`transactions_confirmed`]: Self::transactions_confirmed
11685 * [`get_relevant_txids`]: Self::get_relevant_txids
11687 void ChannelManager_transaction_unconfirmed(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*txid)[32]);
11690 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
11691 * indicating whether persistence is necessary. Only one listener on
11692 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
11694 * Note that the feature `allow_wallclock_use` must be enabled to use this function.
11696 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
11699 * Blocks until ChannelManager needs to be persisted. Only one listener on
11700 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
11703 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
11706 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
11707 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
11709 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
11712 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
11714 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
11717 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
11719 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
11722 * The keys provider which will give us relevant keys. Some keys will be loaded during
11723 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
11726 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11729 * The keys provider which will give us relevant keys. Some keys will be loaded during
11730 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
11733 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
11736 * The fee_estimator for use in the ChannelManager in the future.
11738 * No calls to the FeeEstimator will be made during deserialization.
11740 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11743 * The fee_estimator for use in the ChannelManager in the future.
11745 * No calls to the FeeEstimator will be made during deserialization.
11747 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
11750 * The chain::Watch for use in the ChannelManager in the future.
11752 * No calls to the chain::Watch will be made during deserialization. It is assumed that
11753 * you have deserialized ChannelMonitors separately and will add them to your
11754 * chain::Watch after deserializing this ChannelManager.
11756 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11759 * The chain::Watch for use in the ChannelManager in the future.
11761 * No calls to the chain::Watch will be made during deserialization. It is assumed that
11762 * you have deserialized ChannelMonitors separately and will add them to your
11763 * chain::Watch after deserializing this ChannelManager.
11765 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
11768 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
11769 * used to broadcast the latest local commitment transactions of channels which must be
11770 * force-closed during deserialization.
11772 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11775 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
11776 * used to broadcast the latest local commitment transactions of channels which must be
11777 * force-closed during deserialization.
11779 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
11782 * The Logger for use in the ChannelManager and which may be used to log information during
11785 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11788 * The Logger for use in the ChannelManager and which may be used to log information during
11791 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
11794 * Default settings used for new channels. Any existing channels will continue to use the
11795 * runtime settings which were stored when the ChannelManager was serialized.
11797 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11800 * Default settings used for new channels. Any existing channels will continue to use the
11801 * runtime settings which were stored when the ChannelManager was serialized.
11803 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
11806 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
11807 * HashMap for you. This is primarily useful for C bindings where it is not practical to
11808 * populate a HashMap directly from C.
11810 MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKKeysInterface keys_manager, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors);
11813 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
11815 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
11818 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
11820 void DecodeError_free(struct LDKDecodeError this_obj);
11823 * Creates a copy of the DecodeError
11825 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
11828 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
11830 void Init_free(struct LDKInit this_obj);
11833 * The relevant features which the sender supports
11835 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
11838 * The relevant features which the sender supports
11840 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
11843 * Constructs a new Init given each field
11845 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
11848 * Creates a copy of the Init
11850 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
11853 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
11855 void ErrorMessage_free(struct LDKErrorMessage this_obj);
11858 * The channel ID involved in the error
11860 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
11863 * The channel ID involved in the error
11865 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11868 * A possibly human-readable error description.
11869 * The string should be sanitized before it is used (e.g. emitted to logs
11870 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
11871 * vulnerability in the terminal emulator or the logging subsystem.
11873 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
11876 * A possibly human-readable error description.
11877 * The string should be sanitized before it is used (e.g. emitted to logs
11878 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
11879 * vulnerability in the terminal emulator or the logging subsystem.
11881 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
11884 * Constructs a new ErrorMessage given each field
11886 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
11889 * Creates a copy of the ErrorMessage
11891 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
11894 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
11896 void Ping_free(struct LDKPing this_obj);
11899 * The desired response length
11901 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
11904 * The desired response length
11906 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
11909 * The ping packet size.
11910 * This field is not sent on the wire. byteslen zeros are sent.
11912 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
11915 * The ping packet size.
11916 * This field is not sent on the wire. byteslen zeros are sent.
11918 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
11921 * Constructs a new Ping given each field
11923 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
11926 * Creates a copy of the Ping
11928 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
11931 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
11933 void Pong_free(struct LDKPong this_obj);
11936 * The pong packet size.
11937 * This field is not sent on the wire. byteslen zeros are sent.
11939 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
11942 * The pong packet size.
11943 * This field is not sent on the wire. byteslen zeros are sent.
11945 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
11948 * Constructs a new Pong given each field
11950 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
11953 * Creates a copy of the Pong
11955 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
11958 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
11960 void OpenChannel_free(struct LDKOpenChannel this_obj);
11963 * The genesis hash of the blockchain where the channel is to be opened
11965 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
11968 * The genesis hash of the blockchain where the channel is to be opened
11970 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11973 * A temporary channel ID, until the funding outpoint is announced
11975 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
11978 * A temporary channel ID, until the funding outpoint is announced
11980 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11983 * The channel value
11985 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11988 * The channel value
11990 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11993 * The amount to push to the counterparty as part of the open, in milli-satoshi
11995 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11998 * The amount to push to the counterparty as part of the open, in milli-satoshi
12000 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
12003 * The threshold below which outputs on transactions broadcast by sender will be omitted
12005 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12008 * The threshold below which outputs on transactions broadcast by sender will be omitted
12010 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
12013 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
12015 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12018 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
12020 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
12023 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
12025 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12028 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
12030 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
12033 * The minimum HTLC size incoming to sender, in milli-satoshi
12035 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12038 * The minimum HTLC size incoming to sender, in milli-satoshi
12040 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
12043 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
12045 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12048 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
12050 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
12053 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
12055 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12058 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
12060 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
12063 * The maximum number of inbound HTLCs towards sender
12065 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12068 * The maximum number of inbound HTLCs towards sender
12070 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
12073 * The sender's key controlling the funding transaction
12075 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12078 * The sender's key controlling the funding transaction
12080 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12083 * Used to derive a revocation key for transactions broadcast by counterparty
12085 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12088 * Used to derive a revocation key for transactions broadcast by counterparty
12090 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12093 * A payment key to sender for transactions broadcast by counterparty
12095 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12098 * A payment key to sender for transactions broadcast by counterparty
12100 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12103 * Used to derive a payment key to sender for transactions broadcast by sender
12105 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12108 * Used to derive a payment key to sender for transactions broadcast by sender
12110 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12113 * Used to derive an HTLC payment key to sender
12115 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12118 * Used to derive an HTLC payment key to sender
12120 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12123 * The first to-be-broadcast-by-sender transaction's per commitment point
12125 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12128 * The first to-be-broadcast-by-sender transaction's per commitment point
12130 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12135 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12140 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
12143 * Creates a copy of the OpenChannel
12145 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
12148 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
12150 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
12153 * A temporary channel ID, until the funding outpoint is announced
12155 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
12158 * A temporary channel ID, until the funding outpoint is announced
12160 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12163 * The threshold below which outputs on transactions broadcast by sender will be omitted
12165 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12168 * The threshold below which outputs on transactions broadcast by sender will be omitted
12170 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
12173 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
12175 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12178 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
12180 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
12183 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
12185 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12188 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
12190 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
12193 * The minimum HTLC size incoming to sender, in milli-satoshi
12195 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12198 * The minimum HTLC size incoming to sender, in milli-satoshi
12200 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
12203 * Minimum depth of the funding transaction before the channel is considered open
12205 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12208 * Minimum depth of the funding transaction before the channel is considered open
12210 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
12213 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
12215 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12218 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
12220 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
12223 * The maximum number of inbound HTLCs towards sender
12225 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12228 * The maximum number of inbound HTLCs towards sender
12230 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
12233 * The sender's key controlling the funding transaction
12235 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12238 * The sender's key controlling the funding transaction
12240 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12243 * Used to derive a revocation key for transactions broadcast by counterparty
12245 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12248 * Used to derive a revocation key for transactions broadcast by counterparty
12250 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12253 * A payment key to sender for transactions broadcast by counterparty
12255 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12258 * A payment key to sender for transactions broadcast by counterparty
12260 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12263 * Used to derive a payment key to sender for transactions broadcast by sender
12265 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12268 * Used to derive a payment key to sender for transactions broadcast by sender
12270 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12273 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
12275 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12278 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
12280 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12283 * The first to-be-broadcast-by-sender transaction's per commitment point
12285 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12288 * The first to-be-broadcast-by-sender transaction's per commitment point
12290 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12293 * Creates a copy of the AcceptChannel
12295 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
12298 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
12300 void FundingCreated_free(struct LDKFundingCreated this_obj);
12303 * A temporary channel ID, until the funding is established
12305 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
12308 * A temporary channel ID, until the funding is established
12310 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12313 * The funding transaction ID
12315 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
12318 * The funding transaction ID
12320 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12323 * The specific output index funding this channel
12325 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
12328 * The specific output index funding this channel
12330 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
12333 * The signature of the channel initiator (funder) on the funding transaction
12335 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
12338 * The signature of the channel initiator (funder) on the funding transaction
12340 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
12343 * Constructs a new FundingCreated given each field
12345 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);
12348 * Creates a copy of the FundingCreated
12350 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
12353 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
12355 void FundingSigned_free(struct LDKFundingSigned this_obj);
12360 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
12365 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12368 * The signature of the channel acceptor (fundee) on the funding transaction
12370 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
12373 * The signature of the channel acceptor (fundee) on the funding transaction
12375 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
12378 * Constructs a new FundingSigned given each field
12380 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
12383 * Creates a copy of the FundingSigned
12385 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
12388 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
12390 void FundingLocked_free(struct LDKFundingLocked this_obj);
12395 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
12400 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12403 * The per-commitment point of the second commitment transaction
12405 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
12408 * The per-commitment point of the second commitment transaction
12410 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12413 * Constructs a new FundingLocked given each field
12415 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
12418 * Creates a copy of the FundingLocked
12420 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
12423 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
12425 void Shutdown_free(struct LDKShutdown this_obj);
12430 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
12435 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12438 * The destination of this peer's funds on closing.
12439 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
12441 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
12444 * The destination of this peer's funds on closing.
12445 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
12447 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
12450 * Constructs a new Shutdown given each field
12452 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
12455 * Creates a copy of the Shutdown
12457 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
12460 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
12462 void ClosingSigned_free(struct LDKClosingSigned this_obj);
12467 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
12472 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12475 * The proposed total fee for the closing transaction
12477 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
12480 * The proposed total fee for the closing transaction
12482 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
12485 * A signature on the closing transaction
12487 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
12490 * A signature on the closing transaction
12492 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
12495 * Constructs a new ClosingSigned given each field
12497 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
12500 * Creates a copy of the ClosingSigned
12502 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
12505 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
12507 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
12512 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
12517 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12522 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
12527 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
12530 * The HTLC value in milli-satoshi
12532 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
12535 * The HTLC value in milli-satoshi
12537 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
12540 * The payment hash, the pre-image of which controls HTLC redemption
12542 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
12545 * The payment hash, the pre-image of which controls HTLC redemption
12547 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12550 * The expiry height of the HTLC
12552 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
12555 * The expiry height of the HTLC
12557 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
12560 * Creates a copy of the UpdateAddHTLC
12562 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
12565 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
12567 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
12572 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
12577 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12582 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
12587 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
12590 * The pre-image of the payment hash, allowing HTLC redemption
12592 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
12595 * The pre-image of the payment hash, allowing HTLC redemption
12597 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12600 * Constructs a new UpdateFulfillHTLC given each field
12602 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
12605 * Creates a copy of the UpdateFulfillHTLC
12607 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
12610 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
12612 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
12617 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
12622 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12627 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
12632 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
12635 * Creates a copy of the UpdateFailHTLC
12637 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
12640 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
12642 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
12647 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
12652 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12657 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
12662 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
12667 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
12672 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
12675 * Creates a copy of the UpdateFailMalformedHTLC
12677 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
12680 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
12682 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
12687 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
12692 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12695 * A signature on the commitment transaction
12697 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
12700 * A signature on the commitment transaction
12702 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
12705 * Signatures on the HTLC transactions
12707 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
12710 * Constructs a new CommitmentSigned given each field
12712 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
12715 * Creates a copy of the CommitmentSigned
12717 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
12720 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
12722 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
12727 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
12732 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12735 * The secret corresponding to the per-commitment point
12737 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
12740 * The secret corresponding to the per-commitment point
12742 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12745 * The next sender-broadcast commitment transaction's per-commitment point
12747 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
12750 * The next sender-broadcast commitment transaction's per-commitment point
12752 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12755 * Constructs a new RevokeAndACK given each field
12757 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);
12760 * Creates a copy of the RevokeAndACK
12762 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
12765 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
12767 void UpdateFee_free(struct LDKUpdateFee this_obj);
12772 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
12777 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12780 * Fee rate per 1000-weight of the transaction
12782 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
12785 * Fee rate per 1000-weight of the transaction
12787 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
12790 * Constructs a new UpdateFee given each field
12792 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
12795 * Creates a copy of the UpdateFee
12797 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
12800 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
12802 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
12805 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
12806 * belonging to the recipient
12808 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
12811 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
12812 * belonging to the recipient
12814 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12817 * The sender's per-commitment point for their current commitment transaction
12819 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
12822 * The sender's per-commitment point for their current commitment transaction
12824 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12827 * Constructs a new DataLossProtect given each field
12829 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
12832 * Creates a copy of the DataLossProtect
12834 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
12837 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
12839 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
12844 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
12849 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12852 * The next commitment number for the sender
12854 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
12857 * The next commitment number for the sender
12859 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
12862 * The next commitment number for the recipient
12864 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
12867 * The next commitment number for the recipient
12869 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
12872 * Creates a copy of the ChannelReestablish
12874 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
12877 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
12879 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
12884 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
12889 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12892 * The short channel ID
12894 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
12897 * The short channel ID
12899 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
12902 * A signature by the node key
12904 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
12907 * A signature by the node key
12909 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
12912 * A signature by the funding key
12914 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
12917 * A signature by the funding key
12919 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
12922 * Constructs a new AnnouncementSignatures given each field
12924 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);
12927 * Creates a copy of the AnnouncementSignatures
12929 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
12932 * Frees any resources used by the NetAddress
12934 void NetAddress_free(struct LDKNetAddress this_ptr);
12937 * Creates a copy of the NetAddress
12939 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
12942 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
12944 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
12947 * Read a Result from a byte array, created by Result_write
12949 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
12952 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
12954 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
12957 * The advertised features
12959 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
12962 * The advertised features
12964 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
12967 * A strictly monotonic announcement counter, with gaps allowed
12969 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
12972 * A strictly monotonic announcement counter, with gaps allowed
12974 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
12977 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
12980 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
12983 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
12986 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12989 * An RGB color for UI purposes
12991 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
12994 * An RGB color for UI purposes
12996 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
12999 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
13002 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
13005 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
13008 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13011 * List of addresses on which this node is reachable
13013 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
13016 * Creates a copy of the UnsignedNodeAnnouncement
13018 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
13021 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
13023 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
13026 * The signature by the node key
13028 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
13031 * The signature by the node key
13033 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
13036 * The actual content of the announcement
13038 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
13041 * The actual content of the announcement
13043 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
13046 * Constructs a new NodeAnnouncement given each field
13048 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
13051 * Creates a copy of the NodeAnnouncement
13053 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
13056 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
13058 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
13061 * The advertised channel features
13063 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13066 * The advertised channel features
13068 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
13071 * The genesis hash of the blockchain where the channel is to be opened
13073 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
13076 * The genesis hash of the blockchain where the channel is to be opened
13078 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13081 * The short channel ID
13083 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13086 * The short channel ID
13088 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
13091 * One of the two node_ids which are endpoints of this channel
13093 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13096 * One of the two node_ids which are endpoints of this channel
13098 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13101 * The other of the two node_ids which are endpoints of this channel
13103 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13106 * The other of the two node_ids which are endpoints of this channel
13108 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13111 * The funding key for the first node
13113 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13116 * The funding key for the first node
13118 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13121 * The funding key for the second node
13123 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13126 * The funding key for the second node
13128 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13131 * Creates a copy of the UnsignedChannelAnnouncement
13133 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
13136 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
13138 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
13141 * Authentication of the announcement by the first public node
13143 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
13146 * Authentication of the announcement by the first public node
13148 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
13151 * Authentication of the announcement by the second public node
13153 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
13156 * Authentication of the announcement by the second public node
13158 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
13161 * Proof of funding UTXO ownership by the first public node
13163 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
13166 * Proof of funding UTXO ownership by the first public node
13168 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
13171 * Proof of funding UTXO ownership by the second public node
13173 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
13176 * Proof of funding UTXO ownership by the second public node
13178 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
13181 * The actual announcement
13183 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
13186 * The actual announcement
13188 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
13191 * Constructs a new ChannelAnnouncement given each field
13193 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);
13196 * Creates a copy of the ChannelAnnouncement
13198 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
13201 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
13203 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
13206 * The genesis hash of the blockchain where the channel is to be opened
13208 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
13211 * The genesis hash of the blockchain where the channel is to be opened
13213 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13216 * The short channel ID
13218 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13221 * The short channel ID
13223 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
13226 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
13228 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13231 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
13233 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
13238 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13243 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
13246 * The number of blocks such that if:
13247 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
13248 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
13249 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
13250 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
13251 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
13252 * forwarding. Note that the HTLC sender is the one who originally sets this value when
13253 * constructing the route.
13255 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13258 * The number of blocks such that if:
13259 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
13260 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
13261 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
13262 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
13263 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
13264 * forwarding. Note that the HTLC sender is the one who originally sets this value when
13265 * constructing the route.
13267 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
13270 * The minimum HTLC size incoming to sender, in milli-satoshi
13272 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13275 * The minimum HTLC size incoming to sender, in milli-satoshi
13277 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
13280 * The base HTLC fee charged by sender, in milli-satoshi
13282 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13285 * The base HTLC fee charged by sender, in milli-satoshi
13287 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
13290 * The amount to fee multiplier, in micro-satoshi
13292 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13295 * The amount to fee multiplier, in micro-satoshi
13297 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
13300 * Creates a copy of the UnsignedChannelUpdate
13302 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
13305 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
13307 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
13310 * A signature of the channel update
13312 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
13315 * A signature of the channel update
13317 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
13320 * The actual channel update
13322 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
13325 * The actual channel update
13327 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
13330 * Constructs a new ChannelUpdate given each field
13332 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
13335 * Creates a copy of the ChannelUpdate
13337 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
13340 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
13342 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
13345 * The genesis hash of the blockchain being queried
13347 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
13350 * The genesis hash of the blockchain being queried
13352 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13355 * The height of the first block for the channel UTXOs being queried
13357 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
13360 * The height of the first block for the channel UTXOs being queried
13362 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13365 * The number of blocks to include in the query results
13367 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
13370 * The number of blocks to include in the query results
13372 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13375 * Constructs a new QueryChannelRange given each field
13377 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
13380 * Creates a copy of the QueryChannelRange
13382 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
13385 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
13387 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
13390 * The genesis hash of the blockchain being queried
13392 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
13395 * The genesis hash of the blockchain being queried
13397 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13400 * The height of the first block in the range of the reply
13402 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
13405 * The height of the first block in the range of the reply
13407 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13410 * The number of blocks included in the range of the reply
13412 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
13415 * The number of blocks included in the range of the reply
13417 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13420 * True when this is the final reply for a query
13422 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
13425 * True when this is the final reply for a query
13427 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
13430 * The short_channel_ids in the channel range
13432 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
13435 * Constructs a new ReplyChannelRange given each field
13437 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);
13440 * Creates a copy of the ReplyChannelRange
13442 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
13445 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
13447 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
13450 * The genesis hash of the blockchain being queried
13452 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
13455 * The genesis hash of the blockchain being queried
13457 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13460 * The short_channel_ids that are being queried
13462 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
13465 * Constructs a new QueryShortChannelIds given each field
13467 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
13470 * Creates a copy of the QueryShortChannelIds
13472 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
13475 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
13477 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
13480 * The genesis hash of the blockchain that was queried
13482 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
13485 * The genesis hash of the blockchain that was queried
13487 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13490 * Indicates if the query recipient maintains up-to-date channel
13491 * information for the chain_hash
13493 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
13496 * Indicates if the query recipient maintains up-to-date channel
13497 * information for the chain_hash
13499 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
13502 * Constructs a new ReplyShortChannelIdsEnd given each field
13504 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
13507 * Creates a copy of the ReplyShortChannelIdsEnd
13509 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
13512 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
13514 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
13517 * The genesis hash of the blockchain for channel and node information
13519 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
13522 * The genesis hash of the blockchain for channel and node information
13524 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13527 * The starting unix timestamp
13529 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
13532 * The starting unix timestamp
13534 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
13537 * The range of information in seconds
13539 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
13542 * The range of information in seconds
13544 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
13547 * Constructs a new GossipTimestampFilter given each field
13549 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
13552 * Creates a copy of the GossipTimestampFilter
13554 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
13557 * Frees any resources used by the ErrorAction
13559 void ErrorAction_free(struct LDKErrorAction this_ptr);
13562 * Creates a copy of the ErrorAction
13564 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
13567 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
13569 void LightningError_free(struct LDKLightningError this_obj);
13572 * A human-readable message describing the error
13574 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
13577 * A human-readable message describing the error
13579 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
13582 * The action which should be taken against the offending peer.
13584 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
13587 * The action which should be taken against the offending peer.
13589 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
13592 * Constructs a new LightningError given each field
13594 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg);
13597 * Creates a copy of the LightningError
13599 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
13602 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
13604 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
13607 * update_add_htlc messages which should be sent
13609 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
13612 * update_fulfill_htlc messages which should be sent
13614 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
13617 * update_fail_htlc messages which should be sent
13619 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
13622 * update_fail_malformed_htlc messages which should be sent
13624 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
13627 * An update_fee message which should be sent
13629 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
13632 * An update_fee message which should be sent
13634 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
13637 * Finally, the commitment_signed message which should be sent
13639 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
13642 * Finally, the commitment_signed message which should be sent
13644 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
13647 * Constructs a new CommitmentUpdate given each field
13649 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);
13652 * Creates a copy of the CommitmentUpdate
13654 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
13657 * Frees any resources used by the HTLCFailChannelUpdate
13659 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
13662 * Creates a copy of the HTLCFailChannelUpdate
13664 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
13667 * Calls the free function if one is set
13669 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
13672 * Calls the free function if one is set
13674 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
13677 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
13679 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
13682 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
13684 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
13687 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
13689 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
13692 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
13694 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
13697 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
13699 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
13702 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
13704 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
13707 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
13709 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
13712 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
13714 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
13717 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
13719 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
13722 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
13724 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
13727 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
13729 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
13732 * Read a FundingCreated from a byte array, created by FundingCreated_write
13734 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
13737 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
13739 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
13742 * Read a FundingSigned from a byte array, created by FundingSigned_write
13744 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
13747 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
13749 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
13752 * Read a FundingLocked from a byte array, created by FundingLocked_write
13754 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
13757 * Serialize the Init object into a byte array which can be read by Init_read
13759 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
13762 * Read a Init from a byte array, created by Init_write
13764 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
13767 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
13769 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
13772 * Read a OpenChannel from a byte array, created by OpenChannel_write
13774 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
13777 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
13779 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
13782 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
13784 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
13787 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
13789 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
13792 * Read a Shutdown from a byte array, created by Shutdown_write
13794 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
13797 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
13799 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
13802 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
13804 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
13807 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
13809 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
13812 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
13814 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
13817 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
13819 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
13822 * Read a UpdateFee from a byte array, created by UpdateFee_write
13824 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
13827 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
13829 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
13832 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
13834 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
13837 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
13839 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
13842 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
13844 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
13847 * Serialize the Ping object into a byte array which can be read by Ping_read
13849 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
13852 * Read a Ping from a byte array, created by Ping_write
13854 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
13857 * Serialize the Pong object into a byte array which can be read by Pong_read
13859 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
13862 * Read a Pong from a byte array, created by Pong_write
13864 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
13867 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
13869 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
13872 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
13874 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
13877 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
13879 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
13882 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
13884 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
13887 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
13889 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
13892 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
13894 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
13897 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
13899 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
13902 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
13904 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
13907 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
13909 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
13912 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
13914 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
13917 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
13919 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
13922 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
13924 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
13927 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
13929 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
13932 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
13934 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
13937 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
13939 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
13942 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
13944 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
13947 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
13949 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
13952 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
13954 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
13957 *\n\t * Calculates the overflow safe ending block height for the query.\n\t * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`\n\t
13959 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
13962 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
13964 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
13967 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
13969 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
13972 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
13974 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
13977 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
13979 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
13982 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
13984 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
13987 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
13989 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
13992 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
13994 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
13997 * Constructs a new IgnoringMessageHandler given each field
13999 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
14002 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
14003 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
14005 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
14008 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
14009 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
14011 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
14014 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
14016 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
14019 * Constructs a new ErroringMessageHandler
14021 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
14024 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
14025 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
14027 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
14030 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
14031 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
14033 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
14036 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
14038 void MessageHandler_free(struct LDKMessageHandler this_obj);
14041 * A message handler which handles messages specific to channels. Usually this is just a
14042 * ChannelManager object or a ErroringMessageHandler.
14044 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
14047 * A message handler which handles messages specific to channels. Usually this is just a
14048 * ChannelManager object or a ErroringMessageHandler.
14050 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
14053 * A message handler which handles messages updating our knowledge of the network channel
14054 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
14056 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
14059 * A message handler which handles messages updating our knowledge of the network channel
14060 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
14062 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
14065 * Constructs a new MessageHandler given each field
14067 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
14070 * Creates a copy of a SocketDescriptor
14072 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
14075 * Calls the free function if one is set
14077 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
14080 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
14082 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
14085 * Used to indicate that we probably can't make any future connections to this peer, implying
14086 * we should go ahead and force-close any channels we have with it.
14088 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
14091 * Used to indicate that we probably can't make any future connections to this peer, implying
14092 * we should go ahead and force-close any channels we have with it.
14094 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
14097 * Constructs a new PeerHandleError given each field
14099 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
14102 * Creates a copy of the PeerHandleError
14104 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
14107 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
14109 void PeerManager_free(struct LDKPeerManager this_obj);
14112 * Constructs a new PeerManager with the given message handlers and node_id secret key
14113 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
14114 * cryptographically secure random bytes.
14116 MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, struct LDKSecretKey our_node_secret, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger);
14119 * Get the list of node ids for peers which have completed the initial handshake.
14121 * For outbound connections, this will be the same as the their_node_id parameter passed in to
14122 * new_outbound_connection, however entries will only appear once the initial handshake has
14123 * completed and we are sure the remote peer has the private key for the given node_id.
14125 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
14128 * Indicates a new outbound connection has been established to a node with the given node_id.
14129 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
14130 * descriptor but must disconnect the connection immediately.
14132 * Returns a small number of bytes to send to the remote node (currently always 50).
14134 * Panics if descriptor is duplicative with some other descriptor which has not yet had a
14135 * socket_disconnected().
14137 MUST_USE_RES struct LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKSocketDescriptor descriptor);
14140 * Indicates a new inbound connection has been established.
14142 * May refuse the connection by returning an Err, but will never write bytes to the remote end
14143 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
14144 * call socket_disconnected for the new descriptor but must disconnect the connection
14147 * Panics if descriptor is duplicative with some other descriptor which has not yet had
14148 * socket_disconnected called.
14150 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
14153 * Indicates that there is room to write data to the given socket descriptor.
14155 * May return an Err to indicate that the connection should be closed.
14157 * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
14158 * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
14159 * invariants around calling write_buffer_space_avail in case a write did not fully complete
14160 * must still hold - be ready to call write_buffer_space_avail again if a write call generated
14161 * here isn't sufficient! Panics if the descriptor was not previously registered in a
14162 * new_\\*_connection event.
14164 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
14167 * Indicates that data was read from the given socket descriptor.
14169 * May return an Err to indicate that the connection should be closed.
14171 * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
14172 * Thus, however, you almost certainly want to call process_events() after any read_event to
14173 * generate send_data calls to handle responses.
14175 * If Ok(true) is returned, further read_events should not be triggered until a send_data call
14176 * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
14178 * Panics if the descriptor was not previously registered in a new_*_connection event.
14180 MUST_USE_RES struct LDKCResult_boolPeerHandleErrorZ PeerManager_read_event(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR peer_descriptor, struct LDKu8slice data);
14183 * Checks for any events generated by our handlers and processes them. Includes sending most
14184 * response messages as well as messages generated by calls to handler functions directly (eg
14185 * functions like ChannelManager::process_pending_htlc_forward or send_payment).
14187 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
14190 * Indicates that the given socket descriptor's connection is now closed.
14192 * This must only be called if the socket has been disconnected by the peer or your own
14193 * decision to disconnect it and must NOT be called in any case where other parts of this
14194 * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
14197 * Panics if the descriptor was not previously registered in a successful new_*_connection event.
14199 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
14202 * Disconnect a peer given its node id.
14204 * Set no_connection_possible to true to prevent any further connection with this peer,
14205 * force-closing any channels we have with it.
14207 * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer,
14208 * so be careful about reentrancy issues.
14210 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
14213 * This function should be called roughly once every 30 seconds.
14214 * It will send pings to each peer and disconnect those which did not respond to the last round of pings.
14215 * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
14217 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
14220 * Build the commitment secret from the seed and the commitment number
14222 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
14225 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
14226 * from the base secret and the per_commitment_point.
14228 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
14229 * generated (ie our own).
14231 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
14234 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
14235 * from the base point and the per_commitment_key. This is the public equivalent of
14236 * derive_private_key - using only public keys to derive a public key instead of private keys.
14238 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
14239 * generated (ie our own).
14241 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
14244 * Derives a per-commitment-transaction revocation key from its constituent parts.
14246 * Only the cheating participant owns a valid witness to propagate a revoked
14247 * commitment transaction, thus per_commitment_secret always come from cheater
14248 * and revocation_base_secret always come from punisher, which is the broadcaster
14249 * of the transaction spending with this key knowledge.
14251 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
14252 * generated (ie our own).
14254 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
14257 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
14258 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
14259 * public key instead of private keys.
14261 * Only the cheating participant owns a valid witness to propagate a revoked
14262 * commitment transaction, thus per_commitment_point always come from cheater
14263 * and revocation_base_point always come from punisher, which is the broadcaster
14264 * of the transaction spending with this key knowledge.
14266 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
14267 * generated (ie our own).
14269 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
14272 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
14274 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
14277 * The broadcaster's per-commitment public key which was used to derive the other keys.
14279 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14282 * The broadcaster's per-commitment public key which was used to derive the other keys.
14284 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14287 * The revocation key which is used to allow the broadcaster of the commitment
14288 * transaction to provide their counterparty the ability to punish them if they broadcast
14291 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14294 * The revocation key which is used to allow the broadcaster of the commitment
14295 * transaction to provide their counterparty the ability to punish them if they broadcast
14298 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14301 * Broadcaster's HTLC Key
14303 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14306 * Broadcaster's HTLC Key
14308 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14311 * Countersignatory's HTLC Key
14313 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14316 * Countersignatory's HTLC Key
14318 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14321 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
14323 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14326 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
14328 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14331 * Constructs a new TxCreationKeys given each field
14333 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);
14336 * Creates a copy of the TxCreationKeys
14338 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
14341 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
14343 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
14346 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
14348 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
14351 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
14353 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
14356 * The public key which is used to sign all commitment transactions, as it appears in the
14357 * on-chain channel lock-in 2-of-2 multisig output.
14359 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14362 * The public key which is used to sign all commitment transactions, as it appears in the
14363 * on-chain channel lock-in 2-of-2 multisig output.
14365 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14368 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
14369 * revocation keys. This is combined with the per-commitment-secret generated by the
14370 * counterparty to create a secret which the counterparty can reveal to revoke previous
14373 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14376 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
14377 * revocation keys. This is combined with the per-commitment-secret generated by the
14378 * counterparty to create a secret which the counterparty can reveal to revoke previous
14381 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14384 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
14385 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
14386 * static across every commitment transaction.
14388 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14391 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
14392 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
14393 * static across every commitment transaction.
14395 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14398 * The base point which is used (with derive_public_key) to derive a per-commitment payment
14399 * public key which receives non-HTLC-encumbered funds which are only available for spending
14400 * after some delay (or can be claimed via the revocation path).
14402 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14405 * The base point which is used (with derive_public_key) to derive a per-commitment payment
14406 * public key which receives non-HTLC-encumbered funds which are only available for spending
14407 * after some delay (or can be claimed via the revocation path).
14409 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14412 * The base point which is used (with derive_public_key) to derive a per-commitment public key
14413 * which is used to encumber HTLC-in-flight outputs.
14415 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14418 * The base point which is used (with derive_public_key) to derive a per-commitment public key
14419 * which is used to encumber HTLC-in-flight outputs.
14421 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14424 * Constructs a new ChannelPublicKeys given each field
14426 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);
14429 * Creates a copy of the ChannelPublicKeys
14431 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
14434 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
14436 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
14439 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
14441 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
14444 * Create per-state keys from channel base points and the per-commitment point.
14445 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
14447 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);
14450 * Generate per-state keys from channel static keys.
14451 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
14453 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);
14456 * A script either spendable by the revocation
14457 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
14458 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
14460 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
14463 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
14465 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
14468 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
14469 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
14470 * need to compare this value to whether the commitment transaction in question is that of
14471 * the counterparty or our own.
14473 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14476 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
14477 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
14478 * need to compare this value to whether the commitment transaction in question is that of
14479 * the counterparty or our own.
14481 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
14484 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
14485 * this divided by 1000.
14487 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14490 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
14491 * this divided by 1000.
14493 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
14496 * The CLTV lock-time at which this HTLC expires.
14498 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14501 * The CLTV lock-time at which this HTLC expires.
14503 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
14506 * The hash of the preimage which unlocks this HTLC.
14508 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
14511 * The hash of the preimage which unlocks this HTLC.
14513 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14516 * The position within the commitment transactions' outputs. This may be None if the value is
14517 * below the dust limit (in which case no output appears in the commitment transaction and the
14518 * value is spent to additional transaction fees).
14520 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14523 * The position within the commitment transactions' outputs. This may be None if the value is
14524 * below the dust limit (in which case no output appears in the commitment transaction and the
14525 * value is spent to additional transaction fees).
14527 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
14530 * Constructs a new HTLCOutputInCommitment given each field
14532 MUST_USE_RES struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_new(bool offered_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u32Z transaction_output_index_arg);
14535 * Creates a copy of the HTLCOutputInCommitment
14537 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
14540 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
14542 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
14545 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
14547 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
14550 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
14551 * does not need to have its previous_output_index filled.
14553 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
14556 * Gets the redeemscript for a funding output from the two funding public keys.
14557 * Note that the order of funding public keys does not matter.
14559 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
14562 * panics if htlc.transaction_output_index.is_none()!
14564 struct LDKTransaction build_htlc_transaction(const uint8_t (*prev_hash)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
14567 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
14569 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
14572 * Holder public keys
14574 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14577 * Holder public keys
14579 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
14582 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
14584 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14587 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
14589 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
14592 * Whether the holder is the initiator of this channel.
14593 * This is an input to the commitment number obscure factor computation.
14595 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14598 * Whether the holder is the initiator of this channel.
14599 * This is an input to the commitment number obscure factor computation.
14601 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
14604 * The late-bound counterparty channel transaction parameters.
14605 * These parameters are populated at the point in the protocol where the counterparty provides them.
14607 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14610 * The late-bound counterparty channel transaction parameters.
14611 * These parameters are populated at the point in the protocol where the counterparty provides them.
14613 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
14616 * The late-bound funding outpoint
14618 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14621 * The late-bound funding outpoint
14623 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
14626 * Constructs a new ChannelTransactionParameters given each field
14628 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);
14631 * Creates a copy of the ChannelTransactionParameters
14633 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
14636 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
14638 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
14641 * Counter-party public keys
14643 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
14646 * Counter-party public keys
14648 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
14651 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
14653 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
14656 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
14658 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
14661 * Constructs a new CounterpartyChannelTransactionParameters given each field
14663 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
14666 * Creates a copy of the CounterpartyChannelTransactionParameters
14668 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
14671 * Whether the late bound parameters are populated.
14673 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
14676 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
14677 * given that the holder is the broadcaster.
14679 * self.is_populated() must be true before calling this function.
14681 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
14684 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
14685 * given that the counterparty is the broadcaster.
14687 * self.is_populated() must be true before calling this function.
14689 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
14692 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
14694 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
14697 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
14699 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
14702 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
14704 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
14707 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
14709 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
14712 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
14714 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
14717 * Get the channel pubkeys for the broadcaster
14719 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14722 * Get the channel pubkeys for the countersignatory
14724 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14727 * Get the contest delay applicable to the transactions.
14728 * Note that the contest delay was selected by the countersignatory.
14730 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14733 * Whether the channel is outbound from the broadcaster.
14735 * The boolean representing the side that initiated the channel is
14736 * an input to the commitment number obscure factor computation.
14738 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14741 * The funding outpoint
14743 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14746 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
14748 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
14751 * Our counterparty's signature for the transaction
14753 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
14756 * Our counterparty's signature for the transaction
14758 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
14761 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
14763 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
14766 * Creates a copy of the HolderCommitmentTransaction
14768 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
14771 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
14773 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
14776 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
14778 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
14781 * Create a new holder transaction with the given counterparty signatures.
14782 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
14784 MUST_USE_RES struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_new(struct LDKCommitmentTransaction commitment_tx, struct LDKSignature counterparty_sig, struct LDKCVec_SignatureZ counterparty_htlc_sigs, struct LDKPublicKey holder_funding_key, struct LDKPublicKey counterparty_funding_key);
14787 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
14789 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
14792 * The commitment transaction
14794 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
14797 * The commitment transaction
14799 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
14802 * The txid for the commitment transaction.
14804 * This is provided as a performance optimization, instead of calling transaction.txid()
14807 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
14810 * The txid for the commitment transaction.
14812 * This is provided as a performance optimization, instead of calling transaction.txid()
14815 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14818 * Constructs a new BuiltCommitmentTransaction given each field
14820 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
14823 * Creates a copy of the BuiltCommitmentTransaction
14825 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
14828 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
14830 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
14833 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
14835 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
14838 * Get the SIGHASH_ALL sighash value of the transaction.
14840 * This can be used to verify a signature.
14842 MUST_USE_RES struct LDKThirtyTwoBytes BuiltCommitmentTransaction_get_sighash_all(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
14845 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
14846 * because we are about to broadcast a holder transaction.
14848 MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
14851 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
14853 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
14856 * Creates a copy of the CommitmentTransaction
14858 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
14861 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
14863 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
14866 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
14868 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
14871 * The backwards-counting commitment number
14873 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14876 * The value to be sent to the broadcaster
14878 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14881 * The value to be sent to the counterparty
14883 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14886 * The feerate paid per 1000-weight-unit in this commitment transaction.
14888 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14891 * Trust our pre-built transaction and derived transaction creation public keys.
14893 * Applies a wrapper which allows access to these fields.
14895 * This should only be used if you fully trust the builder of this object. It should not
14896 *\tbe used by an external signer - instead use the verify function.
14898 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14901 * Verify our pre-built transaction and derived transaction creation public keys.
14903 * Applies a wrapper which allows access to these fields.
14905 * An external validating signer must call this method before signing
14906 * or using the built transaction.
14908 MUST_USE_RES struct LDKCResult_TrustedCommitmentTransactionNoneZ CommitmentTransaction_verify(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg, const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys);
14911 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
14913 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
14916 * The transaction ID of the built Bitcoin transaction
14918 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
14921 * The pre-built Bitcoin commitment transaction
14923 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
14926 * The pre-calculated transaction creation public keys.
14928 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
14931 * Get a signature for each HTLC which was included in the commitment transaction (ie for
14932 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
14934 * The returned Vec has one entry for each HTLC, and in the same order.
14936 MUST_USE_RES struct LDKCResult_CVec_SignatureZNoneZ TrustedCommitmentTransaction_get_htlc_sigs(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*htlc_base_key)[32], const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters);
14939 * Get the transaction number obscure factor
14941 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
14944 * Creates a copy of the InitFeatures
14946 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
14949 * Creates a copy of the NodeFeatures
14951 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
14954 * Creates a copy of the ChannelFeatures
14956 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
14959 * Creates a copy of the InvoiceFeatures
14961 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
14964 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
14966 void InitFeatures_free(struct LDKInitFeatures this_obj);
14969 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
14971 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
14974 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
14976 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
14979 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
14981 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
14984 * Create a blank Features with no features set
14986 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
14989 * Creates a Features with the bits set which are known by the implementation
14991 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
14994 * Create a blank Features with no features set
14996 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
14999 * Creates a Features with the bits set which are known by the implementation
15001 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
15004 * Create a blank Features with no features set
15006 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
15009 * Creates a Features with the bits set which are known by the implementation
15011 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
15014 * Create a blank Features with no features set
15016 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
15019 * Creates a Features with the bits set which are known by the implementation
15021 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
15024 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
15026 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
15029 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
15031 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
15034 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
15036 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
15039 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
15041 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
15044 * Read a InitFeatures from a byte array, created by InitFeatures_write
15046 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
15049 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
15051 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
15054 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
15056 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
15059 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
15061 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
15064 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
15066 void RouteHop_free(struct LDKRouteHop this_obj);
15069 * The node_id of the node at this hop.
15071 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15074 * The node_id of the node at this hop.
15076 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15079 * The node_announcement features of the node at this hop. For the last hop, these may be
15080 * amended to match the features present in the invoice this node generated.
15082 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15085 * The node_announcement features of the node at this hop. For the last hop, these may be
15086 * amended to match the features present in the invoice this node generated.
15088 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
15091 * The channel that should be used from the previous hop to reach this node.
15093 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15096 * The channel that should be used from the previous hop to reach this node.
15098 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
15101 * The channel_announcement features of the channel that should be used from the previous hop
15102 * to reach this node.
15104 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15107 * The channel_announcement features of the channel that should be used from the previous hop
15108 * to reach this node.
15110 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
15113 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
15114 * For the last hop, this should be the full value of the payment (might be more than
15115 * requested if we had to match htlc_minimum_msat).
15117 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15120 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
15121 * For the last hop, this should be the full value of the payment (might be more than
15122 * requested if we had to match htlc_minimum_msat).
15124 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
15127 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
15128 * expected at the destination, in excess of the current block height.
15130 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15133 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
15134 * expected at the destination, in excess of the current block height.
15136 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
15139 * Constructs a new RouteHop given each field
15141 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);
15144 * Creates a copy of the RouteHop
15146 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
15149 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
15151 void Route_free(struct LDKRoute this_obj);
15154 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
15155 * last RouteHop in each path must be the same.
15156 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
15157 * destination. Thus, this must always be at least length one. While the maximum length of any
15158 * given path is variable, keeping the length of any path to less than 20 should currently
15159 * ensure it is viable.
15161 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
15164 * Constructs a new Route given each field
15166 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
15169 * Creates a copy of the Route
15171 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
15174 * Serialize the Route object into a byte array which can be read by Route_read
15176 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
15179 * Read a Route from a byte array, created by Route_write
15181 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
15184 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
15186 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
15189 * The node_id of the non-target end of the route
15191 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
15194 * The node_id of the non-target end of the route
15196 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15199 * The short_channel_id of this channel
15201 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
15204 * The short_channel_id of this channel
15206 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
15209 * The fees which must be paid to use this channel
15211 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
15214 * The fees which must be paid to use this channel
15216 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
15219 * The difference in CLTV values between this node and the next node.
15221 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
15224 * The difference in CLTV values between this node and the next node.
15226 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
15229 * The minimum value, in msat, which must be relayed to the next hop.
15231 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
15234 * The minimum value, in msat, which must be relayed to the next hop.
15236 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15239 * The maximum value in msat available for routing with a single HTLC.
15241 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
15244 * The maximum value in msat available for routing with a single HTLC.
15246 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15249 * Constructs a new RouteHintHop given each field
15251 MUST_USE_RES struct LDKRouteHintHop RouteHintHop_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg);
15254 * Creates a copy of the RouteHintHop
15256 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
15259 * Gets a route from us (payer) to the given target node (payee).
15261 * If the payee provided features in their invoice, they should be provided via payee_features.
15262 * Without this, MPP will only be used if the payee's features are available in the network graph.
15264 * Extra routing hops between known nodes and the target will be used if they are included in
15267 * If some channels aren't announced, it may be useful to fill in a first_hops with the
15268 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
15269 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
15270 * in first_hops will be used.
15272 * Panics if first_hops contains channels without short_channel_ids
15273 * (ChannelManager::list_usable_channels will never include such channels).
15275 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
15276 * equal), however the enabled/disabled bit on such channels as well as the
15277 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
15279 struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintHopZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
15282 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
15284 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
15287 * Creates a copy of the NetworkGraph
15289 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
15292 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
15294 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
15297 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
15299 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
15302 * Creates a new tracker of the actual state of the network of channels and nodes,
15303 * assuming a fresh network graph.
15304 * Chain monitor is used to make sure announced channels exist on-chain,
15305 * channel data is correct, and that the announcement is signed with
15306 * channel owners' keys.
15308 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
15311 * Creates a new tracker of the actual state of the network of channels and nodes,
15312 * assuming an existing Network Graph.
15314 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
15317 * Adds a provider used to check new announcements. Does not affect
15318 * existing announcements unless they are updated.
15319 * Add, update or remove the provider would replace the current one.
15321 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
15324 * Take a read lock on the network_graph and return it in the C-bindings
15325 * newtype helper. This is likely only useful when called via the C
15326 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
15329 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
15332 * Get a reference to the NetworkGraph which this read-lock contains.
15334 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
15337 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
15338 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
15340 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
15343 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
15344 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
15346 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
15349 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
15351 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
15354 * When the last update to the channel direction was issued.
15355 * Value is opaque, as set in the announcement.
15357 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15360 * When the last update to the channel direction was issued.
15361 * Value is opaque, as set in the announcement.
15363 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
15366 * Whether the channel can be currently used for payments (in this one direction).
15368 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15371 * Whether the channel can be currently used for payments (in this one direction).
15373 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
15376 * The difference in CLTV values that you must have when routing through this channel.
15378 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15381 * The difference in CLTV values that you must have when routing through this channel.
15383 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
15386 * The minimum value, which must be relayed to the next hop via the channel
15388 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15391 * The minimum value, which must be relayed to the next hop via the channel
15393 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
15396 * The maximum value which may be relayed to the next hop via the channel.
15398 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15401 * The maximum value which may be relayed to the next hop via the channel.
15403 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15406 * Fees charged when the channel is used for routing
15408 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15411 * Fees charged when the channel is used for routing
15413 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
15416 * Most recent update for the channel received from the network
15417 * Mostly redundant with the data we store in fields explicitly.
15418 * Everything else is useful only for sending out for initial routing sync.
15419 * Not stored if contains excess data to prevent DoS.
15421 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15424 * Most recent update for the channel received from the network
15425 * Mostly redundant with the data we store in fields explicitly.
15426 * Everything else is useful only for sending out for initial routing sync.
15427 * Not stored if contains excess data to prevent DoS.
15429 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
15432 * Constructs a new DirectionalChannelInfo given each field
15434 MUST_USE_RES struct LDKDirectionalChannelInfo DirectionalChannelInfo_new(uint32_t last_update_arg, bool enabled_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, struct LDKChannelUpdate last_update_message_arg);
15437 * Creates a copy of the DirectionalChannelInfo
15439 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
15442 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
15444 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
15447 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
15449 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
15452 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
15454 void ChannelInfo_free(struct LDKChannelInfo this_obj);
15457 * Protocol features of a channel communicated during its announcement
15459 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15462 * Protocol features of a channel communicated during its announcement
15464 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
15467 * Source node of the first direction of a channel
15469 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15472 * Source node of the first direction of a channel
15474 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15477 * Details about the first direction of a channel
15479 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15482 * Details about the first direction of a channel
15484 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
15487 * Source node of the second direction of a channel
15489 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15492 * Source node of the second direction of a channel
15494 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15497 * Details about the second direction of a channel
15499 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15502 * Details about the second direction of a channel
15504 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
15507 * The channel capacity as seen on-chain, if chain lookup is available.
15509 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15512 * The channel capacity as seen on-chain, if chain lookup is available.
15514 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15517 * An initial announcement of the channel
15518 * Mostly redundant with the data we store in fields explicitly.
15519 * Everything else is useful only for sending out for initial routing sync.
15520 * Not stored if contains excess data to prevent DoS.
15522 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15525 * An initial announcement of the channel
15526 * Mostly redundant with the data we store in fields explicitly.
15527 * Everything else is useful only for sending out for initial routing sync.
15528 * Not stored if contains excess data to prevent DoS.
15530 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
15533 * Constructs a new ChannelInfo given each field
15535 MUST_USE_RES struct LDKChannelInfo ChannelInfo_new(struct LDKChannelFeatures features_arg, struct LDKPublicKey node_one_arg, struct LDKDirectionalChannelInfo one_to_two_arg, struct LDKPublicKey node_two_arg, struct LDKDirectionalChannelInfo two_to_one_arg, struct LDKCOption_u64Z capacity_sats_arg, struct LDKChannelAnnouncement announcement_message_arg);
15538 * Creates a copy of the ChannelInfo
15540 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
15543 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
15545 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
15548 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
15550 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
15553 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
15555 void RoutingFees_free(struct LDKRoutingFees this_obj);
15558 * Flat routing fee in satoshis
15560 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
15563 * Flat routing fee in satoshis
15565 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
15568 * Liquidity-based routing fee in millionths of a routed amount.
15569 * In other words, 10000 is 1%.
15571 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
15574 * Liquidity-based routing fee in millionths of a routed amount.
15575 * In other words, 10000 is 1%.
15577 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
15580 * Constructs a new RoutingFees given each field
15582 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
15585 * Creates a copy of the RoutingFees
15587 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
15590 * Read a RoutingFees from a byte array, created by RoutingFees_write
15592 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
15595 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
15597 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
15600 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
15602 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
15605 * Protocol features the node announced support for
15607 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
15610 * Protocol features the node announced support for
15612 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
15615 * When the last known update to the node state was issued.
15616 * Value is opaque, as set in the announcement.
15618 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
15621 * When the last known update to the node state was issued.
15622 * Value is opaque, as set in the announcement.
15624 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
15627 * Color assigned to the node
15629 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
15632 * Color assigned to the node
15634 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
15637 * Moniker assigned to the node.
15638 * May be invalid or malicious (eg control chars),
15639 * should not be exposed to the user.
15641 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
15644 * Moniker assigned to the node.
15645 * May be invalid or malicious (eg control chars),
15646 * should not be exposed to the user.
15648 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15651 * Internet-level addresses via which one can connect to the node
15653 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
15656 * An initial announcement of the node
15657 * Mostly redundant with the data we store in fields explicitly.
15658 * Everything else is useful only for sending out for initial routing sync.
15659 * Not stored if contains excess data to prevent DoS.
15661 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
15664 * An initial announcement of the node
15665 * Mostly redundant with the data we store in fields explicitly.
15666 * Everything else is useful only for sending out for initial routing sync.
15667 * Not stored if contains excess data to prevent DoS.
15669 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
15672 * Constructs a new NodeAnnouncementInfo given each field
15674 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);
15677 * Creates a copy of the NodeAnnouncementInfo
15679 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
15682 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
15684 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
15687 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
15689 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
15692 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
15694 void NodeInfo_free(struct LDKNodeInfo this_obj);
15697 * All valid channels a node has announced
15699 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
15702 * Lowest fees enabling routing via any of the enabled, known channels to a node.
15703 * The two fields (flat and proportional fee) are independent,
15704 * meaning they don't have to refer to the same channel.
15706 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
15709 * Lowest fees enabling routing via any of the enabled, known channels to a node.
15710 * The two fields (flat and proportional fee) are independent,
15711 * meaning they don't have to refer to the same channel.
15713 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
15716 * More information about a node from node_announcement.
15717 * Optional because we store a Node entry after learning about it from
15718 * a channel announcement, but before receiving a node announcement.
15720 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
15723 * More information about a node from node_announcement.
15724 * Optional because we store a Node entry after learning about it from
15725 * a channel announcement, but before receiving a node announcement.
15727 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
15730 * Constructs a new NodeInfo given each field
15732 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
15735 * Creates a copy of the NodeInfo
15737 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
15740 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
15742 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
15745 * Read a NodeInfo from a byte array, created by NodeInfo_write
15747 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
15750 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
15752 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
15755 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
15757 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
15760 * Creates a new, empty, network graph.
15762 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
15765 * For an already known node (from channel announcements), update its stored properties from a
15766 * given node announcement.
15768 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
15769 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
15770 * routing messages from a source using a protocol other than the lightning P2P protocol.
15772 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
15775 * For an already known node (from channel announcements), update its stored properties from a
15776 * given node announcement without verifying the associated signatures. Because we aren't
15777 * given the associated signatures here we cannot relay the node announcement to any of our
15780 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
15783 * Store or update channel info from a channel announcement.
15785 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
15786 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
15787 * routing messages from a source using a protocol other than the lightning P2P protocol.
15789 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
15790 * the corresponding UTXO exists on chain and is correctly-formatted.
15792 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKAccess *chain_access);
15795 * Store or update channel info from a channel announcement without verifying the associated
15796 * signatures. Because we aren't given the associated signatures here we cannot relay the
15797 * channel announcement to any of our peers.
15799 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
15800 * the corresponding UTXO exists on chain and is correctly-formatted.
15802 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKAccess *chain_access);
15805 * Close a channel if a corresponding HTLC fail was sent.
15806 * If permanent, removes a channel from the local storage.
15807 * May cause the removal of nodes too, if this was their last channel.
15808 * If not permanent, makes channels unavailable for routing.
15810 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
15813 * For an already known (from announcement) channel, update info about one of the directions
15816 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
15817 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
15818 * routing messages from a source using a protocol other than the lightning P2P protocol.
15820 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
15823 * For an already known (from announcement) channel, update info about one of the directions
15824 * of the channel without verifying the associated signatures. Because we aren't given the
15825 * associated signatures here we cannot relay the channel update to any of our peers.
15827 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
15830 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
15832 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
15835 * Initialize a new FilesystemPersister and set the path to the individual channels'
15838 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKCVec_u8Z path_to_channel_data);
15841 * Get the directory which was provided when this persister was initialized.
15843 MUST_USE_RES struct LDKCVec_u8Z FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
15846 * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
15847 * initialization, within a file called \"manager\".
15849 MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKCVec_u8Z data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
15852 * Read `ChannelMonitor`s from disk.
15854 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
15857 * Constructs a new Persist which calls the relevant methods on this_arg.
15858 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
15860 struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
15862 #endif /* LDK_C_BINDINGS_H */