1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
4 /* Generated with cbindgen:0.19.0 */
6 /* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
11 #include <ldk_rust_types.h>
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 * Errors that may occur when constructing a new `RawInvoice` or `Invoice`
127 typedef enum LDKCreationError {
129 * The supplied description string was longer than 639 __bytes__ (see [`Description::new(…)`](./struct.Description.html#method.new))
131 LDKCreationError_DescriptionTooLong,
133 * The specified route has too many hops and can't be encoded
135 LDKCreationError_RouteTooLong,
137 * The unix timestamp of the supplied date is <0 or can't be represented as `SystemTime`
139 LDKCreationError_TimestampOutOfBounds,
141 * The supplied expiry time could cause an overflow if added to a `PositiveTimestamp`
143 LDKCreationError_ExpiryTimeOutOfBounds,
145 * Must be last for serialization purposes
147 LDKCreationError_Sentinel,
151 * Enum representing the crypto currencies (or networks) supported by this library
153 typedef enum LDKCurrency {
161 LDKCurrency_BitcoinTestnet,
175 * Must be last for serialization purposes
177 LDKCurrency_Sentinel,
181 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
183 typedef enum LDKIOError {
185 LDKIOError_PermissionDenied,
186 LDKIOError_ConnectionRefused,
187 LDKIOError_ConnectionReset,
188 LDKIOError_ConnectionAborted,
189 LDKIOError_NotConnected,
190 LDKIOError_AddrInUse,
191 LDKIOError_AddrNotAvailable,
192 LDKIOError_BrokenPipe,
193 LDKIOError_AlreadyExists,
194 LDKIOError_WouldBlock,
195 LDKIOError_InvalidInput,
196 LDKIOError_InvalidData,
198 LDKIOError_WriteZero,
199 LDKIOError_Interrupted,
201 LDKIOError_UnexpectedEof,
203 * Must be last for serialization purposes
209 * An enum representing the available verbosity levels of the logger.
211 typedef enum LDKLevel {
213 *Designates logger being silent
217 * Designates very serious errors
221 * Designates hazardous situations
225 * Designates useful information
229 * Designates lower priority information
233 * Designates very low priority, often extremely verbose, information
237 * Must be last for serialization purposes
243 * An enum representing the possible Bitcoin or test networks which we can run on
245 typedef enum LDKNetwork {
247 * The main Bitcoin blockchain.
251 * The testnet3 blockchain.
255 * A local test blockchain.
259 * A blockchain on which blocks are signed instead of mined.
263 * Must be last for serialization purposes
269 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
271 typedef enum LDKSecp256k1Error {
273 * Signature failed verification
275 LDKSecp256k1Error_IncorrectSignature,
277 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
279 LDKSecp256k1Error_InvalidMessage,
283 LDKSecp256k1Error_InvalidPublicKey,
287 LDKSecp256k1Error_InvalidSignature,
291 LDKSecp256k1Error_InvalidSecretKey,
295 LDKSecp256k1Error_InvalidRecoveryId,
297 * Invalid tweak for add_assign or mul_assign
299 LDKSecp256k1Error_InvalidTweak,
301 * tweak_add_check failed on an xonly public key
303 LDKSecp256k1Error_TweakCheckFailed,
305 * Didn't pass enough memory to context creation with preallocated memory
307 LDKSecp256k1Error_NotEnoughMemory,
309 * Must be last for serialization purposes
311 LDKSecp256k1Error_Sentinel,
315 * Errors that may occur when converting a `RawInvoice` to an `Invoice`. They relate to the
316 * requirements sections in BOLT #11
318 typedef enum LDKSemanticError {
320 * The invoice is missing the mandatory payment hash
322 LDKSemanticError_NoPaymentHash,
324 * The invoice has multiple payment hashes which isn't allowed
326 LDKSemanticError_MultiplePaymentHashes,
328 * No description or description hash are part of the invoice
330 LDKSemanticError_NoDescription,
332 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
334 LDKSemanticError_MultipleDescriptions,
336 * The invoice contains multiple payment secrets
338 LDKSemanticError_MultiplePaymentSecrets,
340 * The invoice's features are invalid
342 LDKSemanticError_InvalidFeatures,
344 * The recovery id doesn't fit the signature/pub key
346 LDKSemanticError_InvalidRecoveryId,
348 * The invoice's signature is invalid
350 LDKSemanticError_InvalidSignature,
352 * Must be last for serialization purposes
354 LDKSemanticError_Sentinel,
358 * SI prefixes for the human readable part
360 typedef enum LDKSiPrefix {
378 * Must be last for serialization purposes
380 LDKSiPrefix_Sentinel,
384 * A Rust str object, ie a reference to a UTF8-valid string.
385 * This is *not* null-terminated so cannot be used directly as a C string!
387 typedef struct LDKStr {
389 * A pointer to the string's bytes, in UTF8 encoding
391 const uint8_t *chars;
393 * The number of bytes (not characters!) pointed to by `chars`
397 * Whether the data pointed to by `chars` should be freed or not.
403 * A serialized transaction, in (pointer, length) form.
405 * This type optionally owns its own memory, and thus the semantics around access change based on
406 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
407 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
408 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
409 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
410 * you would be invalid.
412 * Note that, while it may change in the future, because transactions on the Rust side are stored
413 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
414 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
415 * `data_is_owned` either set or unset at your discretion.
417 typedef struct LDKTransaction {
419 * The serialized transaction data.
421 * This is non-const for your convenience, an object passed to Rust is never written to.
425 * The length of the serialized transaction
429 * Whether the data pointed to by `data` should be freed or not.
435 * A dynamically-allocated array of u8s of arbitrary size.
436 * This corresponds to std::vector in C++
438 typedef struct LDKCVec_u8Z {
440 * The elements in the array.
441 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
445 * The number of elements pointed to by `data`.
451 * A transaction output including a scriptPubKey and value.
452 * This type *does* own its own memory, so must be free'd appropriately.
454 typedef struct LDKTxOut {
456 * The script_pubkey in this output
458 struct LDKCVec_u8Z script_pubkey;
460 * The value, in satoshis, of this output
466 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
468 typedef struct LDKSecretKey {
470 * The bytes of the secret key
476 * The contents of CResult_SecretKeyErrorZ
478 typedef union LDKCResult_SecretKeyErrorZPtr {
480 * A pointer to the contents in the success state.
481 * Reading from this pointer when `result_ok` is not set is undefined.
483 struct LDKSecretKey *result;
485 * A pointer to the contents in the error state.
486 * Reading from this pointer when `result_ok` is set is undefined.
488 enum LDKSecp256k1Error *err;
489 } LDKCResult_SecretKeyErrorZPtr;
492 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
493 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
494 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
496 typedef struct LDKCResult_SecretKeyErrorZ {
498 * The contents of this CResult_SecretKeyErrorZ, accessible via either
499 * `err` or `result` depending on the state of `result_ok`.
501 union LDKCResult_SecretKeyErrorZPtr contents;
503 * Whether this CResult_SecretKeyErrorZ represents a success state.
506 } LDKCResult_SecretKeyErrorZ;
509 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
511 typedef struct LDKPublicKey {
513 * The bytes of the public key
515 uint8_t compressed_form[33];
519 * The contents of CResult_PublicKeyErrorZ
521 typedef union LDKCResult_PublicKeyErrorZPtr {
523 * A pointer to the contents in the success state.
524 * Reading from this pointer when `result_ok` is not set is undefined.
526 struct LDKPublicKey *result;
528 * A pointer to the contents in the error state.
529 * Reading from this pointer when `result_ok` is set is undefined.
531 enum LDKSecp256k1Error *err;
532 } LDKCResult_PublicKeyErrorZPtr;
535 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
536 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
537 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
539 typedef struct LDKCResult_PublicKeyErrorZ {
541 * The contents of this CResult_PublicKeyErrorZ, accessible via either
542 * `err` or `result` depending on the state of `result_ok`.
544 union LDKCResult_PublicKeyErrorZPtr contents;
546 * Whether this CResult_PublicKeyErrorZ represents a success state.
549 } LDKCResult_PublicKeyErrorZ;
554 * The set of public keys which are used in the creation of one commitment transaction.
555 * These are derived from the channel base keys and per-commitment data.
557 * A broadcaster key is provided from potential broadcaster of the computed transaction.
558 * A countersignatory key is coming from a protocol participant unable to broadcast the
561 * These keys are assumed to be good, either because the code derived them from
562 * channel basepoints via the new function, or they were obtained via
563 * CommitmentTransaction.trust().keys() because we trusted the source of the
564 * pre-calculated keys.
566 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
568 * A pointer to the opaque Rust object.
569 * Nearly everywhere, inner must be non-null, however in places where
570 * the Rust equivalent takes an Option, it may be set to null to indicate None.
572 LDKnativeTxCreationKeys *inner;
574 * Indicates that this is the only struct which contains the same pointer.
575 * Rust functions which take ownership of an object provided via an argument require
576 * this to be true and invalidate the object pointed to by inner.
584 * An error in decoding a message or struct.
586 typedef struct MUST_USE_STRUCT LDKDecodeError {
588 * A pointer to the opaque Rust object.
589 * Nearly everywhere, inner must be non-null, however in places where
590 * the Rust equivalent takes an Option, it may be set to null to indicate None.
592 LDKnativeDecodeError *inner;
594 * Indicates that this is the only struct which contains the same pointer.
595 * Rust functions which take ownership of an object provided via an argument require
596 * this to be true and invalidate the object pointed to by inner.
602 * The contents of CResult_TxCreationKeysDecodeErrorZ
604 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
606 * A pointer to the contents in the success state.
607 * Reading from this pointer when `result_ok` is not set is undefined.
609 struct LDKTxCreationKeys *result;
611 * A pointer to the contents in the error state.
612 * Reading from this pointer when `result_ok` is set is undefined.
614 struct LDKDecodeError *err;
615 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
618 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
619 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
620 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
622 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
624 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
625 * `err` or `result` depending on the state of `result_ok`.
627 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
629 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
632 } LDKCResult_TxCreationKeysDecodeErrorZ;
637 * One counterparty's public keys which do not change over the life of a channel.
639 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
641 * A pointer to the opaque Rust object.
642 * Nearly everywhere, inner must be non-null, however in places where
643 * the Rust equivalent takes an Option, it may be set to null to indicate None.
645 LDKnativeChannelPublicKeys *inner;
647 * Indicates that this is the only struct which contains the same pointer.
648 * Rust functions which take ownership of an object provided via an argument require
649 * this to be true and invalidate the object pointed to by inner.
652 } LDKChannelPublicKeys;
655 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
657 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
659 * A pointer to the contents in the success state.
660 * Reading from this pointer when `result_ok` is not set is undefined.
662 struct LDKChannelPublicKeys *result;
664 * A pointer to the contents in the error state.
665 * Reading from this pointer when `result_ok` is set is undefined.
667 struct LDKDecodeError *err;
668 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
671 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
672 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
673 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
675 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
677 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
678 * `err` or `result` depending on the state of `result_ok`.
680 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
682 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
685 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
688 * The contents of CResult_TxCreationKeysErrorZ
690 typedef union LDKCResult_TxCreationKeysErrorZPtr {
692 * A pointer to the contents in the success state.
693 * Reading from this pointer when `result_ok` is not set is undefined.
695 struct LDKTxCreationKeys *result;
697 * A pointer to the contents in the error state.
698 * Reading from this pointer when `result_ok` is set is undefined.
700 enum LDKSecp256k1Error *err;
701 } LDKCResult_TxCreationKeysErrorZPtr;
704 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
705 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
706 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
708 typedef struct LDKCResult_TxCreationKeysErrorZ {
710 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
711 * `err` or `result` depending on the state of `result_ok`.
713 union LDKCResult_TxCreationKeysErrorZPtr contents;
715 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
718 } LDKCResult_TxCreationKeysErrorZ;
721 * An enum which can either contain a u32 or not
723 typedef enum LDKCOption_u32Z_Tag {
725 * When we're in this state, this COption_u32Z contains a u32
727 LDKCOption_u32Z_Some,
729 * When we're in this state, this COption_u32Z contains nothing
731 LDKCOption_u32Z_None,
733 * Must be last for serialization purposes
735 LDKCOption_u32Z_Sentinel,
736 } LDKCOption_u32Z_Tag;
738 typedef struct LDKCOption_u32Z {
739 LDKCOption_u32Z_Tag tag;
750 * Information about an HTLC as it appears in a commitment transaction
752 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
754 * A pointer to the opaque Rust object.
755 * Nearly everywhere, inner must be non-null, however in places where
756 * the Rust equivalent takes an Option, it may be set to null to indicate None.
758 LDKnativeHTLCOutputInCommitment *inner;
760 * Indicates that this is the only struct which contains the same pointer.
761 * Rust functions which take ownership of an object provided via an argument require
762 * this to be true and invalidate the object pointed to by inner.
765 } LDKHTLCOutputInCommitment;
768 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
770 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
772 * A pointer to the contents in the success state.
773 * Reading from this pointer when `result_ok` is not set is undefined.
775 struct LDKHTLCOutputInCommitment *result;
777 * A pointer to the contents in the error state.
778 * Reading from this pointer when `result_ok` is set is undefined.
780 struct LDKDecodeError *err;
781 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
784 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
785 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
786 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
788 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
790 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
791 * `err` or `result` depending on the state of `result_ok`.
793 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
795 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
798 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
803 * Late-bound per-channel counterparty data used to build transactions.
805 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
807 * A pointer to the opaque Rust object.
808 * Nearly everywhere, inner must be non-null, however in places where
809 * the Rust equivalent takes an Option, it may be set to null to indicate None.
811 LDKnativeCounterpartyChannelTransactionParameters *inner;
813 * Indicates that this is the only struct which contains the same pointer.
814 * Rust functions which take ownership of an object provided via an argument require
815 * this to be true and invalidate the object pointed to by inner.
818 } LDKCounterpartyChannelTransactionParameters;
821 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
823 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
825 * A pointer to the contents in the success state.
826 * Reading from this pointer when `result_ok` is not set is undefined.
828 struct LDKCounterpartyChannelTransactionParameters *result;
830 * A pointer to the contents in the error state.
831 * Reading from this pointer when `result_ok` is set is undefined.
833 struct LDKDecodeError *err;
834 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
837 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
838 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
839 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
841 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
843 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
844 * `err` or `result` depending on the state of `result_ok`.
846 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
848 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
851 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
856 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
857 * The fields are organized by holder/counterparty.
859 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
860 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
862 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
864 * A pointer to the opaque Rust object.
865 * Nearly everywhere, inner must be non-null, however in places where
866 * the Rust equivalent takes an Option, it may be set to null to indicate None.
868 LDKnativeChannelTransactionParameters *inner;
870 * Indicates that this is the only struct which contains the same pointer.
871 * Rust functions which take ownership of an object provided via an argument require
872 * this to be true and invalidate the object pointed to by inner.
875 } LDKChannelTransactionParameters;
878 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
880 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
882 * A pointer to the contents in the success state.
883 * Reading from this pointer when `result_ok` is not set is undefined.
885 struct LDKChannelTransactionParameters *result;
887 * A pointer to the contents in the error state.
888 * Reading from this pointer when `result_ok` is set is undefined.
890 struct LDKDecodeError *err;
891 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
894 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
895 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
896 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
898 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
900 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
901 * `err` or `result` depending on the state of `result_ok`.
903 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
905 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
908 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
911 * Represents a secp256k1 signature serialized as two 32-byte numbers
913 typedef struct LDKSignature {
915 * The bytes of the signature in "compact" form
917 uint8_t compact_form[64];
921 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
922 * This corresponds to std::vector in C++
924 typedef struct LDKCVec_SignatureZ {
926 * The elements in the array.
927 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
929 struct LDKSignature *data;
931 * The number of elements pointed to by `data`.
934 } LDKCVec_SignatureZ;
939 * Information needed to build and sign a holder's commitment transaction.
941 * The transaction is only signed once we are ready to broadcast.
943 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
945 * A pointer to the opaque Rust object.
946 * Nearly everywhere, inner must be non-null, however in places where
947 * the Rust equivalent takes an Option, it may be set to null to indicate None.
949 LDKnativeHolderCommitmentTransaction *inner;
951 * Indicates that this is the only struct which contains the same pointer.
952 * Rust functions which take ownership of an object provided via an argument require
953 * this to be true and invalidate the object pointed to by inner.
956 } LDKHolderCommitmentTransaction;
959 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
961 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
963 * A pointer to the contents in the success state.
964 * Reading from this pointer when `result_ok` is not set is undefined.
966 struct LDKHolderCommitmentTransaction *result;
968 * A pointer to the contents in the error state.
969 * Reading from this pointer when `result_ok` is set is undefined.
971 struct LDKDecodeError *err;
972 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
975 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
976 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
977 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
979 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
981 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
982 * `err` or `result` depending on the state of `result_ok`.
984 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
986 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
989 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
994 * A pre-built Bitcoin commitment transaction and its txid.
996 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
998 * A pointer to the opaque Rust object.
999 * Nearly everywhere, inner must be non-null, however in places where
1000 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1002 LDKnativeBuiltCommitmentTransaction *inner;
1004 * Indicates that this is the only struct which contains the same pointer.
1005 * Rust functions which take ownership of an object provided via an argument require
1006 * this to be true and invalidate the object pointed to by inner.
1009 } LDKBuiltCommitmentTransaction;
1012 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1014 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
1016 * A pointer to the contents in the success state.
1017 * Reading from this pointer when `result_ok` is not set is undefined.
1019 struct LDKBuiltCommitmentTransaction *result;
1021 * A pointer to the contents in the error state.
1022 * Reading from this pointer when `result_ok` is set is undefined.
1024 struct LDKDecodeError *err;
1025 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1028 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1029 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1030 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1032 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1034 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1035 * `err` or `result` depending on the state of `result_ok`.
1037 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1039 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1042 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1047 * This class tracks the per-transaction information needed to build a commitment transaction and to
1048 * actually build it and sign. It is used for holder transactions that we sign only when needed
1049 * and for transactions we sign for the counterparty.
1051 * This class can be used inside a signer implementation to generate a signature given the relevant
1054 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1056 * A pointer to the opaque Rust object.
1057 * Nearly everywhere, inner must be non-null, however in places where
1058 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1060 LDKnativeCommitmentTransaction *inner;
1062 * Indicates that this is the only struct which contains the same pointer.
1063 * Rust functions which take ownership of an object provided via an argument require
1064 * this to be true and invalidate the object pointed to by inner.
1067 } LDKCommitmentTransaction;
1070 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1072 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1074 * A pointer to the contents in the success state.
1075 * Reading from this pointer when `result_ok` is not set is undefined.
1077 struct LDKCommitmentTransaction *result;
1079 * A pointer to the contents in the error state.
1080 * Reading from this pointer when `result_ok` is set is undefined.
1082 struct LDKDecodeError *err;
1083 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1086 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1087 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1088 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1090 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1092 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1093 * `err` or `result` depending on the state of `result_ok`.
1095 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1097 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1100 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1105 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1106 * transaction and the transaction creation keys) are trusted.
1108 * See trust() and verify() functions on CommitmentTransaction.
1110 * This structure implements Deref.
1112 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1114 * A pointer to the opaque Rust object.
1115 * Nearly everywhere, inner must be non-null, however in places where
1116 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1118 LDKnativeTrustedCommitmentTransaction *inner;
1120 * Indicates that this is the only struct which contains the same pointer.
1121 * Rust functions which take ownership of an object provided via an argument require
1122 * this to be true and invalidate the object pointed to by inner.
1125 } LDKTrustedCommitmentTransaction;
1128 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1130 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1132 * A pointer to the contents in the success state.
1133 * Reading from this pointer when `result_ok` is not set is undefined.
1135 struct LDKTrustedCommitmentTransaction *result;
1137 * Note that this value is always NULL, as there are no contents in the Err variant
1140 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1143 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1144 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1145 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1147 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1149 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1150 * `err` or `result` depending on the state of `result_ok`.
1152 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1154 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1157 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1160 * The contents of CResult_CVec_SignatureZNoneZ
1162 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1164 * A pointer to the contents in the success state.
1165 * Reading from this pointer when `result_ok` is not set is undefined.
1167 struct LDKCVec_SignatureZ *result;
1169 * Note that this value is always NULL, as there are no contents in the Err variant
1172 } LDKCResult_CVec_SignatureZNoneZPtr;
1175 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1176 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1177 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1179 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1181 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1182 * `err` or `result` depending on the state of `result_ok`.
1184 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1186 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1189 } LDKCResult_CVec_SignatureZNoneZ;
1192 * The contents of CResult_NoneErrorZ
1194 typedef union LDKCResult_NoneErrorZPtr {
1196 * Note that this value is always NULL, as there are no contents in the OK variant
1200 * A pointer to the contents in the error state.
1201 * Reading from this pointer when `result_ok` is set is undefined.
1203 enum LDKIOError *err;
1204 } LDKCResult_NoneErrorZPtr;
1207 * A CResult_NoneErrorZ represents the result of a fallible operation,
1208 * containing a () on success and a crate::c_types::IOError on failure.
1209 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1211 typedef struct LDKCResult_NoneErrorZ {
1213 * The contents of this CResult_NoneErrorZ, accessible via either
1214 * `err` or `result` depending on the state of `result_ok`.
1216 union LDKCResult_NoneErrorZPtr contents;
1218 * Whether this CResult_NoneErrorZ represents a success state.
1221 } LDKCResult_NoneErrorZ;
1228 typedef struct MUST_USE_STRUCT LDKRouteHop {
1230 * A pointer to the opaque Rust object.
1231 * Nearly everywhere, inner must be non-null, however in places where
1232 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1234 LDKnativeRouteHop *inner;
1236 * Indicates that this is the only struct which contains the same pointer.
1237 * Rust functions which take ownership of an object provided via an argument require
1238 * this to be true and invalidate the object pointed to by inner.
1244 * The contents of CResult_RouteHopDecodeErrorZ
1246 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
1248 * A pointer to the contents in the success state.
1249 * Reading from this pointer when `result_ok` is not set is undefined.
1251 struct LDKRouteHop *result;
1253 * A pointer to the contents in the error state.
1254 * Reading from this pointer when `result_ok` is set is undefined.
1256 struct LDKDecodeError *err;
1257 } LDKCResult_RouteHopDecodeErrorZPtr;
1260 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
1261 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
1262 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1264 typedef struct LDKCResult_RouteHopDecodeErrorZ {
1266 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
1267 * `err` or `result` depending on the state of `result_ok`.
1269 union LDKCResult_RouteHopDecodeErrorZPtr contents;
1271 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
1274 } LDKCResult_RouteHopDecodeErrorZ;
1277 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
1278 * This corresponds to std::vector in C++
1280 typedef struct LDKCVec_RouteHopZ {
1282 * The elements in the array.
1283 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1285 struct LDKRouteHop *data;
1287 * The number of elements pointed to by `data`.
1290 } LDKCVec_RouteHopZ;
1293 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
1294 * This corresponds to std::vector in C++
1296 typedef struct LDKCVec_CVec_RouteHopZZ {
1298 * The elements in the array.
1299 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1301 struct LDKCVec_RouteHopZ *data;
1303 * The number of elements pointed to by `data`.
1306 } LDKCVec_CVec_RouteHopZZ;
1311 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
1312 * it can take multiple paths. Each path is composed of one or more hops through the network.
1314 typedef struct MUST_USE_STRUCT LDKRoute {
1316 * A pointer to the opaque Rust object.
1317 * Nearly everywhere, inner must be non-null, however in places where
1318 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1320 LDKnativeRoute *inner;
1322 * Indicates that this is the only struct which contains the same pointer.
1323 * Rust functions which take ownership of an object provided via an argument require
1324 * this to be true and invalidate the object pointed to by inner.
1330 * The contents of CResult_RouteDecodeErrorZ
1332 typedef union LDKCResult_RouteDecodeErrorZPtr {
1334 * A pointer to the contents in the success state.
1335 * Reading from this pointer when `result_ok` is not set is undefined.
1337 struct LDKRoute *result;
1339 * A pointer to the contents in the error state.
1340 * Reading from this pointer when `result_ok` is set is undefined.
1342 struct LDKDecodeError *err;
1343 } LDKCResult_RouteDecodeErrorZPtr;
1346 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
1347 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
1348 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1350 typedef struct LDKCResult_RouteDecodeErrorZ {
1352 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
1353 * `err` or `result` depending on the state of `result_ok`.
1355 union LDKCResult_RouteDecodeErrorZPtr contents;
1357 * Whether this CResult_RouteDecodeErrorZ represents a success state.
1360 } LDKCResult_RouteDecodeErrorZ;
1363 * An enum which can either contain a u64 or not
1365 typedef enum LDKCOption_u64Z_Tag {
1367 * When we're in this state, this COption_u64Z contains a u64
1369 LDKCOption_u64Z_Some,
1371 * When we're in this state, this COption_u64Z contains nothing
1373 LDKCOption_u64Z_None,
1375 * Must be last for serialization purposes
1377 LDKCOption_u64Z_Sentinel,
1378 } LDKCOption_u64Z_Tag;
1380 typedef struct LDKCOption_u64Z {
1381 LDKCOption_u64Z_Tag tag;
1392 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
1394 typedef struct MUST_USE_STRUCT LDKChannelDetails {
1396 * A pointer to the opaque Rust object.
1397 * Nearly everywhere, inner must be non-null, however in places where
1398 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1400 LDKnativeChannelDetails *inner;
1402 * Indicates that this is the only struct which contains the same pointer.
1403 * Rust functions which take ownership of an object provided via an argument require
1404 * this to be true and invalidate the object pointed to by inner.
1407 } LDKChannelDetails;
1410 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
1411 * This corresponds to std::vector in C++
1413 typedef struct LDKCVec_ChannelDetailsZ {
1415 * The elements in the array.
1416 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1418 struct LDKChannelDetails *data;
1420 * The number of elements pointed to by `data`.
1423 } LDKCVec_ChannelDetailsZ;
1428 * A channel descriptor which provides a last-hop route to get_route
1430 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
1432 * A pointer to the opaque Rust object.
1433 * Nearly everywhere, inner must be non-null, however in places where
1434 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1436 LDKnativeRouteHintHop *inner;
1438 * Indicates that this is the only struct which contains the same pointer.
1439 * Rust functions which take ownership of an object provided via an argument require
1440 * this to be true and invalidate the object pointed to by inner.
1446 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
1447 * This corresponds to std::vector in C++
1449 typedef struct LDKCVec_RouteHintHopZ {
1451 * The elements in the array.
1452 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1454 struct LDKRouteHintHop *data;
1456 * The number of elements pointed to by `data`.
1459 } LDKCVec_RouteHintHopZ;
1464 * An Err type for failure to process messages.
1466 typedef struct MUST_USE_STRUCT LDKLightningError {
1468 * A pointer to the opaque Rust object.
1469 * Nearly everywhere, inner must be non-null, however in places where
1470 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1472 LDKnativeLightningError *inner;
1474 * Indicates that this is the only struct which contains the same pointer.
1475 * Rust functions which take ownership of an object provided via an argument require
1476 * this to be true and invalidate the object pointed to by inner.
1479 } LDKLightningError;
1482 * The contents of CResult_RouteLightningErrorZ
1484 typedef union LDKCResult_RouteLightningErrorZPtr {
1486 * A pointer to the contents in the success state.
1487 * Reading from this pointer when `result_ok` is not set is undefined.
1489 struct LDKRoute *result;
1491 * A pointer to the contents in the error state.
1492 * Reading from this pointer when `result_ok` is set is undefined.
1494 struct LDKLightningError *err;
1495 } LDKCResult_RouteLightningErrorZPtr;
1498 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
1499 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
1500 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1502 typedef struct LDKCResult_RouteLightningErrorZ {
1504 * The contents of this CResult_RouteLightningErrorZ, accessible via either
1505 * `err` or `result` depending on the state of `result_ok`.
1507 union LDKCResult_RouteLightningErrorZPtr contents;
1509 * Whether this CResult_RouteLightningErrorZ represents a success state.
1512 } LDKCResult_RouteLightningErrorZ;
1515 * The contents of CResult_TxOutAccessErrorZ
1517 typedef union LDKCResult_TxOutAccessErrorZPtr {
1519 * A pointer to the contents in the success state.
1520 * Reading from this pointer when `result_ok` is not set is undefined.
1522 struct LDKTxOut *result;
1524 * A pointer to the contents in the error state.
1525 * Reading from this pointer when `result_ok` is set is undefined.
1527 enum LDKAccessError *err;
1528 } LDKCResult_TxOutAccessErrorZPtr;
1531 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
1532 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
1533 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1535 typedef struct LDKCResult_TxOutAccessErrorZ {
1537 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
1538 * `err` or `result` depending on the state of `result_ok`.
1540 union LDKCResult_TxOutAccessErrorZPtr contents;
1542 * Whether this CResult_TxOutAccessErrorZ represents a success state.
1545 } LDKCResult_TxOutAccessErrorZ;
1548 * A tuple of 2 elements. See the individual fields for the types contained.
1550 typedef struct LDKC2Tuple_usizeTransactionZ {
1552 * The element at position 0
1556 * The element at position 1
1558 struct LDKTransaction b;
1559 } LDKC2Tuple_usizeTransactionZ;
1562 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
1563 * This corresponds to std::vector in C++
1565 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
1567 * The elements in the array.
1568 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1570 struct LDKC2Tuple_usizeTransactionZ *data;
1572 * The number of elements pointed to by `data`.
1575 } LDKCVec_C2Tuple_usizeTransactionZZ;
1578 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1579 * look up the corresponding function in rust-lightning's docs.
1581 typedef struct LDKThirtyTwoBytes {
1583 * The thirty-two bytes
1586 } LDKThirtyTwoBytes;
1589 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
1590 * This corresponds to std::vector in C++
1592 typedef struct LDKCVec_TxidZ {
1594 * The elements in the array.
1595 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1597 struct LDKThirtyTwoBytes *data;
1599 * The number of elements pointed to by `data`.
1605 * The contents of CResult_NoneChannelMonitorUpdateErrZ
1607 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
1609 * Note that this value is always NULL, as there are no contents in the OK variant
1613 * A pointer to the contents in the error state.
1614 * Reading from this pointer when `result_ok` is set is undefined.
1616 enum LDKChannelMonitorUpdateErr *err;
1617 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
1620 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
1621 * containing a () on success and a crate::lightning::chain::channelmonitor::ChannelMonitorUpdateErr on failure.
1622 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1624 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
1626 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
1627 * `err` or `result` depending on the state of `result_ok`.
1629 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
1631 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
1634 } LDKCResult_NoneChannelMonitorUpdateErrZ;
1639 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
1640 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
1641 * preimage claim backward will lead to loss of funds.
1643 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
1645 * A pointer to the opaque Rust object.
1646 * Nearly everywhere, inner must be non-null, however in places where
1647 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1649 LDKnativeHTLCUpdate *inner;
1651 * Indicates that this is the only struct which contains the same pointer.
1652 * Rust functions which take ownership of an object provided via an argument require
1653 * this to be true and invalidate the object pointed to by inner.
1661 * A reference to a transaction output.
1663 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
1664 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
1666 typedef struct MUST_USE_STRUCT LDKOutPoint {
1668 * A pointer to the opaque Rust object.
1669 * Nearly everywhere, inner must be non-null, however in places where
1670 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1672 LDKnativeOutPoint *inner;
1674 * Indicates that this is the only struct which contains the same pointer.
1675 * Rust functions which take ownership of an object provided via an argument require
1676 * this to be true and invalidate the object pointed to by inner.
1682 * An event to be processed by the ChannelManager.
1684 typedef enum LDKMonitorEvent_Tag {
1686 * A monitor event containing an HTLCUpdate.
1688 LDKMonitorEvent_HTLCEvent,
1690 * A monitor event that the Channel's commitment transaction was broadcasted.
1692 LDKMonitorEvent_CommitmentTxBroadcasted,
1694 * Must be last for serialization purposes
1696 LDKMonitorEvent_Sentinel,
1697 } LDKMonitorEvent_Tag;
1699 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
1700 LDKMonitorEvent_Tag tag;
1703 struct LDKHTLCUpdate htlc_event;
1706 struct LDKOutPoint commitment_tx_broadcasted;
1712 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
1713 * This corresponds to std::vector in C++
1715 typedef struct LDKCVec_MonitorEventZ {
1717 * The elements in the array.
1718 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1720 struct LDKMonitorEvent *data;
1722 * The number of elements pointed to by `data`.
1725 } LDKCVec_MonitorEventZ;
1728 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
1730 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
1732 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
1734 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
1736 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
1738 LDKCOption_C2Tuple_usizeTransactionZZ_None,
1740 * Must be last for serialization purposes
1742 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
1743 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
1745 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
1746 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
1749 struct LDKC2Tuple_usizeTransactionZ some;
1752 } LDKCOption_C2Tuple_usizeTransactionZZ;
1757 * Information about a spendable output to a P2WSH script. See
1758 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
1760 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
1762 * A pointer to the opaque Rust object.
1763 * Nearly everywhere, inner must be non-null, however in places where
1764 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1766 LDKnativeDelayedPaymentOutputDescriptor *inner;
1768 * Indicates that this is the only struct which contains the same pointer.
1769 * Rust functions which take ownership of an object provided via an argument require
1770 * this to be true and invalidate the object pointed to by inner.
1773 } LDKDelayedPaymentOutputDescriptor;
1778 * Information about a spendable output to our \"payment key\". See
1779 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
1781 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
1783 * A pointer to the opaque Rust object.
1784 * Nearly everywhere, inner must be non-null, however in places where
1785 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1787 LDKnativeStaticPaymentOutputDescriptor *inner;
1789 * Indicates that this is the only struct which contains the same pointer.
1790 * Rust functions which take ownership of an object provided via an argument require
1791 * this to be true and invalidate the object pointed to by inner.
1794 } LDKStaticPaymentOutputDescriptor;
1797 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
1798 * claim at any point in the future) an event is generated which you must track and be able to
1799 * spend on-chain. The information needed to do this is provided in this enum, including the
1800 * outpoint describing which txid and output index is available, the full output which exists at
1801 * that txid/index, and any keys or other information required to sign.
1803 typedef enum LDKSpendableOutputDescriptor_Tag {
1805 * An output to a script which was provided via KeysInterface directly, either from
1806 * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
1807 * spend it. No secret keys are provided as rust-lightning was never given any key.
1808 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
1809 * on-chain using the payment preimage or after it has timed out.
1811 LDKSpendableOutputDescriptor_StaticOutput,
1813 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
1815 * The witness in the spending input should be:
1816 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
1818 * Note that the nSequence field in the spending input must be set to to_self_delay
1819 * (which means the transaction is not broadcastable until at least to_self_delay
1820 * blocks after the outpoint confirms).
1822 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
1823 * it is an output from an old state which we broadcast (which should never happen).
1825 * To derive the delayed_payment key which is used to sign for this input, you must pass the
1826 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
1827 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
1828 * chan_utils::derive_private_key. The public key can be generated without the secret key
1829 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
1832 * To derive the revocation_pubkey provided here (which is used in the witness
1833 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
1834 * call to Sign::ready_channel) and the provided per_commitment point
1835 * to chan_utils::derive_public_revocation_key.
1837 * The witness script which is hashed and included in the output script_pubkey may be
1838 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
1839 * (derived as above), and the to_self_delay contained here to
1840 * chan_utils::get_revokeable_redeemscript.
1842 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
1844 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
1845 * corresponds to the public key in Sign::pubkeys().payment_point).
1846 * The witness in the spending input, is, thus, simply:
1847 * <BIP 143 signature> <payment key>
1849 * These are generally the result of our counterparty having broadcast the current state,
1850 * allowing us to claim the non-HTLC-encumbered outputs immediately.
1852 LDKSpendableOutputDescriptor_StaticPaymentOutput,
1854 * Must be last for serialization purposes
1856 LDKSpendableOutputDescriptor_Sentinel,
1857 } LDKSpendableOutputDescriptor_Tag;
1859 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
1861 * The outpoint which is spendable
1863 struct LDKOutPoint outpoint;
1865 * The output which is referenced by the given outpoint.
1867 struct LDKTxOut output;
1868 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
1870 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
1871 LDKSpendableOutputDescriptor_Tag tag;
1873 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
1875 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
1878 struct LDKStaticPaymentOutputDescriptor static_payment_output;
1881 } LDKSpendableOutputDescriptor;
1884 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
1885 * This corresponds to std::vector in C++
1887 typedef struct LDKCVec_SpendableOutputDescriptorZ {
1889 * The elements in the array.
1890 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1892 struct LDKSpendableOutputDescriptor *data;
1894 * The number of elements pointed to by `data`.
1897 } LDKCVec_SpendableOutputDescriptorZ;
1902 * An accept_channel message to be sent or received from a peer
1904 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
1906 * A pointer to the opaque Rust object.
1907 * Nearly everywhere, inner must be non-null, however in places where
1908 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1910 LDKnativeAcceptChannel *inner;
1912 * Indicates that this is the only struct which contains the same pointer.
1913 * Rust functions which take ownership of an object provided via an argument require
1914 * this to be true and invalidate the object pointed to by inner.
1922 * An open_channel message to be sent or received from a peer
1924 typedef struct MUST_USE_STRUCT LDKOpenChannel {
1926 * A pointer to the opaque Rust object.
1927 * Nearly everywhere, inner must be non-null, however in places where
1928 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1930 LDKnativeOpenChannel *inner;
1932 * Indicates that this is the only struct which contains the same pointer.
1933 * Rust functions which take ownership of an object provided via an argument require
1934 * this to be true and invalidate the object pointed to by inner.
1942 * A funding_created message to be sent or received from a peer
1944 typedef struct MUST_USE_STRUCT LDKFundingCreated {
1946 * A pointer to the opaque Rust object.
1947 * Nearly everywhere, inner must be non-null, however in places where
1948 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1950 LDKnativeFundingCreated *inner;
1952 * Indicates that this is the only struct which contains the same pointer.
1953 * Rust functions which take ownership of an object provided via an argument require
1954 * this to be true and invalidate the object pointed to by inner.
1957 } LDKFundingCreated;
1962 * A funding_signed message to be sent or received from a peer
1964 typedef struct MUST_USE_STRUCT LDKFundingSigned {
1966 * A pointer to the opaque Rust object.
1967 * Nearly everywhere, inner must be non-null, however in places where
1968 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1970 LDKnativeFundingSigned *inner;
1972 * Indicates that this is the only struct which contains the same pointer.
1973 * Rust functions which take ownership of an object provided via an argument require
1974 * this to be true and invalidate the object pointed to by inner.
1982 * A funding_locked message to be sent or received from a peer
1984 typedef struct MUST_USE_STRUCT LDKFundingLocked {
1986 * A pointer to the opaque Rust object.
1987 * Nearly everywhere, inner must be non-null, however in places where
1988 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1990 LDKnativeFundingLocked *inner;
1992 * Indicates that this is the only struct which contains the same pointer.
1993 * Rust functions which take ownership of an object provided via an argument require
1994 * this to be true and invalidate the object pointed to by inner.
2002 * An announcement_signatures message to be sent or received from a peer
2004 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
2006 * A pointer to the opaque Rust object.
2007 * Nearly everywhere, inner must be non-null, however in places where
2008 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2010 LDKnativeAnnouncementSignatures *inner;
2012 * Indicates that this is the only struct which contains the same pointer.
2013 * Rust functions which take ownership of an object provided via an argument require
2014 * this to be true and invalidate the object pointed to by inner.
2017 } LDKAnnouncementSignatures;
2022 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
2023 * transaction updates if they were pending.
2025 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
2027 * A pointer to the opaque Rust object.
2028 * Nearly everywhere, inner must be non-null, however in places where
2029 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2031 LDKnativeCommitmentUpdate *inner;
2033 * Indicates that this is the only struct which contains the same pointer.
2034 * Rust functions which take ownership of an object provided via an argument require
2035 * this to be true and invalidate the object pointed to by inner.
2038 } LDKCommitmentUpdate;
2043 * A revoke_and_ack message to be sent or received from a peer
2045 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
2047 * A pointer to the opaque Rust object.
2048 * Nearly everywhere, inner must be non-null, however in places where
2049 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2051 LDKnativeRevokeAndACK *inner;
2053 * Indicates that this is the only struct which contains the same pointer.
2054 * Rust functions which take ownership of an object provided via an argument require
2055 * this to be true and invalidate the object pointed to by inner.
2063 * A closing_signed message to be sent or received from a peer
2065 typedef struct MUST_USE_STRUCT LDKClosingSigned {
2067 * A pointer to the opaque Rust object.
2068 * Nearly everywhere, inner must be non-null, however in places where
2069 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2071 LDKnativeClosingSigned *inner;
2073 * Indicates that this is the only struct which contains the same pointer.
2074 * Rust functions which take ownership of an object provided via an argument require
2075 * this to be true and invalidate the object pointed to by inner.
2083 * A shutdown message to be sent or received from a peer
2085 typedef struct MUST_USE_STRUCT LDKShutdown {
2087 * A pointer to the opaque Rust object.
2088 * Nearly everywhere, inner must be non-null, however in places where
2089 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2091 LDKnativeShutdown *inner;
2093 * Indicates that this is the only struct which contains the same pointer.
2094 * Rust functions which take ownership of an object provided via an argument require
2095 * this to be true and invalidate the object pointed to by inner.
2103 * A channel_reestablish message to be sent or received from a peer
2105 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
2107 * A pointer to the opaque Rust object.
2108 * Nearly everywhere, inner must be non-null, however in places where
2109 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2111 LDKnativeChannelReestablish *inner;
2113 * Indicates that this is the only struct which contains the same pointer.
2114 * Rust functions which take ownership of an object provided via an argument require
2115 * this to be true and invalidate the object pointed to by inner.
2118 } LDKChannelReestablish;
2123 * A channel_announcement message to be sent or received from a peer
2125 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
2127 * A pointer to the opaque Rust object.
2128 * Nearly everywhere, inner must be non-null, however in places where
2129 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2131 LDKnativeChannelAnnouncement *inner;
2133 * Indicates that this is the only struct which contains the same pointer.
2134 * Rust functions which take ownership of an object provided via an argument require
2135 * this to be true and invalidate the object pointed to by inner.
2138 } LDKChannelAnnouncement;
2143 * A channel_update message to be sent or received from a peer
2145 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2147 * A pointer to the opaque Rust object.
2148 * Nearly everywhere, inner must be non-null, however in places where
2149 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2151 LDKnativeChannelUpdate *inner;
2153 * Indicates that this is the only struct which contains the same pointer.
2154 * Rust functions which take ownership of an object provided via an argument require
2155 * this to be true and invalidate the object pointed to by inner.
2163 * A node_announcement message to be sent or received from a peer
2165 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
2167 * A pointer to the opaque Rust object.
2168 * Nearly everywhere, inner must be non-null, however in places where
2169 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2171 LDKnativeNodeAnnouncement *inner;
2173 * Indicates that this is the only struct which contains the same pointer.
2174 * Rust functions which take ownership of an object provided via an argument require
2175 * this to be true and invalidate the object pointed to by inner.
2178 } LDKNodeAnnouncement;
2183 * An error message to be sent or received from a peer
2185 typedef struct MUST_USE_STRUCT LDKErrorMessage {
2187 * A pointer to the opaque Rust object.
2188 * Nearly everywhere, inner must be non-null, however in places where
2189 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2191 LDKnativeErrorMessage *inner;
2193 * Indicates that this is the only struct which contains the same pointer.
2194 * Rust functions which take ownership of an object provided via an argument require
2195 * this to be true and invalidate the object pointed to by inner.
2201 * Used to put an error message in a LightningError
2203 typedef enum LDKErrorAction_Tag {
2205 * The peer took some action which made us think they were useless. Disconnect them.
2207 LDKErrorAction_DisconnectPeer,
2209 * The peer did something harmless that we weren't able to process, just log and ignore
2211 LDKErrorAction_IgnoreError,
2213 * The peer did something incorrect. Tell them.
2215 LDKErrorAction_SendErrorMessage,
2217 * Must be last for serialization purposes
2219 LDKErrorAction_Sentinel,
2220 } LDKErrorAction_Tag;
2222 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
2224 * An error message which we should make an effort to send before we disconnect.
2226 struct LDKErrorMessage msg;
2227 } LDKErrorAction_LDKDisconnectPeer_Body;
2229 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
2231 * The message to send.
2233 struct LDKErrorMessage msg;
2234 } LDKErrorAction_LDKSendErrorMessage_Body;
2236 typedef struct MUST_USE_STRUCT LDKErrorAction {
2237 LDKErrorAction_Tag tag;
2239 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
2240 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
2245 * The information we received from a peer along the route of a payment we originated. This is
2246 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
2247 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
2249 typedef enum LDKHTLCFailChannelUpdate_Tag {
2251 * We received an error which included a full ChannelUpdate message.
2253 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
2255 * We received an error which indicated only that a channel has been closed
2257 LDKHTLCFailChannelUpdate_ChannelClosed,
2259 * We received an error which indicated only that a node has failed
2261 LDKHTLCFailChannelUpdate_NodeFailure,
2263 * Must be last for serialization purposes
2265 LDKHTLCFailChannelUpdate_Sentinel,
2266 } LDKHTLCFailChannelUpdate_Tag;
2268 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
2270 * The unwrapped message we received
2272 struct LDKChannelUpdate msg;
2273 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
2275 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
2277 * The short_channel_id which has now closed.
2279 uint64_t short_channel_id;
2281 * when this true, this channel should be permanently removed from the
2282 * consideration. Otherwise, this channel can be restored as new channel_update is received
2285 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
2287 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
2289 * The node_id that has failed.
2291 struct LDKPublicKey node_id;
2293 * when this true, node should be permanently removed from the
2294 * consideration. Otherwise, the channels connected to this node can be
2295 * restored as new channel_update is received
2298 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
2300 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
2301 LDKHTLCFailChannelUpdate_Tag tag;
2303 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2304 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
2305 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
2307 } LDKHTLCFailChannelUpdate;
2312 * A query_channel_range message is used to query a peer for channel
2313 * UTXOs in a range of blocks. The recipient of a query makes a best
2314 * effort to reply to the query using one or more reply_channel_range
2317 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
2319 * A pointer to the opaque Rust object.
2320 * Nearly everywhere, inner must be non-null, however in places where
2321 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2323 LDKnativeQueryChannelRange *inner;
2325 * Indicates that this is the only struct which contains the same pointer.
2326 * Rust functions which take ownership of an object provided via an argument require
2327 * this to be true and invalidate the object pointed to by inner.
2330 } LDKQueryChannelRange;
2335 * A query_short_channel_ids message is used to query a peer for
2336 * routing gossip messages related to one or more short_channel_ids.
2337 * The query recipient will reply with the latest, if available,
2338 * channel_announcement, channel_update and node_announcement messages
2339 * it maintains for the requested short_channel_ids followed by a
2340 * reply_short_channel_ids_end message. The short_channel_ids sent in
2341 * this query are encoded. We only support encoding_type=0 uncompressed
2342 * serialization and do not support encoding_type=1 zlib serialization.
2344 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
2346 * A pointer to the opaque Rust object.
2347 * Nearly everywhere, inner must be non-null, however in places where
2348 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2350 LDKnativeQueryShortChannelIds *inner;
2352 * Indicates that this is the only struct which contains the same pointer.
2353 * Rust functions which take ownership of an object provided via an argument require
2354 * this to be true and invalidate the object pointed to by inner.
2357 } LDKQueryShortChannelIds;
2362 * A reply_channel_range message is a reply to a query_channel_range
2363 * message. Multiple reply_channel_range messages can be sent in reply
2364 * to a single query_channel_range message. The query recipient makes a
2365 * best effort to respond based on their local network view which may
2366 * not be a perfect view of the network. The short_channel_ids in the
2367 * reply are encoded. We only support encoding_type=0 uncompressed
2368 * serialization and do not support encoding_type=1 zlib serialization.
2370 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
2372 * A pointer to the opaque Rust object.
2373 * Nearly everywhere, inner must be non-null, however in places where
2374 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2376 LDKnativeReplyChannelRange *inner;
2378 * Indicates that this is the only struct which contains the same pointer.
2379 * Rust functions which take ownership of an object provided via an argument require
2380 * this to be true and invalidate the object pointed to by inner.
2383 } LDKReplyChannelRange;
2386 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
2387 * broadcast to most peers).
2388 * These events are handled by PeerManager::process_events if you are using a PeerManager.
2390 typedef enum LDKMessageSendEvent_Tag {
2392 * Used to indicate that we've accepted a channel open and should send the accept_channel
2393 * message provided to the given peer.
2395 LDKMessageSendEvent_SendAcceptChannel,
2397 * Used to indicate that we've initiated a channel open and should send the open_channel
2398 * message provided to the given peer.
2400 LDKMessageSendEvent_SendOpenChannel,
2402 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
2404 LDKMessageSendEvent_SendFundingCreated,
2406 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
2408 LDKMessageSendEvent_SendFundingSigned,
2410 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
2412 LDKMessageSendEvent_SendFundingLocked,
2414 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
2416 LDKMessageSendEvent_SendAnnouncementSignatures,
2418 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
2419 * message should be sent to the peer with the given node_id.
2421 LDKMessageSendEvent_UpdateHTLCs,
2423 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
2425 LDKMessageSendEvent_SendRevokeAndACK,
2427 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
2429 LDKMessageSendEvent_SendClosingSigned,
2431 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
2433 LDKMessageSendEvent_SendShutdown,
2435 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
2437 LDKMessageSendEvent_SendChannelReestablish,
2439 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
2440 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
2442 * Note that after doing so, you very likely (unless you did so very recently) want to call
2443 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
2444 * This ensures that any nodes which see our channel_announcement also have a relevant
2445 * node_announcement, including relevant feature flags which may be important for routing
2448 LDKMessageSendEvent_BroadcastChannelAnnouncement,
2450 * Used to indicate that a node_announcement should be broadcast to all peers.
2452 LDKMessageSendEvent_BroadcastNodeAnnouncement,
2454 * Used to indicate that a channel_update should be broadcast to all peers.
2456 LDKMessageSendEvent_BroadcastChannelUpdate,
2458 * Broadcast an error downstream to be handled
2460 LDKMessageSendEvent_HandleError,
2462 * When a payment fails we may receive updates back from the hop where it failed. In such
2463 * cases this event is generated so that we can inform the network graph of this information.
2465 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
2467 * Query a peer for channels with funding transaction UTXOs in a block range.
2469 LDKMessageSendEvent_SendChannelRangeQuery,
2471 * Request routing gossip messages from a peer for a list of channels identified by
2472 * their short_channel_ids.
2474 LDKMessageSendEvent_SendShortIdsQuery,
2476 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
2477 * emitted during processing of the query.
2479 LDKMessageSendEvent_SendReplyChannelRange,
2481 * Must be last for serialization purposes
2483 LDKMessageSendEvent_Sentinel,
2484 } LDKMessageSendEvent_Tag;
2486 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
2488 * The node_id of the node which should receive this message
2490 struct LDKPublicKey node_id;
2492 * The message which should be sent.
2494 struct LDKAcceptChannel msg;
2495 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
2497 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
2499 * The node_id of the node which should receive this message
2501 struct LDKPublicKey node_id;
2503 * The message which should be sent.
2505 struct LDKOpenChannel msg;
2506 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
2508 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
2510 * The node_id of the node which should receive this message
2512 struct LDKPublicKey node_id;
2514 * The message which should be sent.
2516 struct LDKFundingCreated msg;
2517 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
2519 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
2521 * The node_id of the node which should receive this message
2523 struct LDKPublicKey node_id;
2525 * The message which should be sent.
2527 struct LDKFundingSigned msg;
2528 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
2530 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
2532 * The node_id of the node which should receive these message(s)
2534 struct LDKPublicKey node_id;
2536 * The funding_locked message which should be sent.
2538 struct LDKFundingLocked msg;
2539 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
2541 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
2543 * The node_id of the node which should receive these message(s)
2545 struct LDKPublicKey node_id;
2547 * The announcement_signatures message which should be sent.
2549 struct LDKAnnouncementSignatures msg;
2550 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
2552 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
2554 * The node_id of the node which should receive these message(s)
2556 struct LDKPublicKey node_id;
2558 * The update messages which should be sent. ALL messages in the struct should be sent!
2560 struct LDKCommitmentUpdate updates;
2561 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
2563 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
2565 * The node_id of the node which should receive this message
2567 struct LDKPublicKey node_id;
2569 * The message which should be sent.
2571 struct LDKRevokeAndACK msg;
2572 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
2574 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
2576 * The node_id of the node which should receive this message
2578 struct LDKPublicKey node_id;
2580 * The message which should be sent.
2582 struct LDKClosingSigned msg;
2583 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
2585 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
2587 * The node_id of the node which should receive this message
2589 struct LDKPublicKey node_id;
2591 * The message which should be sent.
2593 struct LDKShutdown msg;
2594 } LDKMessageSendEvent_LDKSendShutdown_Body;
2596 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
2598 * The node_id of the node which should receive this message
2600 struct LDKPublicKey node_id;
2602 * The message which should be sent.
2604 struct LDKChannelReestablish msg;
2605 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
2607 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
2609 * The channel_announcement which should be sent.
2611 struct LDKChannelAnnouncement msg;
2613 * The followup channel_update which should be sent.
2615 struct LDKChannelUpdate update_msg;
2616 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
2618 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
2620 * The node_announcement which should be sent.
2622 struct LDKNodeAnnouncement msg;
2623 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
2625 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
2627 * The channel_update which should be sent.
2629 struct LDKChannelUpdate msg;
2630 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
2632 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
2634 * The node_id of the node which should receive this message
2636 struct LDKPublicKey node_id;
2638 * The action which should be taken.
2640 struct LDKErrorAction action;
2641 } LDKMessageSendEvent_LDKHandleError_Body;
2643 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
2645 * The channel/node update which should be sent to NetGraphMsgHandler
2647 struct LDKHTLCFailChannelUpdate update;
2648 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
2650 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
2652 * The node_id of this message recipient
2654 struct LDKPublicKey node_id;
2656 * The query_channel_range which should be sent.
2658 struct LDKQueryChannelRange msg;
2659 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
2661 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
2663 * The node_id of this message recipient
2665 struct LDKPublicKey node_id;
2667 * The query_short_channel_ids which should be sent.
2669 struct LDKQueryShortChannelIds msg;
2670 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
2672 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
2674 * The node_id of this message recipient
2676 struct LDKPublicKey node_id;
2678 * The reply_channel_range which should be sent.
2680 struct LDKReplyChannelRange msg;
2681 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
2683 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
2684 LDKMessageSendEvent_Tag tag;
2686 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
2687 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
2688 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
2689 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
2690 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
2691 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
2692 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
2693 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
2694 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
2695 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
2696 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
2697 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
2698 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
2699 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
2700 LDKMessageSendEvent_LDKHandleError_Body handle_error;
2701 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
2702 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
2703 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
2704 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
2706 } LDKMessageSendEvent;
2709 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
2710 * This corresponds to std::vector in C++
2712 typedef struct LDKCVec_MessageSendEventZ {
2714 * The elements in the array.
2715 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2717 struct LDKMessageSendEvent *data;
2719 * The number of elements pointed to by `data`.
2722 } LDKCVec_MessageSendEventZ;
2727 * Features used within an `init` message.
2729 typedef struct MUST_USE_STRUCT LDKInitFeatures {
2731 * A pointer to the opaque Rust object.
2732 * Nearly everywhere, inner must be non-null, however in places where
2733 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2735 LDKnativeInitFeatures *inner;
2737 * Indicates that this is the only struct which contains the same pointer.
2738 * Rust functions which take ownership of an object provided via an argument require
2739 * this to be true and invalidate the object pointed to by inner.
2745 * The contents of CResult_InitFeaturesDecodeErrorZ
2747 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
2749 * A pointer to the contents in the success state.
2750 * Reading from this pointer when `result_ok` is not set is undefined.
2752 struct LDKInitFeatures *result;
2754 * A pointer to the contents in the error state.
2755 * Reading from this pointer when `result_ok` is set is undefined.
2757 struct LDKDecodeError *err;
2758 } LDKCResult_InitFeaturesDecodeErrorZPtr;
2761 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
2762 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
2763 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2765 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
2767 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
2768 * `err` or `result` depending on the state of `result_ok`.
2770 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
2772 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
2775 } LDKCResult_InitFeaturesDecodeErrorZ;
2780 * Features used within a `node_announcement` message.
2782 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
2784 * A pointer to the opaque Rust object.
2785 * Nearly everywhere, inner must be non-null, however in places where
2786 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2788 LDKnativeNodeFeatures *inner;
2790 * Indicates that this is the only struct which contains the same pointer.
2791 * Rust functions which take ownership of an object provided via an argument require
2792 * this to be true and invalidate the object pointed to by inner.
2798 * The contents of CResult_NodeFeaturesDecodeErrorZ
2800 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
2802 * A pointer to the contents in the success state.
2803 * Reading from this pointer when `result_ok` is not set is undefined.
2805 struct LDKNodeFeatures *result;
2807 * A pointer to the contents in the error state.
2808 * Reading from this pointer when `result_ok` is set is undefined.
2810 struct LDKDecodeError *err;
2811 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
2814 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
2815 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
2816 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2818 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
2820 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
2821 * `err` or `result` depending on the state of `result_ok`.
2823 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
2825 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
2828 } LDKCResult_NodeFeaturesDecodeErrorZ;
2833 * Features used within a `channel_announcement` message.
2835 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
2837 * A pointer to the opaque Rust object.
2838 * Nearly everywhere, inner must be non-null, however in places where
2839 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2841 LDKnativeChannelFeatures *inner;
2843 * Indicates that this is the only struct which contains the same pointer.
2844 * Rust functions which take ownership of an object provided via an argument require
2845 * this to be true and invalidate the object pointed to by inner.
2848 } LDKChannelFeatures;
2851 * The contents of CResult_ChannelFeaturesDecodeErrorZ
2853 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
2855 * A pointer to the contents in the success state.
2856 * Reading from this pointer when `result_ok` is not set is undefined.
2858 struct LDKChannelFeatures *result;
2860 * A pointer to the contents in the error state.
2861 * Reading from this pointer when `result_ok` is set is undefined.
2863 struct LDKDecodeError *err;
2864 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
2867 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
2868 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
2869 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2871 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
2873 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
2874 * `err` or `result` depending on the state of `result_ok`.
2876 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
2878 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
2881 } LDKCResult_ChannelFeaturesDecodeErrorZ;
2886 * Features used within an invoice.
2888 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
2890 * A pointer to the opaque Rust object.
2891 * Nearly everywhere, inner must be non-null, however in places where
2892 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2894 LDKnativeInvoiceFeatures *inner;
2896 * Indicates that this is the only struct which contains the same pointer.
2897 * Rust functions which take ownership of an object provided via an argument require
2898 * this to be true and invalidate the object pointed to by inner.
2901 } LDKInvoiceFeatures;
2904 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
2906 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
2908 * A pointer to the contents in the success state.
2909 * Reading from this pointer when `result_ok` is not set is undefined.
2911 struct LDKInvoiceFeatures *result;
2913 * A pointer to the contents in the error state.
2914 * Reading from this pointer when `result_ok` is set is undefined.
2916 struct LDKDecodeError *err;
2917 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
2920 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
2921 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
2922 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2924 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
2926 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
2927 * `err` or `result` depending on the state of `result_ok`.
2929 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
2931 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
2934 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
2937 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
2939 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
2941 * A pointer to the contents in the success state.
2942 * Reading from this pointer when `result_ok` is not set is undefined.
2944 struct LDKDelayedPaymentOutputDescriptor *result;
2946 * A pointer to the contents in the error state.
2947 * Reading from this pointer when `result_ok` is set is undefined.
2949 struct LDKDecodeError *err;
2950 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
2953 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2954 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2955 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2957 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
2959 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
2960 * `err` or `result` depending on the state of `result_ok`.
2962 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
2964 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
2967 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
2970 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
2972 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
2974 * A pointer to the contents in the success state.
2975 * Reading from this pointer when `result_ok` is not set is undefined.
2977 struct LDKStaticPaymentOutputDescriptor *result;
2979 * A pointer to the contents in the error state.
2980 * Reading from this pointer when `result_ok` is set is undefined.
2982 struct LDKDecodeError *err;
2983 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
2986 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2987 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2988 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2990 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
2992 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
2993 * `err` or `result` depending on the state of `result_ok`.
2995 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
2997 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
3000 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
3003 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
3005 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
3007 * A pointer to the contents in the success state.
3008 * Reading from this pointer when `result_ok` is not set is undefined.
3010 struct LDKSpendableOutputDescriptor *result;
3012 * A pointer to the contents in the error state.
3013 * Reading from this pointer when `result_ok` is set is undefined.
3015 struct LDKDecodeError *err;
3016 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
3019 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
3020 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
3021 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3023 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
3025 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
3026 * `err` or `result` depending on the state of `result_ok`.
3028 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
3030 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
3033 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
3036 * A tuple of 2 elements. See the individual fields for the types contained.
3038 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
3040 * The element at position 0
3042 struct LDKSignature a;
3044 * The element at position 1
3046 struct LDKCVec_SignatureZ b;
3047 } LDKC2Tuple_SignatureCVec_SignatureZZ;
3050 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
3052 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3054 * A pointer to the contents in the success state.
3055 * Reading from this pointer when `result_ok` is not set is undefined.
3057 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
3059 * Note that this value is always NULL, as there are no contents in the Err variant
3062 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
3065 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
3066 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
3067 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3069 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3071 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
3072 * `err` or `result` depending on the state of `result_ok`.
3074 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
3076 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
3079 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
3082 * The contents of CResult_SignatureNoneZ
3084 typedef union LDKCResult_SignatureNoneZPtr {
3086 * A pointer to the contents in the success state.
3087 * Reading from this pointer when `result_ok` is not set is undefined.
3089 struct LDKSignature *result;
3091 * Note that this value is always NULL, as there are no contents in the Err variant
3094 } LDKCResult_SignatureNoneZPtr;
3097 * A CResult_SignatureNoneZ represents the result of a fallible operation,
3098 * containing a crate::c_types::Signature on success and a () on failure.
3099 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3101 typedef struct LDKCResult_SignatureNoneZ {
3103 * The contents of this CResult_SignatureNoneZ, accessible via either
3104 * `err` or `result` depending on the state of `result_ok`.
3106 union LDKCResult_SignatureNoneZPtr contents;
3108 * Whether this CResult_SignatureNoneZ represents a success state.
3111 } LDKCResult_SignatureNoneZ;
3116 * The unsigned part of a channel_announcement
3118 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
3120 * A pointer to the opaque Rust object.
3121 * Nearly everywhere, inner must be non-null, however in places where
3122 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3124 LDKnativeUnsignedChannelAnnouncement *inner;
3126 * Indicates that this is the only struct which contains the same pointer.
3127 * Rust functions which take ownership of an object provided via an argument require
3128 * this to be true and invalidate the object pointed to by inner.
3131 } LDKUnsignedChannelAnnouncement;
3134 * A trait to sign lightning channel transactions as described in BOLT 3.
3136 * Signing services could be implemented on a hardware wallet. In this case,
3137 * the current Sign would be a front-end on top of a communication
3138 * channel connected to your secure device and lightning key material wouldn't
3139 * reside on a hot server. Nevertheless, a this deployment would still need
3140 * to trust the ChannelManager to avoid loss of funds as this latest component
3141 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
3143 * A more secure iteration would be to use hashlock (or payment points) to pair
3144 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
3145 * at the price of more state and computation on the hardware wallet side. In the future,
3146 * we are looking forward to design such interface.
3148 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
3149 * to act, as liveness and breach reply correctness are always going to be hard requirements
3150 * of LN security model, orthogonal of key management issues.
3152 typedef struct LDKBaseSign {
3154 * An opaque pointer which is passed to your function implementations as an argument.
3155 * This has no meaning in the LDK, and can be NULL or any other value.
3159 * Gets the per-commitment point for a specific commitment number
3161 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
3163 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
3165 * Gets the commitment secret for a specific commitment number as part of the revocation process
3167 * An external signer implementation should error here if the commitment was already signed
3168 * and should refuse to sign it in the future.
3170 * May be called more than once for the same index.
3172 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
3174 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
3176 * Gets the holder's channel public keys and basepoints
3178 struct LDKChannelPublicKeys pubkeys;
3180 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
3181 * Note that this takes a pointer to this object, not the this_ptr like other methods do
3182 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
3184 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
3186 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
3187 * some SpendableOutputDescriptor types. This should be sufficient to identify this
3188 * Sign object uniquely and lookup or re-derive its keys.
3190 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
3192 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
3194 * Note that if signing fails or is rejected, the channel will be force-closed.
3196 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
3198 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
3199 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
3200 * latest commitment_tx when we initiate a force-close.
3201 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
3202 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
3204 * This may be called multiple times for the same transaction.
3206 * An external signer implementation should check that the commitment has not been revoked.
3208 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
3210 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
3212 * Create a signature for the given input in a transaction spending an HTLC transaction output
3213 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
3215 * A justice transaction may claim multiple outputs at the same time if timelocks are
3216 * similar, but only a signature for the input at index `input` should be signed for here.
3217 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3218 * to an upcoming timelock expiration.
3220 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3222 * per_commitment_key is revocation secret which was provided by our counterparty when they
3223 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3224 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3227 struct LDKCResult_SignatureNoneZ (*sign_justice_revoked_output)(const void *this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32]);
3229 * Create a signature for the given input in a transaction spending a commitment transaction
3230 * HTLC output when our counterparty broadcasts an old state.
3232 * A justice transaction may claim multiple outputs at the same time if timelocks are
3233 * similar, but only a signature for the input at index `input` should be signed for here.
3234 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3235 * to an upcoming timelock expiration.
3237 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3239 * per_commitment_key is revocation secret which was provided by our counterparty when they
3240 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3241 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3244 * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
3245 * (which is committed to in the BIP 143 signatures).
3247 struct LDKCResult_SignatureNoneZ (*sign_justice_revoked_htlc)(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);
3249 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
3250 * transaction, either offered or received.
3252 * Such a transaction may claim multiples offered outputs at same time if we know the
3253 * preimage for each when we create it, but only the input at index `input` should be
3254 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
3255 * needed with regards to an upcoming timelock expiration.
3257 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
3260 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3262 * Per_commitment_point is the dynamic point corresponding to the channel state
3263 * detected onchain. It has been generated by our counterparty and is used to derive
3264 * channel state keys, which are then included in the witness script and committed to in the
3265 * BIP 143 signature.
3267 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);
3269 * Create a signature for a (proposed) closing transaction.
3271 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
3272 * chosen to forgo their output as dust.
3274 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
3276 * Signs a channel announcement message with our funding key, proving it comes from one
3277 * of the channel participants.
3279 * Note that if this fails or is rejected, the channel will not be publicly announced and
3280 * our counterparty may (though likely will not) close the channel on us for violating the
3283 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
3285 * Set the counterparty static channel data, including basepoints,
3286 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
3287 * This is done as soon as the funding outpoint is known. Since these are static channel data,
3288 * they MUST NOT be allowed to change to different values once set.
3290 * channel_parameters.is_populated() MUST be true.
3292 * We bind holder_selected_contest_delay late here for API convenience.
3294 * Will be called before any signatures are applied.
3296 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
3298 * Frees any resources associated with this object given its this_arg pointer.
3299 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3301 void (*free)(void *this_arg);
3305 * A cloneable signer.
3307 * Although we require signers to be cloneable, it may be useful for developers to be able to use
3308 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
3309 * which implies Sized, into this derived trait.
3311 typedef struct LDKSign {
3313 * An opaque pointer which is passed to your function implementations as an argument.
3314 * This has no meaning in the LDK, and can be NULL or any other value.
3318 * Implementation of BaseSign for this object.
3320 struct LDKBaseSign BaseSign;
3322 * Creates a copy of the BaseSign, for a copy of this Sign.
3323 * Because BaseSign doesn't natively support copying itself, you have to provide a full copy implementation here.
3325 struct LDKBaseSign (*BaseSign_clone)(const struct LDKBaseSign *NONNULL_PTR orig_BaseSign);
3327 * Serialize the object into a byte array
3329 struct LDKCVec_u8Z (*write)(const void *this_arg);
3331 * Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
3332 * Note that the ultimate copy of the Sign will have all function pointers the same as the original.
3333 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
3335 void *(*clone)(const void *this_arg);
3337 * Frees any resources associated with this object given its this_arg pointer.
3338 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3340 void (*free)(void *this_arg);
3344 * The contents of CResult_SignDecodeErrorZ
3346 typedef union LDKCResult_SignDecodeErrorZPtr {
3348 * A pointer to the contents in the success state.
3349 * Reading from this pointer when `result_ok` is not set is undefined.
3351 struct LDKSign *result;
3353 * A pointer to the contents in the error state.
3354 * Reading from this pointer when `result_ok` is set is undefined.
3356 struct LDKDecodeError *err;
3357 } LDKCResult_SignDecodeErrorZPtr;
3360 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
3361 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
3362 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3364 typedef struct LDKCResult_SignDecodeErrorZ {
3366 * The contents of this CResult_SignDecodeErrorZ, accessible via either
3367 * `err` or `result` depending on the state of `result_ok`.
3369 union LDKCResult_SignDecodeErrorZPtr contents;
3371 * Whether this CResult_SignDecodeErrorZ represents a success state.
3374 } LDKCResult_SignDecodeErrorZ;
3377 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
3378 * allows recovering the exact public key which created the signature given the message.
3380 typedef struct LDKRecoverableSignature {
3382 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
3385 uint8_t serialized_form[68];
3386 } LDKRecoverableSignature;
3389 * The contents of CResult_RecoverableSignatureNoneZ
3391 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
3393 * A pointer to the contents in the success state.
3394 * Reading from this pointer when `result_ok` is not set is undefined.
3396 struct LDKRecoverableSignature *result;
3398 * Note that this value is always NULL, as there are no contents in the Err variant
3401 } LDKCResult_RecoverableSignatureNoneZPtr;
3404 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
3405 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
3406 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3408 typedef struct LDKCResult_RecoverableSignatureNoneZ {
3410 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
3411 * `err` or `result` depending on the state of `result_ok`.
3413 union LDKCResult_RecoverableSignatureNoneZPtr contents;
3415 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
3418 } LDKCResult_RecoverableSignatureNoneZ;
3421 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
3422 * This corresponds to std::vector in C++
3424 typedef struct LDKCVec_CVec_u8ZZ {
3426 * The elements in the array.
3427 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3429 struct LDKCVec_u8Z *data;
3431 * The number of elements pointed to by `data`.
3434 } LDKCVec_CVec_u8ZZ;
3437 * The contents of CResult_CVec_CVec_u8ZZNoneZ
3439 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
3441 * A pointer to the contents in the success state.
3442 * Reading from this pointer when `result_ok` is not set is undefined.
3444 struct LDKCVec_CVec_u8ZZ *result;
3446 * Note that this value is always NULL, as there are no contents in the Err variant
3449 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
3452 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
3453 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
3454 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3456 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
3458 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
3459 * `err` or `result` depending on the state of `result_ok`.
3461 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
3463 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
3466 } LDKCResult_CVec_CVec_u8ZZNoneZ;
3471 * A simple implementation of Sign that just keeps the private keys in memory.
3473 * This implementation performs no policy checks and is insufficient by itself as
3474 * a secure external signer.
3476 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3478 * A pointer to the opaque Rust object.
3479 * Nearly everywhere, inner must be non-null, however in places where
3480 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3482 LDKnativeInMemorySigner *inner;
3484 * Indicates that this is the only struct which contains the same pointer.
3485 * Rust functions which take ownership of an object provided via an argument require
3486 * this to be true and invalidate the object pointed to by inner.
3489 } LDKInMemorySigner;
3492 * The contents of CResult_InMemorySignerDecodeErrorZ
3494 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3496 * A pointer to the contents in the success state.
3497 * Reading from this pointer when `result_ok` is not set is undefined.
3499 struct LDKInMemorySigner *result;
3501 * A pointer to the contents in the error state.
3502 * Reading from this pointer when `result_ok` is set is undefined.
3504 struct LDKDecodeError *err;
3505 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3508 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
3509 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3510 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3512 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3514 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
3515 * `err` or `result` depending on the state of `result_ok`.
3517 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3519 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
3522 } LDKCResult_InMemorySignerDecodeErrorZ;
3525 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
3526 * This corresponds to std::vector in C++
3528 typedef struct LDKCVec_TxOutZ {
3530 * The elements in the array.
3531 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3533 struct LDKTxOut *data;
3535 * The number of elements pointed to by `data`.
3541 * The contents of CResult_TransactionNoneZ
3543 typedef union LDKCResult_TransactionNoneZPtr {
3545 * A pointer to the contents in the success state.
3546 * Reading from this pointer when `result_ok` is not set is undefined.
3548 struct LDKTransaction *result;
3550 * Note that this value is always NULL, as there are no contents in the Err variant
3553 } LDKCResult_TransactionNoneZPtr;
3556 * A CResult_TransactionNoneZ represents the result of a fallible operation,
3557 * containing a crate::c_types::Transaction on success and a () on failure.
3558 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3560 typedef struct LDKCResult_TransactionNoneZ {
3562 * The contents of this CResult_TransactionNoneZ, accessible via either
3563 * `err` or `result` depending on the state of `result_ok`.
3565 union LDKCResult_TransactionNoneZPtr contents;
3567 * Whether this CResult_TransactionNoneZ represents a success state.
3570 } LDKCResult_TransactionNoneZ;
3575 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
3576 * on-chain transactions to ensure no loss of funds occurs.
3578 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
3579 * information and are actively monitoring the chain.
3581 * Pending Events or updated HTLCs which have not yet been read out by
3582 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
3583 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
3584 * gotten are fully handled before re-serializing the new state.
3586 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
3587 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
3588 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
3589 * returned block hash and the the current chain and then reconnecting blocks to get to the
3590 * best chain) upon deserializing the object!
3592 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
3594 * A pointer to the opaque Rust object.
3595 * Nearly everywhere, inner must be non-null, however in places where
3596 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3598 LDKnativeChannelMonitor *inner;
3600 * Indicates that this is the only struct which contains the same pointer.
3601 * Rust functions which take ownership of an object provided via an argument require
3602 * this to be true and invalidate the object pointed to by inner.
3605 } LDKChannelMonitor;
3608 * A tuple of 2 elements. See the individual fields for the types contained.
3610 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
3612 * The element at position 0
3614 struct LDKThirtyTwoBytes a;
3616 * The element at position 1
3618 struct LDKChannelMonitor b;
3619 } LDKC2Tuple_BlockHashChannelMonitorZ;
3622 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
3623 * This corresponds to std::vector in C++
3625 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
3627 * The elements in the array.
3628 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3630 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
3632 * The number of elements pointed to by `data`.
3635 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
3638 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
3640 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
3642 * A pointer to the contents in the success state.
3643 * Reading from this pointer when `result_ok` is not set is undefined.
3645 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
3647 * A pointer to the contents in the error state.
3648 * Reading from this pointer when `result_ok` is set is undefined.
3650 enum LDKIOError *err;
3651 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
3654 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
3655 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
3656 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3658 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
3660 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
3661 * `err` or `result` depending on the state of `result_ok`.
3663 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
3665 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
3668 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
3671 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
3674 typedef enum LDKAPIError_Tag {
3676 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
3677 * are documented, but generally indicates some precondition of a function was violated.
3679 LDKAPIError_APIMisuseError,
3681 * Due to a high feerate, we were unable to complete the request.
3682 * For example, this may be returned if the feerate implies we cannot open a channel at the
3683 * requested value, but opening a larger channel would succeed.
3685 LDKAPIError_FeeRateTooHigh,
3687 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
3688 * too-many-hops, etc).
3690 LDKAPIError_RouteError,
3692 * We were unable to complete the request as the Channel required to do so is unable to
3693 * complete the request (or was not found). This can take many forms, including disconnected
3694 * peer, channel at capacity, channel shutting down, etc.
3696 LDKAPIError_ChannelUnavailable,
3698 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
3699 * attempted action to fail.
3701 LDKAPIError_MonitorUpdateFailed,
3703 * Must be last for serialization purposes
3705 LDKAPIError_Sentinel,
3708 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
3710 * A human-readable error message
3713 } LDKAPIError_LDKAPIMisuseError_Body;
3715 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
3717 * A human-readable error message
3721 * The feerate which was too high.
3724 } LDKAPIError_LDKFeeRateTooHigh_Body;
3726 typedef struct LDKAPIError_LDKRouteError_Body {
3728 * A human-readable error message
3731 } LDKAPIError_LDKRouteError_Body;
3733 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
3735 * A human-readable error message
3738 } LDKAPIError_LDKChannelUnavailable_Body;
3740 typedef struct MUST_USE_STRUCT LDKAPIError {
3741 LDKAPIError_Tag tag;
3743 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
3744 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
3745 LDKAPIError_LDKRouteError_Body route_error;
3746 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
3751 * The contents of CResult_NoneAPIErrorZ
3753 typedef union LDKCResult_NoneAPIErrorZPtr {
3755 * Note that this value is always NULL, as there are no contents in the OK variant
3759 * A pointer to the contents in the error state.
3760 * Reading from this pointer when `result_ok` is set is undefined.
3762 struct LDKAPIError *err;
3763 } LDKCResult_NoneAPIErrorZPtr;
3766 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
3767 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
3768 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3770 typedef struct LDKCResult_NoneAPIErrorZ {
3772 * The contents of this CResult_NoneAPIErrorZ, accessible via either
3773 * `err` or `result` depending on the state of `result_ok`.
3775 union LDKCResult_NoneAPIErrorZPtr contents;
3777 * Whether this CResult_NoneAPIErrorZ represents a success state.
3780 } LDKCResult_NoneAPIErrorZ;
3783 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
3784 * This corresponds to std::vector in C++
3786 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
3788 * The elements in the array.
3789 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3791 struct LDKCResult_NoneAPIErrorZ *data;
3793 * The number of elements pointed to by `data`.
3796 } LDKCVec_CResult_NoneAPIErrorZZ;
3799 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
3800 * This corresponds to std::vector in C++
3802 typedef struct LDKCVec_APIErrorZ {
3804 * The elements in the array.
3805 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3807 struct LDKAPIError *data;
3809 * The number of elements pointed to by `data`.
3812 } LDKCVec_APIErrorZ;
3815 * If a payment fails to send, it can be in one of several states. This enum is returned as the
3816 * Err() type describing which state the payment is in, see the description of individual enum
3819 typedef enum LDKPaymentSendFailure_Tag {
3821 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
3822 * send the payment at all. No channel state has been changed or messages sent to peers, and
3823 * once you've changed the parameter at error, you can freely retry the payment in full.
3825 LDKPaymentSendFailure_ParameterError,
3827 * A parameter in a single path which was passed to send_payment was invalid, preventing us
3828 * from attempting to send the payment at all. No channel state has been changed or messages
3829 * sent to peers, and once you've changed the parameter at error, you can freely retry the
3832 * The results here are ordered the same as the paths in the route object which was passed to
3835 LDKPaymentSendFailure_PathParameterError,
3837 * All paths which were attempted failed to send, with no channel state change taking place.
3838 * You can freely retry the payment in full (though you probably want to do so over different
3839 * paths than the ones selected).
3841 LDKPaymentSendFailure_AllFailedRetrySafe,
3843 * Some paths which were attempted failed to send, though possibly not all. At least some
3844 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
3845 * in over-/re-payment.
3847 * The results here are ordered the same as the paths in the route object which was passed to
3848 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
3849 * retried (though there is currently no API with which to do so).
3851 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
3852 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
3853 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
3854 * with the latest update_id.
3856 LDKPaymentSendFailure_PartialFailure,
3858 * Must be last for serialization purposes
3860 LDKPaymentSendFailure_Sentinel,
3861 } LDKPaymentSendFailure_Tag;
3863 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
3864 LDKPaymentSendFailure_Tag tag;
3867 struct LDKAPIError parameter_error;
3870 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
3873 struct LDKCVec_APIErrorZ all_failed_retry_safe;
3876 struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
3879 } LDKPaymentSendFailure;
3882 * The contents of CResult_NonePaymentSendFailureZ
3884 typedef union LDKCResult_NonePaymentSendFailureZPtr {
3886 * Note that this value is always NULL, as there are no contents in the OK variant
3890 * A pointer to the contents in the error state.
3891 * Reading from this pointer when `result_ok` is set is undefined.
3893 struct LDKPaymentSendFailure *err;
3894 } LDKCResult_NonePaymentSendFailureZPtr;
3897 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
3898 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
3899 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3901 typedef struct LDKCResult_NonePaymentSendFailureZ {
3903 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
3904 * `err` or `result` depending on the state of `result_ok`.
3906 union LDKCResult_NonePaymentSendFailureZPtr contents;
3908 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
3911 } LDKCResult_NonePaymentSendFailureZ;
3914 * A 4-byte byte array.
3916 typedef struct LDKFourBytes {
3924 * A 16-byte byte array.
3926 typedef struct LDKSixteenBytes {
3934 * A 10-byte byte array.
3936 typedef struct LDKTenBytes {
3944 * An address which can be used to connect to a remote peer
3946 typedef enum LDKNetAddress_Tag {
3948 * An IPv4 address/port on which the peer is listening.
3952 * An IPv6 address/port on which the peer is listening.
3956 * An old-style Tor onion address/port on which the peer is listening.
3958 LDKNetAddress_OnionV2,
3960 * A new-style Tor onion address/port on which the peer is listening.
3961 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
3962 * wrap as base32 and append \".onion\".
3964 LDKNetAddress_OnionV3,
3966 * Must be last for serialization purposes
3968 LDKNetAddress_Sentinel,
3969 } LDKNetAddress_Tag;
3971 typedef struct LDKNetAddress_LDKIPv4_Body {
3973 * The 4-byte IPv4 address
3975 struct LDKFourBytes addr;
3977 * The port on which the node is listening
3980 } LDKNetAddress_LDKIPv4_Body;
3982 typedef struct LDKNetAddress_LDKIPv6_Body {
3984 * The 16-byte IPv6 address
3986 struct LDKSixteenBytes addr;
3988 * The port on which the node is listening
3991 } LDKNetAddress_LDKIPv6_Body;
3993 typedef struct LDKNetAddress_LDKOnionV2_Body {
3995 * The bytes (usually encoded in base32 with \".onion\" appended)
3997 struct LDKTenBytes addr;
3999 * The port on which the node is listening
4002 } LDKNetAddress_LDKOnionV2_Body;
4004 typedef struct LDKNetAddress_LDKOnionV3_Body {
4006 * The ed25519 long-term public key of the peer
4008 struct LDKThirtyTwoBytes ed25519_pubkey;
4010 * The checksum of the pubkey and version, as included in the onion address
4014 * The version byte, as defined by the Tor Onion v3 spec.
4018 * The port on which the node is listening
4021 } LDKNetAddress_LDKOnionV3_Body;
4023 typedef struct MUST_USE_STRUCT LDKNetAddress {
4024 LDKNetAddress_Tag tag;
4026 LDKNetAddress_LDKIPv4_Body i_pv4;
4027 LDKNetAddress_LDKIPv6_Body i_pv6;
4028 LDKNetAddress_LDKOnionV2_Body onion_v2;
4029 LDKNetAddress_LDKOnionV3_Body onion_v3;
4034 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
4035 * This corresponds to std::vector in C++
4037 typedef struct LDKCVec_NetAddressZ {
4039 * The elements in the array.
4040 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4042 struct LDKNetAddress *data;
4044 * The number of elements pointed to by `data`.
4047 } LDKCVec_NetAddressZ;
4050 * A tuple of 2 elements. See the individual fields for the types contained.
4052 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
4054 * The element at position 0
4056 struct LDKThirtyTwoBytes a;
4058 * The element at position 1
4060 struct LDKThirtyTwoBytes b;
4061 } LDKC2Tuple_PaymentHashPaymentSecretZ;
4064 * The contents of CResult_PaymentSecretAPIErrorZ
4066 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
4068 * A pointer to the contents in the success state.
4069 * Reading from this pointer when `result_ok` is not set is undefined.
4071 struct LDKThirtyTwoBytes *result;
4073 * A pointer to the contents in the error state.
4074 * Reading from this pointer when `result_ok` is set is undefined.
4076 struct LDKAPIError *err;
4077 } LDKCResult_PaymentSecretAPIErrorZPtr;
4080 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
4081 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
4082 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4084 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
4086 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
4087 * `err` or `result` depending on the state of `result_ok`.
4089 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
4091 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
4094 } LDKCResult_PaymentSecretAPIErrorZ;
4097 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
4098 * This corresponds to std::vector in C++
4100 typedef struct LDKCVec_ChannelMonitorZ {
4102 * The elements in the array.
4103 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4105 struct LDKChannelMonitor *data;
4107 * The number of elements pointed to by `data`.
4110 } LDKCVec_ChannelMonitorZ;
4115 * An update generated by the underlying Channel itself which contains some new information the
4116 * ChannelMonitor should be made aware of.
4118 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
4120 * A pointer to the opaque Rust object.
4121 * Nearly everywhere, inner must be non-null, however in places where
4122 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4124 LDKnativeChannelMonitorUpdate *inner;
4126 * Indicates that this is the only struct which contains the same pointer.
4127 * Rust functions which take ownership of an object provided via an argument require
4128 * this to be true and invalidate the object pointed to by inner.
4131 } LDKChannelMonitorUpdate;
4134 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
4135 * blocks are connected and disconnected.
4137 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
4138 * responsible for maintaining a set of monitors such that they can be updated accordingly as
4139 * channel state changes and HTLCs are resolved. See method documentation for specific
4142 * Implementations **must** ensure that updates are successfully applied and persisted upon method
4143 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
4144 * without taking any further action such as persisting the current state.
4146 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
4147 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
4148 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
4149 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
4150 * multiple instances.
4152 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
4153 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
4154 * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
4156 typedef struct LDKWatch {
4158 * An opaque pointer which is passed to your function implementations as an argument.
4159 * This has no meaning in the LDK, and can be NULL or any other value.
4163 * Watches a channel identified by `funding_txo` using `monitor`.
4165 * Implementations are responsible for watching the chain for the funding transaction along
4166 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
4167 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
4169 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
4170 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
4171 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
4173 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
4175 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
4177 * Implementations must call [`update_monitor`] with the given update. See
4178 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
4180 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
4181 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
4183 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
4185 * Returns any monitor events since the last call. Subsequent calls must only return new
4188 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
4190 * Frees any resources associated with this object given its this_arg pointer.
4191 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4193 void (*free)(void *this_arg);
4197 * An interface to send a transaction to the Bitcoin network.
4199 typedef struct LDKBroadcasterInterface {
4201 * An opaque pointer which is passed to your function implementations as an argument.
4202 * This has no meaning in the LDK, and can be NULL or any other value.
4206 * Sends a transaction out to (hopefully) be mined.
4208 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
4210 * Frees any resources associated with this object given its this_arg pointer.
4211 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4213 void (*free)(void *this_arg);
4214 } LDKBroadcasterInterface;
4217 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
4218 * own the memory pointed to by data.
4220 typedef struct LDKu8slice {
4222 * A pointer to the byte buffer
4224 const uint8_t *data;
4226 * The number of bytes pointed to by `data`.
4232 * A trait to describe an object which can get user secrets and key material.
4234 typedef struct LDKKeysInterface {
4236 * An opaque pointer which is passed to your function implementations as an argument.
4237 * This has no meaning in the LDK, and can be NULL or any other value.
4241 * Get node secret key (aka node_id or network_key).
4243 * This method must return the same value each time it is called.
4245 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
4247 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
4249 * This method should return a different value each time it is called, to avoid linking
4250 * on-chain funds across channels as controlled to the same user.
4252 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
4254 * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
4257 * This method should return a different value each time it is called, to avoid linking
4258 * on-chain funds across channels as controlled to the same user.
4260 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
4262 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
4263 * restarted with some stale data!
4265 * This method must return a different value each time it is called.
4267 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
4269 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
4270 * onion packets and for temporary channel IDs. There is no requirement that these be
4271 * persisted anywhere, though they must be unique across restarts.
4273 * This method must return a different value each time it is called.
4275 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
4277 * Reads a `Signer` for this `KeysInterface` from the given input stream.
4278 * This is only called during deserialization of other objects which contain
4279 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
4280 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
4281 * contain no versioning scheme. You may wish to include your own version prefix and ensure
4282 * you've read all of the provided bytes to ensure no corruption occurred.
4284 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
4286 * Sign an invoice's preimage (note that this is the preimage of the invoice, not the HTLC's
4287 * preimage). By parameterizing by the preimage instead of the hash, we allow implementors of
4288 * this trait to parse the invoice and make sure they're signing what they expect, rather than
4289 * blindly signing the hash.
4291 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKCVec_u8Z invoice_preimage);
4293 * Frees any resources associated with this object given its this_arg pointer.
4294 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4296 void (*free)(void *this_arg);
4300 * A trait which should be implemented to provide feerate information on a number of time
4303 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
4304 * called from inside the library in response to chain events, P2P events, or timer events).
4306 typedef struct LDKFeeEstimator {
4308 * An opaque pointer which is passed to your function implementations as an argument.
4309 * This has no meaning in the LDK, and can be NULL or any other value.
4313 * Gets estimated satoshis of fee required per 1000 Weight-Units.
4315 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
4316 * don't put us below 1 satoshi-per-byte).
4318 * This translates to:
4319 * * satoshis-per-byte * 250
4320 * * ceil(satoshis-per-kbyte / 4)
4322 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
4324 * Frees any resources associated with this object given its this_arg pointer.
4325 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4327 void (*free)(void *this_arg);
4331 * A trait encapsulating the operations required of a logger
4333 typedef struct LDKLogger {
4335 * An opaque pointer which is passed to your function implementations as an argument.
4336 * This has no meaning in the LDK, and can be NULL or any other value.
4342 void (*log)(const void *this_arg, const char *record);
4344 * Frees any resources associated with this object given its this_arg pointer.
4345 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4347 void (*free)(void *this_arg);
4353 * Manager which keeps track of a number of channels and sends messages to the appropriate
4354 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
4356 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
4357 * to individual Channels.
4359 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
4360 * all peers during write/read (though does not modify this instance, only the instance being
4361 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
4362 * called funding_transaction_generated for outbound channels).
4364 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
4365 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
4366 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
4367 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
4368 * the serialization process). If the deserialized version is out-of-date compared to the
4369 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
4370 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
4372 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
4373 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
4374 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
4375 * block_connected() to step towards your best block) upon deserialization before using the
4378 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
4379 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
4380 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
4381 * offline for a full minute. In order to track this, you must call
4382 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
4384 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
4385 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
4386 * essentially you should default to using a SimpleRefChannelManager, and use a
4387 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
4388 * you're using lightning-net-tokio.
4390 typedef struct MUST_USE_STRUCT LDKChannelManager {
4392 * A pointer to the opaque Rust object.
4393 * Nearly everywhere, inner must be non-null, however in places where
4394 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4396 LDKnativeChannelManager *inner;
4398 * Indicates that this is the only struct which contains the same pointer.
4399 * Rust functions which take ownership of an object provided via an argument require
4400 * this to be true and invalidate the object pointed to by inner.
4403 } LDKChannelManager;
4406 * A tuple of 2 elements. See the individual fields for the types contained.
4408 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
4410 * The element at position 0
4412 struct LDKThirtyTwoBytes a;
4414 * The element at position 1
4416 struct LDKChannelManager b;
4417 } LDKC2Tuple_BlockHashChannelManagerZ;
4420 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
4422 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
4424 * A pointer to the contents in the success state.
4425 * Reading from this pointer when `result_ok` is not set is undefined.
4427 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
4429 * A pointer to the contents in the error state.
4430 * Reading from this pointer when `result_ok` is set is undefined.
4432 struct LDKDecodeError *err;
4433 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
4436 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
4437 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
4438 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4440 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
4442 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
4443 * `err` or `result` depending on the state of `result_ok`.
4445 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
4447 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
4450 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
4455 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
4456 * with our counterparty.
4458 typedef struct MUST_USE_STRUCT LDKChannelConfig {
4460 * A pointer to the opaque Rust object.
4461 * Nearly everywhere, inner must be non-null, however in places where
4462 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4464 LDKnativeChannelConfig *inner;
4466 * Indicates that this is the only struct which contains the same pointer.
4467 * Rust functions which take ownership of an object provided via an argument require
4468 * this to be true and invalidate the object pointed to by inner.
4474 * The contents of CResult_ChannelConfigDecodeErrorZ
4476 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
4478 * A pointer to the contents in the success state.
4479 * Reading from this pointer when `result_ok` is not set is undefined.
4481 struct LDKChannelConfig *result;
4483 * A pointer to the contents in the error state.
4484 * Reading from this pointer when `result_ok` is set is undefined.
4486 struct LDKDecodeError *err;
4487 } LDKCResult_ChannelConfigDecodeErrorZPtr;
4490 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
4491 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
4492 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4494 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
4496 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
4497 * `err` or `result` depending on the state of `result_ok`.
4499 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
4501 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
4504 } LDKCResult_ChannelConfigDecodeErrorZ;
4507 * The contents of CResult_OutPointDecodeErrorZ
4509 typedef union LDKCResult_OutPointDecodeErrorZPtr {
4511 * A pointer to the contents in the success state.
4512 * Reading from this pointer when `result_ok` is not set is undefined.
4514 struct LDKOutPoint *result;
4516 * A pointer to the contents in the error state.
4517 * Reading from this pointer when `result_ok` is set is undefined.
4519 struct LDKDecodeError *err;
4520 } LDKCResult_OutPointDecodeErrorZPtr;
4523 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
4524 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
4525 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4527 typedef struct LDKCResult_OutPointDecodeErrorZ {
4529 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
4530 * `err` or `result` depending on the state of `result_ok`.
4532 union LDKCResult_OutPointDecodeErrorZPtr contents;
4534 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
4537 } LDKCResult_OutPointDecodeErrorZ;
4540 * The contents of CResult_SiPrefixNoneZ
4542 typedef union LDKCResult_SiPrefixNoneZPtr {
4544 * A pointer to the contents in the success state.
4545 * Reading from this pointer when `result_ok` is not set is undefined.
4547 enum LDKSiPrefix *result;
4549 * Note that this value is always NULL, as there are no contents in the Err variant
4552 } LDKCResult_SiPrefixNoneZPtr;
4555 * A CResult_SiPrefixNoneZ represents the result of a fallible operation,
4556 * containing a crate::lightning_invoice::SiPrefix on success and a () on failure.
4557 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4559 typedef struct LDKCResult_SiPrefixNoneZ {
4561 * The contents of this CResult_SiPrefixNoneZ, accessible via either
4562 * `err` or `result` depending on the state of `result_ok`.
4564 union LDKCResult_SiPrefixNoneZPtr contents;
4566 * Whether this CResult_SiPrefixNoneZ represents a success state.
4569 } LDKCResult_SiPrefixNoneZ;
4574 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
4576 * There are three ways to construct an `Invoice`:
4577 * 1. using `InvoiceBuilder`
4578 * 2. using `Invoice::from_signed(SignedRawInvoice)`
4579 * 3. using `str::parse::<Invoice>(&str)`
4581 typedef struct MUST_USE_STRUCT LDKInvoice {
4583 * A pointer to the opaque Rust object.
4584 * Nearly everywhere, inner must be non-null, however in places where
4585 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4587 LDKnativeInvoice *inner;
4589 * Indicates that this is the only struct which contains the same pointer.
4590 * Rust functions which take ownership of an object provided via an argument require
4591 * this to be true and invalidate the object pointed to by inner.
4597 * The contents of CResult_InvoiceNoneZ
4599 typedef union LDKCResult_InvoiceNoneZPtr {
4601 * A pointer to the contents in the success state.
4602 * Reading from this pointer when `result_ok` is not set is undefined.
4604 struct LDKInvoice *result;
4606 * Note that this value is always NULL, as there are no contents in the Err variant
4609 } LDKCResult_InvoiceNoneZPtr;
4612 * A CResult_InvoiceNoneZ represents the result of a fallible operation,
4613 * containing a crate::lightning_invoice::Invoice on success and a () on failure.
4614 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4616 typedef struct LDKCResult_InvoiceNoneZ {
4618 * The contents of this CResult_InvoiceNoneZ, accessible via either
4619 * `err` or `result` depending on the state of `result_ok`.
4621 union LDKCResult_InvoiceNoneZPtr contents;
4623 * Whether this CResult_InvoiceNoneZ represents a success state.
4626 } LDKCResult_InvoiceNoneZ;
4631 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
4635 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
4637 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
4639 * A pointer to the opaque Rust object.
4640 * Nearly everywhere, inner must be non-null, however in places where
4641 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4643 LDKnativeSignedRawInvoice *inner;
4645 * Indicates that this is the only struct which contains the same pointer.
4646 * Rust functions which take ownership of an object provided via an argument require
4647 * this to be true and invalidate the object pointed to by inner.
4650 } LDKSignedRawInvoice;
4653 * The contents of CResult_SignedRawInvoiceNoneZ
4655 typedef union LDKCResult_SignedRawInvoiceNoneZPtr {
4657 * A pointer to the contents in the success state.
4658 * Reading from this pointer when `result_ok` is not set is undefined.
4660 struct LDKSignedRawInvoice *result;
4662 * Note that this value is always NULL, as there are no contents in the Err variant
4665 } LDKCResult_SignedRawInvoiceNoneZPtr;
4668 * A CResult_SignedRawInvoiceNoneZ represents the result of a fallible operation,
4669 * containing a crate::lightning_invoice::SignedRawInvoice on success and a () on failure.
4670 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4672 typedef struct LDKCResult_SignedRawInvoiceNoneZ {
4674 * The contents of this CResult_SignedRawInvoiceNoneZ, accessible via either
4675 * `err` or `result` depending on the state of `result_ok`.
4677 union LDKCResult_SignedRawInvoiceNoneZPtr contents;
4679 * Whether this CResult_SignedRawInvoiceNoneZ represents a success state.
4682 } LDKCResult_SignedRawInvoiceNoneZ;
4687 * Represents an syntactically correct Invoice for a payment on the lightning network,
4688 * but without the signature information.
4689 * De- and encoding should not lead to information loss but may lead to different hashes.
4691 * For methods without docs see the corresponding methods in `Invoice`.
4693 typedef struct MUST_USE_STRUCT LDKRawInvoice {
4695 * A pointer to the opaque Rust object.
4696 * Nearly everywhere, inner must be non-null, however in places where
4697 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4699 LDKnativeRawInvoice *inner;
4701 * Indicates that this is the only struct which contains the same pointer.
4702 * Rust functions which take ownership of an object provided via an argument require
4703 * this to be true and invalidate the object pointed to by inner.
4711 * Recoverable signature
4713 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
4715 * A pointer to the opaque Rust object.
4716 * Nearly everywhere, inner must be non-null, however in places where
4717 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4719 LDKnativeInvoiceSignature *inner;
4721 * Indicates that this is the only struct which contains the same pointer.
4722 * Rust functions which take ownership of an object provided via an argument require
4723 * this to be true and invalidate the object pointed to by inner.
4726 } LDKInvoiceSignature;
4729 * A tuple of 3 elements. See the individual fields for the types contained.
4731 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
4733 * The element at position 0
4735 struct LDKRawInvoice a;
4737 * The element at position 1
4739 struct LDKThirtyTwoBytes b;
4741 * The element at position 2
4743 struct LDKInvoiceSignature c;
4744 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
4751 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
4753 * A pointer to the opaque Rust object.
4754 * Nearly everywhere, inner must be non-null, however in places where
4755 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4757 LDKnativePayeePubKey *inner;
4759 * Indicates that this is the only struct which contains the same pointer.
4760 * Rust functions which take ownership of an object provided via an argument require
4761 * this to be true and invalidate the object pointed to by inner.
4767 * The contents of CResult_PayeePubKeyErrorZ
4769 typedef union LDKCResult_PayeePubKeyErrorZPtr {
4771 * A pointer to the contents in the success state.
4772 * Reading from this pointer when `result_ok` is not set is undefined.
4774 struct LDKPayeePubKey *result;
4776 * A pointer to the contents in the error state.
4777 * Reading from this pointer when `result_ok` is set is undefined.
4779 enum LDKSecp256k1Error *err;
4780 } LDKCResult_PayeePubKeyErrorZPtr;
4783 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
4784 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
4785 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4787 typedef struct LDKCResult_PayeePubKeyErrorZ {
4789 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
4790 * `err` or `result` depending on the state of `result_ok`.
4792 union LDKCResult_PayeePubKeyErrorZPtr contents;
4794 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
4797 } LDKCResult_PayeePubKeyErrorZ;
4802 * Private routing information
4805 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
4808 typedef struct MUST_USE_STRUCT LDKRouteHint {
4810 * A pointer to the opaque Rust object.
4811 * Nearly everywhere, inner must be non-null, however in places where
4812 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4814 LDKnativeRouteHint *inner;
4816 * Indicates that this is the only struct which contains the same pointer.
4817 * Rust functions which take ownership of an object provided via an argument require
4818 * this to be true and invalidate the object pointed to by inner.
4824 * A dynamically-allocated array of crate::lightning_invoice::RouteHints of arbitrary size.
4825 * This corresponds to std::vector in C++
4827 typedef struct LDKCVec_RouteHintZ {
4829 * The elements in the array.
4830 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4832 struct LDKRouteHint *data;
4834 * The number of elements pointed to by `data`.
4837 } LDKCVec_RouteHintZ;
4842 * A timestamp that refers to a date after 1 January 1970 which means its representation as UNIX
4843 * timestamp is positive.
4846 * The UNIX timestamp representing the stored time has to be positive and small enough so that
4847 * a `EpiryTime` can be added to it without an overflow.
4849 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
4851 * A pointer to the opaque Rust object.
4852 * Nearly everywhere, inner must be non-null, however in places where
4853 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4855 LDKnativePositiveTimestamp *inner;
4857 * Indicates that this is the only struct which contains the same pointer.
4858 * Rust functions which take ownership of an object provided via an argument require
4859 * this to be true and invalidate the object pointed to by inner.
4862 } LDKPositiveTimestamp;
4865 * The contents of CResult_PositiveTimestampCreationErrorZ
4867 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
4869 * A pointer to the contents in the success state.
4870 * Reading from this pointer when `result_ok` is not set is undefined.
4872 struct LDKPositiveTimestamp *result;
4874 * A pointer to the contents in the error state.
4875 * Reading from this pointer when `result_ok` is set is undefined.
4877 enum LDKCreationError *err;
4878 } LDKCResult_PositiveTimestampCreationErrorZPtr;
4881 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
4882 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
4883 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4885 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
4887 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
4888 * `err` or `result` depending on the state of `result_ok`.
4890 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
4892 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
4895 } LDKCResult_PositiveTimestampCreationErrorZ;
4898 * The contents of CResult_NoneSemanticErrorZ
4900 typedef union LDKCResult_NoneSemanticErrorZPtr {
4902 * Note that this value is always NULL, as there are no contents in the OK variant
4906 * A pointer to the contents in the error state.
4907 * Reading from this pointer when `result_ok` is set is undefined.
4909 enum LDKSemanticError *err;
4910 } LDKCResult_NoneSemanticErrorZPtr;
4913 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
4914 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
4915 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4917 typedef struct LDKCResult_NoneSemanticErrorZ {
4919 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
4920 * `err` or `result` depending on the state of `result_ok`.
4922 union LDKCResult_NoneSemanticErrorZPtr contents;
4924 * Whether this CResult_NoneSemanticErrorZ represents a success state.
4927 } LDKCResult_NoneSemanticErrorZ;
4930 * The contents of CResult_InvoiceSemanticErrorZ
4932 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
4934 * A pointer to the contents in the success state.
4935 * Reading from this pointer when `result_ok` is not set is undefined.
4937 struct LDKInvoice *result;
4939 * A pointer to the contents in the error state.
4940 * Reading from this pointer when `result_ok` is set is undefined.
4942 enum LDKSemanticError *err;
4943 } LDKCResult_InvoiceSemanticErrorZPtr;
4946 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
4947 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
4948 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4950 typedef struct LDKCResult_InvoiceSemanticErrorZ {
4952 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
4953 * `err` or `result` depending on the state of `result_ok`.
4955 union LDKCResult_InvoiceSemanticErrorZPtr contents;
4957 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
4960 } LDKCResult_InvoiceSemanticErrorZ;
4965 * Description string
4968 * The description can be at most 639 __bytes__ long
4970 typedef struct MUST_USE_STRUCT LDKDescription {
4972 * A pointer to the opaque Rust object.
4973 * Nearly everywhere, inner must be non-null, however in places where
4974 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4976 LDKnativeDescription *inner;
4978 * Indicates that this is the only struct which contains the same pointer.
4979 * Rust functions which take ownership of an object provided via an argument require
4980 * this to be true and invalidate the object pointed to by inner.
4986 * The contents of CResult_DescriptionCreationErrorZ
4988 typedef union LDKCResult_DescriptionCreationErrorZPtr {
4990 * A pointer to the contents in the success state.
4991 * Reading from this pointer when `result_ok` is not set is undefined.
4993 struct LDKDescription *result;
4995 * A pointer to the contents in the error state.
4996 * Reading from this pointer when `result_ok` is set is undefined.
4998 enum LDKCreationError *err;
4999 } LDKCResult_DescriptionCreationErrorZPtr;
5002 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
5003 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
5004 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5006 typedef struct LDKCResult_DescriptionCreationErrorZ {
5008 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
5009 * `err` or `result` depending on the state of `result_ok`.
5011 union LDKCResult_DescriptionCreationErrorZPtr contents;
5013 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
5016 } LDKCResult_DescriptionCreationErrorZ;
5021 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
5025 * The number of seconds this expiry time represents has to be in the range
5026 * `0...(SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME)` to avoid overflows when adding it to a
5029 typedef struct MUST_USE_STRUCT LDKExpiryTime {
5031 * A pointer to the opaque Rust object.
5032 * Nearly everywhere, inner must be non-null, however in places where
5033 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5035 LDKnativeExpiryTime *inner;
5037 * Indicates that this is the only struct which contains the same pointer.
5038 * Rust functions which take ownership of an object provided via an argument require
5039 * this to be true and invalidate the object pointed to by inner.
5045 * The contents of CResult_ExpiryTimeCreationErrorZ
5047 typedef union LDKCResult_ExpiryTimeCreationErrorZPtr {
5049 * A pointer to the contents in the success state.
5050 * Reading from this pointer when `result_ok` is not set is undefined.
5052 struct LDKExpiryTime *result;
5054 * A pointer to the contents in the error state.
5055 * Reading from this pointer when `result_ok` is set is undefined.
5057 enum LDKCreationError *err;
5058 } LDKCResult_ExpiryTimeCreationErrorZPtr;
5061 * A CResult_ExpiryTimeCreationErrorZ represents the result of a fallible operation,
5062 * containing a crate::lightning_invoice::ExpiryTime on success and a crate::lightning_invoice::CreationError on failure.
5063 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5065 typedef struct LDKCResult_ExpiryTimeCreationErrorZ {
5067 * The contents of this CResult_ExpiryTimeCreationErrorZ, accessible via either
5068 * `err` or `result` depending on the state of `result_ok`.
5070 union LDKCResult_ExpiryTimeCreationErrorZPtr contents;
5072 * Whether this CResult_ExpiryTimeCreationErrorZ represents a success state.
5075 } LDKCResult_ExpiryTimeCreationErrorZ;
5078 * The contents of CResult_RouteHintCreationErrorZ
5080 typedef union LDKCResult_RouteHintCreationErrorZPtr {
5082 * A pointer to the contents in the success state.
5083 * Reading from this pointer when `result_ok` is not set is undefined.
5085 struct LDKRouteHint *result;
5087 * A pointer to the contents in the error state.
5088 * Reading from this pointer when `result_ok` is set is undefined.
5090 enum LDKCreationError *err;
5091 } LDKCResult_RouteHintCreationErrorZPtr;
5094 * A CResult_RouteHintCreationErrorZ represents the result of a fallible operation,
5095 * containing a crate::lightning_invoice::RouteHint on success and a crate::lightning_invoice::CreationError on failure.
5096 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5098 typedef struct LDKCResult_RouteHintCreationErrorZ {
5100 * The contents of this CResult_RouteHintCreationErrorZ, accessible via either
5101 * `err` or `result` depending on the state of `result_ok`.
5103 union LDKCResult_RouteHintCreationErrorZPtr contents;
5105 * Whether this CResult_RouteHintCreationErrorZ represents a success state.
5108 } LDKCResult_RouteHintCreationErrorZ;
5111 * The contents of CResult_StringErrorZ
5113 typedef union LDKCResult_StringErrorZPtr {
5115 * A pointer to the contents in the success state.
5116 * Reading from this pointer when `result_ok` is not set is undefined.
5118 struct LDKStr *result;
5120 * A pointer to the contents in the error state.
5121 * Reading from this pointer when `result_ok` is set is undefined.
5123 enum LDKSecp256k1Error *err;
5124 } LDKCResult_StringErrorZPtr;
5127 * A CResult_StringErrorZ represents the result of a fallible operation,
5128 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
5129 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5131 typedef struct LDKCResult_StringErrorZ {
5133 * The contents of this CResult_StringErrorZ, accessible via either
5134 * `err` or `result` depending on the state of `result_ok`.
5136 union LDKCResult_StringErrorZPtr contents;
5138 * Whether this CResult_StringErrorZ represents a success state.
5141 } LDKCResult_StringErrorZ;
5144 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
5146 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
5148 * A pointer to the contents in the success state.
5149 * Reading from this pointer when `result_ok` is not set is undefined.
5151 struct LDKChannelMonitorUpdate *result;
5153 * A pointer to the contents in the error state.
5154 * Reading from this pointer when `result_ok` is set is undefined.
5156 struct LDKDecodeError *err;
5157 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
5160 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
5161 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5162 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5164 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
5166 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
5167 * `err` or `result` depending on the state of `result_ok`.
5169 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
5171 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
5174 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
5177 * The contents of CResult_HTLCUpdateDecodeErrorZ
5179 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
5181 * A pointer to the contents in the success state.
5182 * Reading from this pointer when `result_ok` is not set is undefined.
5184 struct LDKHTLCUpdate *result;
5186 * A pointer to the contents in the error state.
5187 * Reading from this pointer when `result_ok` is set is undefined.
5189 struct LDKDecodeError *err;
5190 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
5193 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
5194 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5195 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5197 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
5199 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
5200 * `err` or `result` depending on the state of `result_ok`.
5202 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
5204 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
5207 } LDKCResult_HTLCUpdateDecodeErrorZ;
5212 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
5213 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
5214 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
5216 * Contains a developer-readable error message.
5218 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
5220 * A pointer to the opaque Rust object.
5221 * Nearly everywhere, inner must be non-null, however in places where
5222 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5224 LDKnativeMonitorUpdateError *inner;
5226 * Indicates that this is the only struct which contains the same pointer.
5227 * Rust functions which take ownership of an object provided via an argument require
5228 * this to be true and invalidate the object pointed to by inner.
5231 } LDKMonitorUpdateError;
5234 * The contents of CResult_NoneMonitorUpdateErrorZ
5236 typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
5238 * Note that this value is always NULL, as there are no contents in the OK variant
5242 * A pointer to the contents in the error state.
5243 * Reading from this pointer when `result_ok` is set is undefined.
5245 struct LDKMonitorUpdateError *err;
5246 } LDKCResult_NoneMonitorUpdateErrorZPtr;
5249 * A CResult_NoneMonitorUpdateErrorZ represents the result of a fallible operation,
5250 * containing a () on success and a crate::lightning::chain::channelmonitor::MonitorUpdateError on failure.
5251 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5253 typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
5255 * The contents of this CResult_NoneMonitorUpdateErrorZ, accessible via either
5256 * `err` or `result` depending on the state of `result_ok`.
5258 union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
5260 * Whether this CResult_NoneMonitorUpdateErrorZ represents a success state.
5263 } LDKCResult_NoneMonitorUpdateErrorZ;
5266 * A tuple of 2 elements. See the individual fields for the types contained.
5268 typedef struct LDKC2Tuple_OutPointScriptZ {
5270 * The element at position 0
5272 struct LDKOutPoint a;
5274 * The element at position 1
5276 struct LDKCVec_u8Z b;
5277 } LDKC2Tuple_OutPointScriptZ;
5280 * A tuple of 2 elements. See the individual fields for the types contained.
5282 typedef struct LDKC2Tuple_u32ScriptZ {
5284 * The element at position 0
5288 * The element at position 1
5290 struct LDKCVec_u8Z b;
5291 } LDKC2Tuple_u32ScriptZ;
5294 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
5295 * This corresponds to std::vector in C++
5297 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
5299 * The elements in the array.
5300 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5302 struct LDKC2Tuple_u32ScriptZ *data;
5304 * The number of elements pointed to by `data`.
5307 } LDKCVec_C2Tuple_u32ScriptZZ;
5310 * A tuple of 2 elements. See the individual fields for the types contained.
5312 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
5314 * The element at position 0
5316 struct LDKThirtyTwoBytes a;
5318 * The element at position 1
5320 struct LDKCVec_C2Tuple_u32ScriptZZ b;
5321 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
5324 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
5325 * This corresponds to std::vector in C++
5327 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
5329 * The elements in the array.
5330 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5332 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
5334 * The number of elements pointed to by `data`.
5337 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
5340 * An Event which you should probably take some action in response to.
5342 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
5343 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
5344 * written as it makes no sense to respond to it after reconnecting to peers).
5346 typedef enum LDKEvent_Tag {
5348 * Used to indicate that the client should generate a funding transaction with the given
5349 * parameters and then call ChannelManager::funding_transaction_generated.
5350 * Generated in ChannelManager message handling.
5351 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
5352 * counterparty can steal your funds!
5354 LDKEvent_FundingGenerationReady,
5356 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
5357 * ChannelManager::claim_funds to get it....
5358 * Note that if the preimage is not known or the amount paid is incorrect, you should call
5359 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
5360 * network congestion.
5361 * The amount paid should be considered 'incorrect' when it is less than or more than twice
5362 * the amount expected.
5363 * If you fail to call either ChannelManager::claim_funds or
5364 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
5365 * automatically failed.
5367 LDKEvent_PaymentReceived,
5369 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
5370 * and we got back the payment preimage for it).
5372 LDKEvent_PaymentSent,
5374 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
5375 * something. You may wish to retry with a different route.
5377 LDKEvent_PaymentFailed,
5379 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
5380 * time in the future.
5382 LDKEvent_PendingHTLCsForwardable,
5384 * Used to indicate that an output which you should know how to spend was confirmed on chain
5385 * and is now spendable.
5386 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
5387 * counterparty spending them due to some kind of timeout. Thus, you need to store them
5388 * somewhere and spend them when you create on-chain transactions.
5390 LDKEvent_SpendableOutputs,
5392 * Must be last for serialization purposes
5397 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
5399 * The random channel_id we picked which you'll need to pass into
5400 * ChannelManager::funding_transaction_generated.
5402 struct LDKThirtyTwoBytes temporary_channel_id;
5404 * The value, in satoshis, that the output should have.
5406 uint64_t channel_value_satoshis;
5408 * The script which should be used in the transaction output.
5410 struct LDKCVec_u8Z output_script;
5412 * The value passed in to ChannelManager::create_channel
5414 uint64_t user_channel_id;
5415 } LDKEvent_LDKFundingGenerationReady_Body;
5417 typedef struct LDKEvent_LDKPaymentReceived_Body {
5419 * The hash for which the preimage should be handed to the ChannelManager.
5421 struct LDKThirtyTwoBytes payment_hash;
5423 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
5424 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
5425 * [`ChannelManager::claim_funds`].
5427 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
5428 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
5430 struct LDKThirtyTwoBytes payment_preimage;
5432 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
5433 * number of deanonymization attacks during the routing process.
5434 * It is provided here for your reference, however its accuracy is enforced directly by
5435 * [`ChannelManager`] using the values you previously provided to
5436 * [`ChannelManager::create_inbound_payment`] or
5437 * [`ChannelManager::create_inbound_payment_for_hash`].
5439 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
5440 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
5441 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
5443 struct LDKThirtyTwoBytes payment_secret;
5445 * The value, in thousandths of a satoshi, that this payment is for. Note that you must
5446 * compare this to the expected value before accepting the payment (as otherwise you are
5447 * providing proof-of-payment for less than the value you expected!).
5451 * This is the `user_payment_id` which was provided to
5452 * [`ChannelManager::create_inbound_payment_for_hash`] or
5453 * [`ChannelManager::create_inbound_payment`]. It has no meaning inside of LDK and is
5454 * simply copied here. It may be used to correlate PaymentReceived events with invoice
5455 * metadata stored elsewhere.
5457 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
5458 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
5460 uint64_t user_payment_id;
5461 } LDKEvent_LDKPaymentReceived_Body;
5463 typedef struct LDKEvent_LDKPaymentSent_Body {
5465 * The preimage to the hash given to ChannelManager::send_payment.
5466 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
5469 struct LDKThirtyTwoBytes payment_preimage;
5470 } LDKEvent_LDKPaymentSent_Body;
5472 typedef struct LDKEvent_LDKPaymentFailed_Body {
5474 * The hash which was given to ChannelManager::send_payment.
5476 struct LDKThirtyTwoBytes payment_hash;
5478 * Indicates the payment was rejected for some reason by the recipient. This implies that
5479 * the payment has failed, not just the route in question. If this is not set, you may
5480 * retry the payment via a different route.
5482 bool rejected_by_dest;
5483 } LDKEvent_LDKPaymentFailed_Body;
5485 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
5487 * The minimum amount of time that should be waited prior to calling
5488 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
5489 * you should wait a random amount of time in roughly the range (now + time_forwardable,
5490 * now + 5*time_forwardable).
5492 uint64_t time_forwardable;
5493 } LDKEvent_LDKPendingHTLCsForwardable_Body;
5495 typedef struct LDKEvent_LDKSpendableOutputs_Body {
5497 * The outputs which you should store as spendable by you.
5499 struct LDKCVec_SpendableOutputDescriptorZ outputs;
5500 } LDKEvent_LDKSpendableOutputs_Body;
5502 typedef struct MUST_USE_STRUCT LDKEvent {
5505 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
5506 LDKEvent_LDKPaymentReceived_Body payment_received;
5507 LDKEvent_LDKPaymentSent_Body payment_sent;
5508 LDKEvent_LDKPaymentFailed_Body payment_failed;
5509 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
5510 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
5515 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
5516 * This corresponds to std::vector in C++
5518 typedef struct LDKCVec_EventZ {
5520 * The elements in the array.
5521 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5523 struct LDKEvent *data;
5525 * The number of elements pointed to by `data`.
5531 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
5532 * This corresponds to std::vector in C++
5534 typedef struct LDKCVec_TransactionZ {
5536 * The elements in the array.
5537 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5539 struct LDKTransaction *data;
5541 * The number of elements pointed to by `data`.
5544 } LDKCVec_TransactionZ;
5547 * A tuple of 2 elements. See the individual fields for the types contained.
5549 typedef struct LDKC2Tuple_u32TxOutZ {
5551 * The element at position 0
5555 * The element at position 1
5558 } LDKC2Tuple_u32TxOutZ;
5561 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
5562 * This corresponds to std::vector in C++
5564 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
5566 * The elements in the array.
5567 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5569 struct LDKC2Tuple_u32TxOutZ *data;
5571 * The number of elements pointed to by `data`.
5574 } LDKCVec_C2Tuple_u32TxOutZZ;
5577 * A tuple of 2 elements. See the individual fields for the types contained.
5579 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
5581 * The element at position 0
5583 struct LDKThirtyTwoBytes a;
5585 * The element at position 1
5587 struct LDKCVec_C2Tuple_u32TxOutZZ b;
5588 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
5591 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
5592 * This corresponds to std::vector in C++
5594 typedef struct LDKCVec_TransactionOutputsZ {
5596 * The elements in the array.
5597 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5599 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
5601 * The number of elements pointed to by `data`.
5604 } LDKCVec_TransactionOutputsZ;
5607 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
5609 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
5611 * A pointer to the contents in the success state.
5612 * Reading from this pointer when `result_ok` is not set is undefined.
5614 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
5616 * A pointer to the contents in the error state.
5617 * Reading from this pointer when `result_ok` is set is undefined.
5619 struct LDKDecodeError *err;
5620 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
5623 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
5624 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5625 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5627 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
5629 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
5630 * `err` or `result` depending on the state of `result_ok`.
5632 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
5634 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
5637 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
5640 * The contents of CResult_boolLightningErrorZ
5642 typedef union LDKCResult_boolLightningErrorZPtr {
5644 * A pointer to the contents in the success state.
5645 * Reading from this pointer when `result_ok` is not set is undefined.
5649 * A pointer to the contents in the error state.
5650 * Reading from this pointer when `result_ok` is set is undefined.
5652 struct LDKLightningError *err;
5653 } LDKCResult_boolLightningErrorZPtr;
5656 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5657 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5658 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5660 typedef struct LDKCResult_boolLightningErrorZ {
5662 * The contents of this CResult_boolLightningErrorZ, accessible via either
5663 * `err` or `result` depending on the state of `result_ok`.
5665 union LDKCResult_boolLightningErrorZPtr contents;
5667 * Whether this CResult_boolLightningErrorZ represents a success state.
5670 } LDKCResult_boolLightningErrorZ;
5673 * A tuple of 3 elements. See the individual fields for the types contained.
5675 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5677 * The element at position 0
5679 struct LDKChannelAnnouncement a;
5681 * The element at position 1
5683 struct LDKChannelUpdate b;
5685 * The element at position 2
5687 struct LDKChannelUpdate c;
5688 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5691 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
5692 * This corresponds to std::vector in C++
5694 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5696 * The elements in the array.
5697 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5699 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
5701 * The number of elements pointed to by `data`.
5704 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5707 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
5708 * This corresponds to std::vector in C++
5710 typedef struct LDKCVec_NodeAnnouncementZ {
5712 * The elements in the array.
5713 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5715 struct LDKNodeAnnouncement *data;
5717 * The number of elements pointed to by `data`.
5720 } LDKCVec_NodeAnnouncementZ;
5723 * The contents of CResult_NoneLightningErrorZ
5725 typedef union LDKCResult_NoneLightningErrorZPtr {
5727 * Note that this value is always NULL, as there are no contents in the OK variant
5731 * A pointer to the contents in the error state.
5732 * Reading from this pointer when `result_ok` is set is undefined.
5734 struct LDKLightningError *err;
5735 } LDKCResult_NoneLightningErrorZPtr;
5738 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5739 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5740 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5742 typedef struct LDKCResult_NoneLightningErrorZ {
5744 * The contents of this CResult_NoneLightningErrorZ, accessible via either
5745 * `err` or `result` depending on the state of `result_ok`.
5747 union LDKCResult_NoneLightningErrorZPtr contents;
5749 * Whether this CResult_NoneLightningErrorZ represents a success state.
5752 } LDKCResult_NoneLightningErrorZ;
5755 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
5756 * This corresponds to std::vector in C++
5758 typedef struct LDKCVec_PublicKeyZ {
5760 * The elements in the array.
5761 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5763 struct LDKPublicKey *data;
5765 * The number of elements pointed to by `data`.
5768 } LDKCVec_PublicKeyZ;
5773 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
5774 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
5777 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
5779 * A pointer to the opaque Rust object.
5780 * Nearly everywhere, inner must be non-null, however in places where
5781 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5783 LDKnativePeerHandleError *inner;
5785 * Indicates that this is the only struct which contains the same pointer.
5786 * Rust functions which take ownership of an object provided via an argument require
5787 * this to be true and invalidate the object pointed to by inner.
5790 } LDKPeerHandleError;
5793 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
5795 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
5797 * A pointer to the contents in the success state.
5798 * Reading from this pointer when `result_ok` is not set is undefined.
5800 struct LDKCVec_u8Z *result;
5802 * A pointer to the contents in the error state.
5803 * Reading from this pointer when `result_ok` is set is undefined.
5805 struct LDKPeerHandleError *err;
5806 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
5809 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
5810 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
5811 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5813 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
5815 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
5816 * `err` or `result` depending on the state of `result_ok`.
5818 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
5820 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
5823 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
5826 * The contents of CResult_NonePeerHandleErrorZ
5828 typedef union LDKCResult_NonePeerHandleErrorZPtr {
5830 * Note that this value is always NULL, as there are no contents in the OK variant
5834 * A pointer to the contents in the error state.
5835 * Reading from this pointer when `result_ok` is set is undefined.
5837 struct LDKPeerHandleError *err;
5838 } LDKCResult_NonePeerHandleErrorZPtr;
5841 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
5842 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
5843 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5845 typedef struct LDKCResult_NonePeerHandleErrorZ {
5847 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
5848 * `err` or `result` depending on the state of `result_ok`.
5850 union LDKCResult_NonePeerHandleErrorZPtr contents;
5852 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
5855 } LDKCResult_NonePeerHandleErrorZ;
5858 * The contents of CResult_boolPeerHandleErrorZ
5860 typedef union LDKCResult_boolPeerHandleErrorZPtr {
5862 * A pointer to the contents in the success state.
5863 * Reading from this pointer when `result_ok` is not set is undefined.
5867 * A pointer to the contents in the error state.
5868 * Reading from this pointer when `result_ok` is set is undefined.
5870 struct LDKPeerHandleError *err;
5871 } LDKCResult_boolPeerHandleErrorZPtr;
5874 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
5875 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
5876 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5878 typedef struct LDKCResult_boolPeerHandleErrorZ {
5880 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
5881 * `err` or `result` depending on the state of `result_ok`.
5883 union LDKCResult_boolPeerHandleErrorZPtr contents;
5885 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
5888 } LDKCResult_boolPeerHandleErrorZ;
5893 * Details about one direction of a channel. Received
5894 * within a channel update.
5896 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
5898 * A pointer to the opaque Rust object.
5899 * Nearly everywhere, inner must be non-null, however in places where
5900 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5902 LDKnativeDirectionalChannelInfo *inner;
5904 * Indicates that this is the only struct which contains the same pointer.
5905 * Rust functions which take ownership of an object provided via an argument require
5906 * this to be true and invalidate the object pointed to by inner.
5909 } LDKDirectionalChannelInfo;
5912 * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
5914 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
5916 * A pointer to the contents in the success state.
5917 * Reading from this pointer when `result_ok` is not set is undefined.
5919 struct LDKDirectionalChannelInfo *result;
5921 * A pointer to the contents in the error state.
5922 * Reading from this pointer when `result_ok` is set is undefined.
5924 struct LDKDecodeError *err;
5925 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
5928 * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
5929 * containing a crate::lightning::routing::network_graph::DirectionalChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5930 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5932 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
5934 * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
5935 * `err` or `result` depending on the state of `result_ok`.
5937 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
5939 * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
5942 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
5947 * Details about a channel (both directions).
5948 * Received within a channel announcement.
5950 typedef struct MUST_USE_STRUCT LDKChannelInfo {
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 LDKnativeChannelInfo *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.
5966 * The contents of CResult_ChannelInfoDecodeErrorZ
5968 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
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 LDKChannelInfo *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_ChannelInfoDecodeErrorZPtr;
5982 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
5983 * containing a crate::lightning::routing::network_graph::ChannelInfo 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_ChannelInfoDecodeErrorZ {
5988 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
5989 * `err` or `result` depending on the state of `result_ok`.
5991 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
5993 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
5996 } LDKCResult_ChannelInfoDecodeErrorZ;
6001 * Fees for routing via a given channel or a node
6003 typedef struct MUST_USE_STRUCT LDKRoutingFees {
6005 * A pointer to the opaque Rust object.
6006 * Nearly everywhere, inner must be non-null, however in places where
6007 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6009 LDKnativeRoutingFees *inner;
6011 * Indicates that this is the only struct which contains the same pointer.
6012 * Rust functions which take ownership of an object provided via an argument require
6013 * this to be true and invalidate the object pointed to by inner.
6019 * The contents of CResult_RoutingFeesDecodeErrorZ
6021 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
6023 * A pointer to the contents in the success state.
6024 * Reading from this pointer when `result_ok` is not set is undefined.
6026 struct LDKRoutingFees *result;
6028 * A pointer to the contents in the error state.
6029 * Reading from this pointer when `result_ok` is set is undefined.
6031 struct LDKDecodeError *err;
6032 } LDKCResult_RoutingFeesDecodeErrorZPtr;
6035 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
6036 * containing a crate::lightning::routing::network_graph::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
6037 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6039 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
6041 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
6042 * `err` or `result` depending on the state of `result_ok`.
6044 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
6046 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
6049 } LDKCResult_RoutingFeesDecodeErrorZ;
6054 * Information received in the latest node_announcement from this node.
6056 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
6058 * A pointer to the opaque Rust object.
6059 * Nearly everywhere, inner must be non-null, however in places where
6060 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6062 LDKnativeNodeAnnouncementInfo *inner;
6064 * Indicates that this is the only struct which contains the same pointer.
6065 * Rust functions which take ownership of an object provided via an argument require
6066 * this to be true and invalidate the object pointed to by inner.
6069 } LDKNodeAnnouncementInfo;
6072 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
6074 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
6076 * A pointer to the contents in the success state.
6077 * Reading from this pointer when `result_ok` is not set is undefined.
6079 struct LDKNodeAnnouncementInfo *result;
6081 * A pointer to the contents in the error state.
6082 * Reading from this pointer when `result_ok` is set is undefined.
6084 struct LDKDecodeError *err;
6085 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
6088 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
6089 * containing a crate::lightning::routing::network_graph::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6090 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6092 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
6094 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
6095 * `err` or `result` depending on the state of `result_ok`.
6097 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
6099 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
6102 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
6105 * A dynamically-allocated array of u64s of arbitrary size.
6106 * This corresponds to std::vector in C++
6108 typedef struct LDKCVec_u64Z {
6110 * The elements in the array.
6111 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6115 * The number of elements pointed to by `data`.
6123 * Details about a node in the network, known from the network announcement.
6125 typedef struct MUST_USE_STRUCT LDKNodeInfo {
6127 * A pointer to the opaque Rust object.
6128 * Nearly everywhere, inner must be non-null, however in places where
6129 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6131 LDKnativeNodeInfo *inner;
6133 * Indicates that this is the only struct which contains the same pointer.
6134 * Rust functions which take ownership of an object provided via an argument require
6135 * this to be true and invalidate the object pointed to by inner.
6141 * The contents of CResult_NodeInfoDecodeErrorZ
6143 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
6145 * A pointer to the contents in the success state.
6146 * Reading from this pointer when `result_ok` is not set is undefined.
6148 struct LDKNodeInfo *result;
6150 * A pointer to the contents in the error state.
6151 * Reading from this pointer when `result_ok` is set is undefined.
6153 struct LDKDecodeError *err;
6154 } LDKCResult_NodeInfoDecodeErrorZPtr;
6157 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
6158 * containing a crate::lightning::routing::network_graph::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6159 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6161 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
6163 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
6164 * `err` or `result` depending on the state of `result_ok`.
6166 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
6168 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
6171 } LDKCResult_NodeInfoDecodeErrorZ;
6176 * Represents the network as nodes and channels between them
6178 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
6180 * A pointer to the opaque Rust object.
6181 * Nearly everywhere, inner must be non-null, however in places where
6182 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6184 LDKnativeNetworkGraph *inner;
6186 * Indicates that this is the only struct which contains the same pointer.
6187 * Rust functions which take ownership of an object provided via an argument require
6188 * this to be true and invalidate the object pointed to by inner.
6194 * The contents of CResult_NetworkGraphDecodeErrorZ
6196 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
6198 * A pointer to the contents in the success state.
6199 * Reading from this pointer when `result_ok` is not set is undefined.
6201 struct LDKNetworkGraph *result;
6203 * A pointer to the contents in the error state.
6204 * Reading from this pointer when `result_ok` is set is undefined.
6206 struct LDKDecodeError *err;
6207 } LDKCResult_NetworkGraphDecodeErrorZPtr;
6210 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
6211 * containing a crate::lightning::routing::network_graph::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
6212 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6214 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
6216 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
6217 * `err` or `result` depending on the state of `result_ok`.
6219 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
6221 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
6224 } LDKCResult_NetworkGraphDecodeErrorZ;
6227 * The contents of CResult_NetAddressu8Z
6229 typedef union LDKCResult_NetAddressu8ZPtr {
6231 * A pointer to the contents in the success state.
6232 * Reading from this pointer when `result_ok` is not set is undefined.
6234 struct LDKNetAddress *result;
6236 * A pointer to the contents in the error state.
6237 * Reading from this pointer when `result_ok` is set is undefined.
6240 } LDKCResult_NetAddressu8ZPtr;
6243 * A CResult_NetAddressu8Z represents the result of a fallible operation,
6244 * containing a crate::lightning::ln::msgs::NetAddress on success and a u8 on failure.
6245 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6247 typedef struct LDKCResult_NetAddressu8Z {
6249 * The contents of this CResult_NetAddressu8Z, accessible via either
6250 * `err` or `result` depending on the state of `result_ok`.
6252 union LDKCResult_NetAddressu8ZPtr contents;
6254 * Whether this CResult_NetAddressu8Z represents a success state.
6257 } LDKCResult_NetAddressu8Z;
6260 * The contents of CResult_CResult_NetAddressu8ZDecodeErrorZ
6262 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
6264 * A pointer to the contents in the success state.
6265 * Reading from this pointer when `result_ok` is not set is undefined.
6267 struct LDKCResult_NetAddressu8Z *result;
6269 * A pointer to the contents in the error state.
6270 * Reading from this pointer when `result_ok` is set is undefined.
6272 struct LDKDecodeError *err;
6273 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
6276 * A CResult_CResult_NetAddressu8ZDecodeErrorZ represents the result of a fallible operation,
6277 * containing a crate::c_types::derived::CResult_NetAddressu8Z on success and a crate::lightning::ln::msgs::DecodeError on failure.
6278 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6280 typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
6282 * The contents of this CResult_CResult_NetAddressu8ZDecodeErrorZ, accessible via either
6283 * `err` or `result` depending on the state of `result_ok`.
6285 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
6287 * Whether this CResult_CResult_NetAddressu8ZDecodeErrorZ represents a success state.
6290 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
6293 * The contents of CResult_NetAddressDecodeErrorZ
6295 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
6297 * A pointer to the contents in the success state.
6298 * Reading from this pointer when `result_ok` is not set is undefined.
6300 struct LDKNetAddress *result;
6302 * A pointer to the contents in the error state.
6303 * Reading from this pointer when `result_ok` is set is undefined.
6305 struct LDKDecodeError *err;
6306 } LDKCResult_NetAddressDecodeErrorZPtr;
6309 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
6310 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
6311 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6313 typedef struct LDKCResult_NetAddressDecodeErrorZ {
6315 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
6316 * `err` or `result` depending on the state of `result_ok`.
6318 union LDKCResult_NetAddressDecodeErrorZPtr contents;
6320 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
6323 } LDKCResult_NetAddressDecodeErrorZ;
6328 * An update_add_htlc message to be sent or received from a peer
6330 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
6332 * A pointer to the opaque Rust object.
6333 * Nearly everywhere, inner must be non-null, however in places where
6334 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6336 LDKnativeUpdateAddHTLC *inner;
6338 * Indicates that this is the only struct which contains the same pointer.
6339 * Rust functions which take ownership of an object provided via an argument require
6340 * this to be true and invalidate the object pointed to by inner.
6346 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
6347 * This corresponds to std::vector in C++
6349 typedef struct LDKCVec_UpdateAddHTLCZ {
6351 * The elements in the array.
6352 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6354 struct LDKUpdateAddHTLC *data;
6356 * The number of elements pointed to by `data`.
6359 } LDKCVec_UpdateAddHTLCZ;
6364 * An update_fulfill_htlc message to be sent or received from a peer
6366 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
6368 * A pointer to the opaque Rust object.
6369 * Nearly everywhere, inner must be non-null, however in places where
6370 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6372 LDKnativeUpdateFulfillHTLC *inner;
6374 * Indicates that this is the only struct which contains the same pointer.
6375 * Rust functions which take ownership of an object provided via an argument require
6376 * this to be true and invalidate the object pointed to by inner.
6379 } LDKUpdateFulfillHTLC;
6382 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
6383 * This corresponds to std::vector in C++
6385 typedef struct LDKCVec_UpdateFulfillHTLCZ {
6387 * The elements in the array.
6388 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6390 struct LDKUpdateFulfillHTLC *data;
6392 * The number of elements pointed to by `data`.
6395 } LDKCVec_UpdateFulfillHTLCZ;
6400 * An update_fail_htlc message to be sent or received from a peer
6402 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
6404 * A pointer to the opaque Rust object.
6405 * Nearly everywhere, inner must be non-null, however in places where
6406 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6408 LDKnativeUpdateFailHTLC *inner;
6410 * Indicates that this is the only struct which contains the same pointer.
6411 * Rust functions which take ownership of an object provided via an argument require
6412 * this to be true and invalidate the object pointed to by inner.
6415 } LDKUpdateFailHTLC;
6418 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
6419 * This corresponds to std::vector in C++
6421 typedef struct LDKCVec_UpdateFailHTLCZ {
6423 * The elements in the array.
6424 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6426 struct LDKUpdateFailHTLC *data;
6428 * The number of elements pointed to by `data`.
6431 } LDKCVec_UpdateFailHTLCZ;
6436 * An update_fail_malformed_htlc message to be sent or received from a peer
6438 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
6440 * A pointer to the opaque Rust object.
6441 * Nearly everywhere, inner must be non-null, however in places where
6442 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6444 LDKnativeUpdateFailMalformedHTLC *inner;
6446 * Indicates that this is the only struct which contains the same pointer.
6447 * Rust functions which take ownership of an object provided via an argument require
6448 * this to be true and invalidate the object pointed to by inner.
6451 } LDKUpdateFailMalformedHTLC;
6454 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
6455 * This corresponds to std::vector in C++
6457 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
6459 * The elements in the array.
6460 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6462 struct LDKUpdateFailMalformedHTLC *data;
6464 * The number of elements pointed to by `data`.
6467 } LDKCVec_UpdateFailMalformedHTLCZ;
6470 * The contents of CResult_AcceptChannelDecodeErrorZ
6472 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
6474 * A pointer to the contents in the success state.
6475 * Reading from this pointer when `result_ok` is not set is undefined.
6477 struct LDKAcceptChannel *result;
6479 * A pointer to the contents in the error state.
6480 * Reading from this pointer when `result_ok` is set is undefined.
6482 struct LDKDecodeError *err;
6483 } LDKCResult_AcceptChannelDecodeErrorZPtr;
6486 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
6487 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
6488 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6490 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
6492 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
6493 * `err` or `result` depending on the state of `result_ok`.
6495 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
6497 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
6500 } LDKCResult_AcceptChannelDecodeErrorZ;
6503 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
6505 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
6507 * A pointer to the contents in the success state.
6508 * Reading from this pointer when `result_ok` is not set is undefined.
6510 struct LDKAnnouncementSignatures *result;
6512 * A pointer to the contents in the error state.
6513 * Reading from this pointer when `result_ok` is set is undefined.
6515 struct LDKDecodeError *err;
6516 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
6519 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
6520 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6521 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6523 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
6525 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
6526 * `err` or `result` depending on the state of `result_ok`.
6528 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
6530 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
6533 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
6536 * The contents of CResult_ChannelReestablishDecodeErrorZ
6538 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
6540 * A pointer to the contents in the success state.
6541 * Reading from this pointer when `result_ok` is not set is undefined.
6543 struct LDKChannelReestablish *result;
6545 * A pointer to the contents in the error state.
6546 * Reading from this pointer when `result_ok` is set is undefined.
6548 struct LDKDecodeError *err;
6549 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
6552 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
6553 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
6554 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6556 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
6558 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
6559 * `err` or `result` depending on the state of `result_ok`.
6561 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
6563 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
6566 } LDKCResult_ChannelReestablishDecodeErrorZ;
6569 * The contents of CResult_ClosingSignedDecodeErrorZ
6571 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
6573 * A pointer to the contents in the success state.
6574 * Reading from this pointer when `result_ok` is not set is undefined.
6576 struct LDKClosingSigned *result;
6578 * A pointer to the contents in the error state.
6579 * Reading from this pointer when `result_ok` is set is undefined.
6581 struct LDKDecodeError *err;
6582 } LDKCResult_ClosingSignedDecodeErrorZPtr;
6585 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
6586 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
6587 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6589 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
6591 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
6592 * `err` or `result` depending on the state of `result_ok`.
6594 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
6596 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
6599 } LDKCResult_ClosingSignedDecodeErrorZ;
6604 * A commitment_signed message to be sent or received from a peer
6606 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
6608 * A pointer to the opaque Rust object.
6609 * Nearly everywhere, inner must be non-null, however in places where
6610 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6612 LDKnativeCommitmentSigned *inner;
6614 * Indicates that this is the only struct which contains the same pointer.
6615 * Rust functions which take ownership of an object provided via an argument require
6616 * this to be true and invalidate the object pointed to by inner.
6619 } LDKCommitmentSigned;
6622 * The contents of CResult_CommitmentSignedDecodeErrorZ
6624 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
6626 * A pointer to the contents in the success state.
6627 * Reading from this pointer when `result_ok` is not set is undefined.
6629 struct LDKCommitmentSigned *result;
6631 * A pointer to the contents in the error state.
6632 * Reading from this pointer when `result_ok` is set is undefined.
6634 struct LDKDecodeError *err;
6635 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
6638 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
6639 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
6640 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6642 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
6644 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
6645 * `err` or `result` depending on the state of `result_ok`.
6647 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
6649 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
6652 } LDKCResult_CommitmentSignedDecodeErrorZ;
6655 * The contents of CResult_FundingCreatedDecodeErrorZ
6657 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
6659 * A pointer to the contents in the success state.
6660 * Reading from this pointer when `result_ok` is not set is undefined.
6662 struct LDKFundingCreated *result;
6664 * A pointer to the contents in the error state.
6665 * Reading from this pointer when `result_ok` is set is undefined.
6667 struct LDKDecodeError *err;
6668 } LDKCResult_FundingCreatedDecodeErrorZPtr;
6671 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
6672 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
6673 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6675 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
6677 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
6678 * `err` or `result` depending on the state of `result_ok`.
6680 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
6682 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
6685 } LDKCResult_FundingCreatedDecodeErrorZ;
6688 * The contents of CResult_FundingSignedDecodeErrorZ
6690 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
6692 * A pointer to the contents in the success state.
6693 * Reading from this pointer when `result_ok` is not set is undefined.
6695 struct LDKFundingSigned *result;
6697 * A pointer to the contents in the error state.
6698 * Reading from this pointer when `result_ok` is set is undefined.
6700 struct LDKDecodeError *err;
6701 } LDKCResult_FundingSignedDecodeErrorZPtr;
6704 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
6705 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
6706 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6708 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
6710 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
6711 * `err` or `result` depending on the state of `result_ok`.
6713 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
6715 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
6718 } LDKCResult_FundingSignedDecodeErrorZ;
6721 * The contents of CResult_FundingLockedDecodeErrorZ
6723 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
6725 * A pointer to the contents in the success state.
6726 * Reading from this pointer when `result_ok` is not set is undefined.
6728 struct LDKFundingLocked *result;
6730 * A pointer to the contents in the error state.
6731 * Reading from this pointer when `result_ok` is set is undefined.
6733 struct LDKDecodeError *err;
6734 } LDKCResult_FundingLockedDecodeErrorZPtr;
6737 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
6738 * containing a crate::lightning::ln::msgs::FundingLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
6739 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6741 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
6743 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
6744 * `err` or `result` depending on the state of `result_ok`.
6746 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
6748 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
6751 } LDKCResult_FundingLockedDecodeErrorZ;
6756 * An init message to be sent or received from a peer
6758 typedef struct MUST_USE_STRUCT LDKInit {
6760 * A pointer to the opaque Rust object.
6761 * Nearly everywhere, inner must be non-null, however in places where
6762 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6764 LDKnativeInit *inner;
6766 * Indicates that this is the only struct which contains the same pointer.
6767 * Rust functions which take ownership of an object provided via an argument require
6768 * this to be true and invalidate the object pointed to by inner.
6774 * The contents of CResult_InitDecodeErrorZ
6776 typedef union LDKCResult_InitDecodeErrorZPtr {
6778 * A pointer to the contents in the success state.
6779 * Reading from this pointer when `result_ok` is not set is undefined.
6781 struct LDKInit *result;
6783 * A pointer to the contents in the error state.
6784 * Reading from this pointer when `result_ok` is set is undefined.
6786 struct LDKDecodeError *err;
6787 } LDKCResult_InitDecodeErrorZPtr;
6790 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
6791 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
6792 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6794 typedef struct LDKCResult_InitDecodeErrorZ {
6796 * The contents of this CResult_InitDecodeErrorZ, accessible via either
6797 * `err` or `result` depending on the state of `result_ok`.
6799 union LDKCResult_InitDecodeErrorZPtr contents;
6801 * Whether this CResult_InitDecodeErrorZ represents a success state.
6804 } LDKCResult_InitDecodeErrorZ;
6807 * The contents of CResult_OpenChannelDecodeErrorZ
6809 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
6811 * A pointer to the contents in the success state.
6812 * Reading from this pointer when `result_ok` is not set is undefined.
6814 struct LDKOpenChannel *result;
6816 * A pointer to the contents in the error state.
6817 * Reading from this pointer when `result_ok` is set is undefined.
6819 struct LDKDecodeError *err;
6820 } LDKCResult_OpenChannelDecodeErrorZPtr;
6823 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
6824 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
6825 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6827 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
6829 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
6830 * `err` or `result` depending on the state of `result_ok`.
6832 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
6834 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
6837 } LDKCResult_OpenChannelDecodeErrorZ;
6840 * The contents of CResult_RevokeAndACKDecodeErrorZ
6842 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
6844 * A pointer to the contents in the success state.
6845 * Reading from this pointer when `result_ok` is not set is undefined.
6847 struct LDKRevokeAndACK *result;
6849 * A pointer to the contents in the error state.
6850 * Reading from this pointer when `result_ok` is set is undefined.
6852 struct LDKDecodeError *err;
6853 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
6856 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
6857 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
6858 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6860 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
6862 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
6863 * `err` or `result` depending on the state of `result_ok`.
6865 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
6867 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
6870 } LDKCResult_RevokeAndACKDecodeErrorZ;
6873 * The contents of CResult_ShutdownDecodeErrorZ
6875 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
6877 * A pointer to the contents in the success state.
6878 * Reading from this pointer when `result_ok` is not set is undefined.
6880 struct LDKShutdown *result;
6882 * A pointer to the contents in the error state.
6883 * Reading from this pointer when `result_ok` is set is undefined.
6885 struct LDKDecodeError *err;
6886 } LDKCResult_ShutdownDecodeErrorZPtr;
6889 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
6890 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
6891 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6893 typedef struct LDKCResult_ShutdownDecodeErrorZ {
6895 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
6896 * `err` or `result` depending on the state of `result_ok`.
6898 union LDKCResult_ShutdownDecodeErrorZPtr contents;
6900 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
6903 } LDKCResult_ShutdownDecodeErrorZ;
6906 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
6908 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
6910 * A pointer to the contents in the success state.
6911 * Reading from this pointer when `result_ok` is not set is undefined.
6913 struct LDKUpdateFailHTLC *result;
6915 * A pointer to the contents in the error state.
6916 * Reading from this pointer when `result_ok` is set is undefined.
6918 struct LDKDecodeError *err;
6919 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
6922 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
6923 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
6924 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6926 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
6928 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
6929 * `err` or `result` depending on the state of `result_ok`.
6931 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
6933 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
6936 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
6939 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
6941 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
6943 * A pointer to the contents in the success state.
6944 * Reading from this pointer when `result_ok` is not set is undefined.
6946 struct LDKUpdateFailMalformedHTLC *result;
6948 * A pointer to the contents in the error state.
6949 * Reading from this pointer when `result_ok` is set is undefined.
6951 struct LDKDecodeError *err;
6952 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
6955 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
6956 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
6957 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6959 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
6961 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
6962 * `err` or `result` depending on the state of `result_ok`.
6964 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
6966 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
6969 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
6974 * An update_fee message to be sent or received from a peer
6976 typedef struct MUST_USE_STRUCT LDKUpdateFee {
6978 * A pointer to the opaque Rust object.
6979 * Nearly everywhere, inner must be non-null, however in places where
6980 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6982 LDKnativeUpdateFee *inner;
6984 * Indicates that this is the only struct which contains the same pointer.
6985 * Rust functions which take ownership of an object provided via an argument require
6986 * this to be true and invalidate the object pointed to by inner.
6992 * The contents of CResult_UpdateFeeDecodeErrorZ
6994 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
6996 * A pointer to the contents in the success state.
6997 * Reading from this pointer when `result_ok` is not set is undefined.
6999 struct LDKUpdateFee *result;
7001 * A pointer to the contents in the error state.
7002 * Reading from this pointer when `result_ok` is set is undefined.
7004 struct LDKDecodeError *err;
7005 } LDKCResult_UpdateFeeDecodeErrorZPtr;
7008 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
7009 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
7010 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7012 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
7014 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
7015 * `err` or `result` depending on the state of `result_ok`.
7017 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
7019 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
7022 } LDKCResult_UpdateFeeDecodeErrorZ;
7025 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
7027 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
7029 * A pointer to the contents in the success state.
7030 * Reading from this pointer when `result_ok` is not set is undefined.
7032 struct LDKUpdateFulfillHTLC *result;
7034 * A pointer to the contents in the error state.
7035 * Reading from this pointer when `result_ok` is set is undefined.
7037 struct LDKDecodeError *err;
7038 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
7041 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
7042 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
7043 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7045 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
7047 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
7048 * `err` or `result` depending on the state of `result_ok`.
7050 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
7052 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
7055 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
7058 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
7060 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
7062 * A pointer to the contents in the success state.
7063 * Reading from this pointer when `result_ok` is not set is undefined.
7065 struct LDKUpdateAddHTLC *result;
7067 * A pointer to the contents in the error state.
7068 * Reading from this pointer when `result_ok` is set is undefined.
7070 struct LDKDecodeError *err;
7071 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
7074 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
7075 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
7076 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7078 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
7080 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
7081 * `err` or `result` depending on the state of `result_ok`.
7083 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
7085 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
7088 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
7093 * A ping message to be sent or received from a peer
7095 typedef struct MUST_USE_STRUCT LDKPing {
7097 * A pointer to the opaque Rust object.
7098 * Nearly everywhere, inner must be non-null, however in places where
7099 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7101 LDKnativePing *inner;
7103 * Indicates that this is the only struct which contains the same pointer.
7104 * Rust functions which take ownership of an object provided via an argument require
7105 * this to be true and invalidate the object pointed to by inner.
7111 * The contents of CResult_PingDecodeErrorZ
7113 typedef union LDKCResult_PingDecodeErrorZPtr {
7115 * A pointer to the contents in the success state.
7116 * Reading from this pointer when `result_ok` is not set is undefined.
7118 struct LDKPing *result;
7120 * A pointer to the contents in the error state.
7121 * Reading from this pointer when `result_ok` is set is undefined.
7123 struct LDKDecodeError *err;
7124 } LDKCResult_PingDecodeErrorZPtr;
7127 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
7128 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
7129 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7131 typedef struct LDKCResult_PingDecodeErrorZ {
7133 * The contents of this CResult_PingDecodeErrorZ, accessible via either
7134 * `err` or `result` depending on the state of `result_ok`.
7136 union LDKCResult_PingDecodeErrorZPtr contents;
7138 * Whether this CResult_PingDecodeErrorZ represents a success state.
7141 } LDKCResult_PingDecodeErrorZ;
7146 * A pong message to be sent or received from a peer
7148 typedef struct MUST_USE_STRUCT LDKPong {
7150 * A pointer to the opaque Rust object.
7151 * Nearly everywhere, inner must be non-null, however in places where
7152 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7154 LDKnativePong *inner;
7156 * Indicates that this is the only struct which contains the same pointer.
7157 * Rust functions which take ownership of an object provided via an argument require
7158 * this to be true and invalidate the object pointed to by inner.
7164 * The contents of CResult_PongDecodeErrorZ
7166 typedef union LDKCResult_PongDecodeErrorZPtr {
7168 * A pointer to the contents in the success state.
7169 * Reading from this pointer when `result_ok` is not set is undefined.
7171 struct LDKPong *result;
7173 * A pointer to the contents in the error state.
7174 * Reading from this pointer when `result_ok` is set is undefined.
7176 struct LDKDecodeError *err;
7177 } LDKCResult_PongDecodeErrorZPtr;
7180 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
7181 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
7182 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7184 typedef struct LDKCResult_PongDecodeErrorZ {
7186 * The contents of this CResult_PongDecodeErrorZ, accessible via either
7187 * `err` or `result` depending on the state of `result_ok`.
7189 union LDKCResult_PongDecodeErrorZPtr contents;
7191 * Whether this CResult_PongDecodeErrorZ represents a success state.
7194 } LDKCResult_PongDecodeErrorZ;
7197 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
7199 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
7201 * A pointer to the contents in the success state.
7202 * Reading from this pointer when `result_ok` is not set is undefined.
7204 struct LDKUnsignedChannelAnnouncement *result;
7206 * A pointer to the contents in the error state.
7207 * Reading from this pointer when `result_ok` is set is undefined.
7209 struct LDKDecodeError *err;
7210 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
7213 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
7214 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7215 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7217 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
7219 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
7220 * `err` or `result` depending on the state of `result_ok`.
7222 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
7224 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
7227 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
7230 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
7232 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
7234 * A pointer to the contents in the success state.
7235 * Reading from this pointer when `result_ok` is not set is undefined.
7237 struct LDKChannelAnnouncement *result;
7239 * A pointer to the contents in the error state.
7240 * Reading from this pointer when `result_ok` is set is undefined.
7242 struct LDKDecodeError *err;
7243 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
7246 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
7247 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7248 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7250 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
7252 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
7253 * `err` or `result` depending on the state of `result_ok`.
7255 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
7257 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
7260 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
7265 * The unsigned part of a channel_update
7267 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
7269 * A pointer to the opaque Rust object.
7270 * Nearly everywhere, inner must be non-null, however in places where
7271 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7273 LDKnativeUnsignedChannelUpdate *inner;
7275 * Indicates that this is the only struct which contains the same pointer.
7276 * Rust functions which take ownership of an object provided via an argument require
7277 * this to be true and invalidate the object pointed to by inner.
7280 } LDKUnsignedChannelUpdate;
7283 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
7285 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
7287 * A pointer to the contents in the success state.
7288 * Reading from this pointer when `result_ok` is not set is undefined.
7290 struct LDKUnsignedChannelUpdate *result;
7292 * A pointer to the contents in the error state.
7293 * Reading from this pointer when `result_ok` is set is undefined.
7295 struct LDKDecodeError *err;
7296 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
7299 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
7300 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
7301 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7303 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
7305 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
7306 * `err` or `result` depending on the state of `result_ok`.
7308 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
7310 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
7313 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
7316 * The contents of CResult_ChannelUpdateDecodeErrorZ
7318 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
7320 * A pointer to the contents in the success state.
7321 * Reading from this pointer when `result_ok` is not set is undefined.
7323 struct LDKChannelUpdate *result;
7325 * A pointer to the contents in the error state.
7326 * Reading from this pointer when `result_ok` is set is undefined.
7328 struct LDKDecodeError *err;
7329 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
7332 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
7333 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
7334 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7336 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
7338 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
7339 * `err` or `result` depending on the state of `result_ok`.
7341 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
7343 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
7346 } LDKCResult_ChannelUpdateDecodeErrorZ;
7349 * The contents of CResult_ErrorMessageDecodeErrorZ
7351 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
7353 * A pointer to the contents in the success state.
7354 * Reading from this pointer when `result_ok` is not set is undefined.
7356 struct LDKErrorMessage *result;
7358 * A pointer to the contents in the error state.
7359 * Reading from this pointer when `result_ok` is set is undefined.
7361 struct LDKDecodeError *err;
7362 } LDKCResult_ErrorMessageDecodeErrorZPtr;
7365 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
7366 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
7367 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7369 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
7371 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
7372 * `err` or `result` depending on the state of `result_ok`.
7374 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
7376 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
7379 } LDKCResult_ErrorMessageDecodeErrorZ;
7384 * The unsigned part of a node_announcement
7386 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
7388 * A pointer to the opaque Rust object.
7389 * Nearly everywhere, inner must be non-null, however in places where
7390 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7392 LDKnativeUnsignedNodeAnnouncement *inner;
7394 * Indicates that this is the only struct which contains the same pointer.
7395 * Rust functions which take ownership of an object provided via an argument require
7396 * this to be true and invalidate the object pointed to by inner.
7399 } LDKUnsignedNodeAnnouncement;
7402 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
7404 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
7406 * A pointer to the contents in the success state.
7407 * Reading from this pointer when `result_ok` is not set is undefined.
7409 struct LDKUnsignedNodeAnnouncement *result;
7411 * A pointer to the contents in the error state.
7412 * Reading from this pointer when `result_ok` is set is undefined.
7414 struct LDKDecodeError *err;
7415 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
7418 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
7419 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7420 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7422 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
7424 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
7425 * `err` or `result` depending on the state of `result_ok`.
7427 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
7429 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
7432 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
7435 * The contents of CResult_NodeAnnouncementDecodeErrorZ
7437 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
7439 * A pointer to the contents in the success state.
7440 * Reading from this pointer when `result_ok` is not set is undefined.
7442 struct LDKNodeAnnouncement *result;
7444 * A pointer to the contents in the error state.
7445 * Reading from this pointer when `result_ok` is set is undefined.
7447 struct LDKDecodeError *err;
7448 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
7451 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
7452 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7453 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7455 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
7457 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
7458 * `err` or `result` depending on the state of `result_ok`.
7460 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
7462 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
7465 } LDKCResult_NodeAnnouncementDecodeErrorZ;
7468 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
7470 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
7472 * A pointer to the contents in the success state.
7473 * Reading from this pointer when `result_ok` is not set is undefined.
7475 struct LDKQueryShortChannelIds *result;
7477 * A pointer to the contents in the error state.
7478 * Reading from this pointer when `result_ok` is set is undefined.
7480 struct LDKDecodeError *err;
7481 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
7484 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
7485 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
7486 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7488 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
7490 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
7491 * `err` or `result` depending on the state of `result_ok`.
7493 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
7495 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
7498 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
7503 * A reply_short_channel_ids_end message is sent as a reply to a
7504 * query_short_channel_ids message. The query recipient makes a best
7505 * effort to respond based on their local network view which may not be
7506 * a perfect view of the network.
7508 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
7510 * A pointer to the opaque Rust object.
7511 * Nearly everywhere, inner must be non-null, however in places where
7512 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7514 LDKnativeReplyShortChannelIdsEnd *inner;
7516 * Indicates that this is the only struct which contains the same pointer.
7517 * Rust functions which take ownership of an object provided via an argument require
7518 * this to be true and invalidate the object pointed to by inner.
7521 } LDKReplyShortChannelIdsEnd;
7524 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
7526 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
7528 * A pointer to the contents in the success state.
7529 * Reading from this pointer when `result_ok` is not set is undefined.
7531 struct LDKReplyShortChannelIdsEnd *result;
7533 * A pointer to the contents in the error state.
7534 * Reading from this pointer when `result_ok` is set is undefined.
7536 struct LDKDecodeError *err;
7537 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
7540 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
7541 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
7542 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7544 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
7546 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
7547 * `err` or `result` depending on the state of `result_ok`.
7549 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
7551 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
7554 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
7557 * The contents of CResult_QueryChannelRangeDecodeErrorZ
7559 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
7561 * A pointer to the contents in the success state.
7562 * Reading from this pointer when `result_ok` is not set is undefined.
7564 struct LDKQueryChannelRange *result;
7566 * A pointer to the contents in the error state.
7567 * Reading from this pointer when `result_ok` is set is undefined.
7569 struct LDKDecodeError *err;
7570 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
7573 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
7574 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
7575 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7577 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
7579 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
7580 * `err` or `result` depending on the state of `result_ok`.
7582 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
7584 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
7587 } LDKCResult_QueryChannelRangeDecodeErrorZ;
7590 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
7592 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
7594 * A pointer to the contents in the success state.
7595 * Reading from this pointer when `result_ok` is not set is undefined.
7597 struct LDKReplyChannelRange *result;
7599 * A pointer to the contents in the error state.
7600 * Reading from this pointer when `result_ok` is set is undefined.
7602 struct LDKDecodeError *err;
7603 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
7606 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
7607 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
7608 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7610 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
7612 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
7613 * `err` or `result` depending on the state of `result_ok`.
7615 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
7617 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
7620 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
7625 * A gossip_timestamp_filter message is used by a node to request
7626 * gossip relay for messages in the requested time range when the
7627 * gossip_queries feature has been negotiated.
7629 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
7631 * A pointer to the opaque Rust object.
7632 * Nearly everywhere, inner must be non-null, however in places where
7633 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7635 LDKnativeGossipTimestampFilter *inner;
7637 * Indicates that this is the only struct which contains the same pointer.
7638 * Rust functions which take ownership of an object provided via an argument require
7639 * this to be true and invalidate the object pointed to by inner.
7642 } LDKGossipTimestampFilter;
7645 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
7647 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
7649 * A pointer to the contents in the success state.
7650 * Reading from this pointer when `result_ok` is not set is undefined.
7652 struct LDKGossipTimestampFilter *result;
7654 * A pointer to the contents in the error state.
7655 * Reading from this pointer when `result_ok` is set is undefined.
7657 struct LDKDecodeError *err;
7658 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
7661 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
7662 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
7663 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7665 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
7667 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
7668 * `err` or `result` depending on the state of `result_ok`.
7670 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
7672 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
7675 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
7678 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
7681 typedef enum LDKSignOrCreationError_Tag {
7683 * An error occurred during signing
7685 LDKSignOrCreationError_SignError,
7687 * An error occurred while building the transaction
7689 LDKSignOrCreationError_CreationError,
7691 * Must be last for serialization purposes
7693 LDKSignOrCreationError_Sentinel,
7694 } LDKSignOrCreationError_Tag;
7696 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
7697 LDKSignOrCreationError_Tag tag;
7700 enum LDKCreationError creation_error;
7703 } LDKSignOrCreationError;
7706 * The contents of CResult_InvoiceSignOrCreationErrorZ
7708 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
7710 * A pointer to the contents in the success state.
7711 * Reading from this pointer when `result_ok` is not set is undefined.
7713 struct LDKInvoice *result;
7715 * A pointer to the contents in the error state.
7716 * Reading from this pointer when `result_ok` is set is undefined.
7718 struct LDKSignOrCreationError *err;
7719 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
7722 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
7723 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
7724 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7726 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
7728 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
7729 * `err` or `result` depending on the state of `result_ok`.
7731 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
7733 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
7736 } LDKCResult_InvoiceSignOrCreationErrorZ;
7739 * A trait indicating an object may generate message send events
7741 typedef struct LDKMessageSendEventsProvider {
7743 * An opaque pointer which is passed to your function implementations as an argument.
7744 * This has no meaning in the LDK, and can be NULL or any other value.
7748 * Gets the list of pending events which were generated by previous actions, clearing the list
7751 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
7753 * Frees any resources associated with this object given its this_arg pointer.
7754 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7756 void (*free)(void *this_arg);
7757 } LDKMessageSendEventsProvider;
7760 * A trait implemented for objects handling events from [`EventsProvider`].
7762 typedef struct LDKEventHandler {
7764 * An opaque pointer which is passed to your function implementations as an argument.
7765 * This has no meaning in the LDK, and can be NULL or any other value.
7769 * Handles the given [`Event`].
7771 * See [`EventsProvider`] for details that must be considered when implementing this method.
7773 void (*handle_event)(const void *this_arg, struct LDKEvent event);
7775 * Frees any resources associated with this object given its this_arg pointer.
7776 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7778 void (*free)(void *this_arg);
7782 * A trait indicating an object may generate events.
7784 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
7788 * See [`process_pending_events`] for requirements around event processing.
7790 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
7791 * event since the last invocation. The handler must either act upon the event immediately
7792 * or preserve it for later handling.
7794 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
7795 * consult the provider's documentation on the implication of processing events and how a handler
7796 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
7797 * [`ChainMonitor::process_pending_events`]).
7799 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
7802 * [`process_pending_events`]: Self::process_pending_events
7803 * [`handle_event`]: EventHandler::handle_event
7804 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
7805 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
7807 typedef struct LDKEventsProvider {
7809 * An opaque pointer which is passed to your function implementations as an argument.
7810 * This has no meaning in the LDK, and can be NULL or any other value.
7814 * Processes any events generated since the last call using the given event handler.
7816 * Subsequent calls must only process new events. However, handlers must be capable of handling
7817 * duplicate events across process restarts. This may occur if the provider was recovered from
7818 * an old state (i.e., it hadn't been successfully persisted after processing pending events).
7820 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
7822 * Frees any resources associated with this object given its this_arg pointer.
7823 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7825 void (*free)(void *this_arg);
7826 } LDKEventsProvider;
7831 * Configuration we set when applicable.
7833 * Default::default() provides sane defaults.
7835 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
7837 * A pointer to the opaque Rust object.
7838 * Nearly everywhere, inner must be non-null, however in places where
7839 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7841 LDKnativeChannelHandshakeConfig *inner;
7843 * Indicates that this is the only struct which contains the same pointer.
7844 * Rust functions which take ownership of an object provided via an argument require
7845 * this to be true and invalidate the object pointed to by inner.
7848 } LDKChannelHandshakeConfig;
7853 * Optional channel limits which are applied during channel creation.
7855 * These limits are only applied to our counterparty's limits, not our own.
7857 * Use 0/<type>::max_value() as appropriate to skip checking.
7859 * Provides sane defaults for most configurations.
7861 * Most additional limits are disabled except those with which specify a default in individual
7862 * field documentation. Note that this may result in barely-usable channels, but since they
7863 * are applied mostly only to incoming channels that's not much of a problem.
7865 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
7867 * A pointer to the opaque Rust object.
7868 * Nearly everywhere, inner must be non-null, however in places where
7869 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7871 LDKnativeChannelHandshakeLimits *inner;
7873 * Indicates that this is the only struct which contains the same pointer.
7874 * Rust functions which take ownership of an object provided via an argument require
7875 * this to be true and invalidate the object pointed to by inner.
7878 } LDKChannelHandshakeLimits;
7883 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
7885 * Default::default() provides sane defaults for most configurations
7886 * (but currently with 0 relay fees!)
7888 typedef struct MUST_USE_STRUCT LDKUserConfig {
7890 * A pointer to the opaque Rust object.
7891 * Nearly everywhere, inner must be non-null, however in places where
7892 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7894 LDKnativeUserConfig *inner;
7896 * Indicates that this is the only struct which contains the same pointer.
7897 * Rust functions which take ownership of an object provided via an argument require
7898 * this to be true and invalidate the object pointed to by inner.
7904 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
7907 typedef struct LDKAccess {
7909 * An opaque pointer which is passed to your function implementations as an argument.
7910 * This has no meaning in the LDK, and can be NULL or any other value.
7914 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
7915 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
7918 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
7920 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
7922 * Frees any resources associated with this object given its this_arg pointer.
7923 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7925 void (*free)(void *this_arg);
7929 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
7932 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
7933 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
7934 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
7937 typedef struct LDKListen {
7939 * An opaque pointer which is passed to your function implementations as an argument.
7940 * This has no meaning in the LDK, and can be NULL or any other value.
7944 * Notifies the listener that a block was added at the given height.
7946 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
7948 * Notifies the listener that a block was removed at the given height.
7950 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
7952 * Frees any resources associated with this object given its this_arg pointer.
7953 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7955 void (*free)(void *this_arg);
7959 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
7960 * unconfirmed during a chain reorganization.
7962 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
7963 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
7964 * related to registered transactions and outputs. Upon notification, it would pass along the
7965 * matching transactions using this interface.
7969 * The intended use is as follows:
7970 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
7971 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
7972 * that has been reorganized out of the chain.
7973 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
7977 * Clients must call these methods in chain order. Specifically:
7978 * - Transactions confirmed in a block must be given before transactions confirmed in a later
7980 * - Dependent transactions within the same block must be given in topological order, possibly in
7982 * - Unconfirmed transactions must be given after the original confirmations and before any
7985 * See individual method documentation for further details.
7987 * [`transactions_confirmed`]: Self::transactions_confirmed
7988 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
7989 * [`best_block_updated`]: Self::best_block_updated
7990 * [`get_relevant_txids`]: Self::get_relevant_txids
7992 typedef struct LDKConfirm {
7994 * An opaque pointer which is passed to your function implementations as an argument.
7995 * This has no meaning in the LDK, and can be NULL or any other value.
7999 * Processes transactions confirmed in a block with a given header and height.
8001 * Should be called for any transactions registered by [`Filter::register_tx`] or any
8002 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
8003 * appearing in the same block do not need to be included in the same call; instead, multiple
8004 * calls with additional transactions may be made so long as they are made in [chain order].
8006 * May be called before or after [`best_block_updated`] for the corresponding block. However,
8007 * in the event of a chain reorganization, it must not be called with a `header` that is no
8008 * longer in the chain as of the last call to [`best_block_updated`].
8010 * [chain order]: Confirm#Order
8011 * [`best_block_updated`]: Self::best_block_updated
8013 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
8015 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
8017 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
8018 * reorganized out of the best chain. Once called, the given transaction should not be returned
8019 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
8021 * [`get_relevant_txids`]: Self::get_relevant_txids
8022 * [`transactions_confirmed`]: Self::transactions_confirmed
8024 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
8026 * Processes an update to the best header connected at the given height.
8028 * Should be called when a new header is available but may be skipped for intermediary blocks
8029 * if they become available at the same time.
8031 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
8033 * Returns transactions that should be monitored for reorganization out of the chain.
8035 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
8036 * confirmations to be safe from a chain reorganization. Should not include any transactions
8037 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
8039 * May be called to determine the subset of transactions that must still be monitored for
8040 * reorganization. Will be idempotent between calls but may change as a result of calls to the
8041 * other interface methods. Thus, this is useful to determine which transactions may need to be
8042 * given to [`transaction_unconfirmed`].
8044 * [`transactions_confirmed`]: Self::transactions_confirmed
8045 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
8047 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
8049 * Frees any resources associated with this object given its this_arg pointer.
8050 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8052 void (*free)(void *this_arg);
8058 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
8060 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
8061 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
8062 * the return value of [`Filter::register_output`].
8064 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
8065 * may have been spent there. See [`Filter::register_output`] for details.
8067 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
8068 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
8070 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
8072 * A pointer to the opaque Rust object.
8073 * Nearly everywhere, inner must be non-null, however in places where
8074 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8076 LDKnativeWatchedOutput *inner;
8078 * Indicates that this is the only struct which contains the same pointer.
8079 * Rust functions which take ownership of an object provided via an argument require
8080 * this to be true and invalidate the object pointed to by inner.
8086 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
8089 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
8090 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
8091 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
8092 * receiving full blocks from a chain source, any further filtering is unnecessary.
8094 * After an output has been registered, subsequent block retrievals from the chain source must not
8095 * exclude any transactions matching the new criteria nor any in-block descendants of such
8098 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
8099 * should not block on I/O. Implementations should instead queue the newly monitored data to be
8100 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
8101 * invocation that has called the `Filter` must return [`TemporaryFailure`].
8103 * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
8104 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
8105 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
8107 typedef struct LDKFilter {
8109 * An opaque pointer which is passed to your function implementations as an argument.
8110 * This has no meaning in the LDK, and can be NULL or any other value.
8114 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
8115 * a spending condition.
8117 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
8119 * Registers interest in spends of a transaction output.
8121 * Optionally, when `output.block_hash` is set, should return any transaction spending the
8122 * output that is found in the corresponding block along with its index.
8124 * This return value is useful for Electrum clients in order to supply in-block descendant
8125 * transactions which otherwise were not included. This is not necessary for other clients if
8126 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
8129 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
8131 * Frees any resources associated with this object given its this_arg pointer.
8132 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8134 void (*free)(void *this_arg);
8138 * `Persist` defines behavior for persisting channel monitors: this could mean
8139 * writing once to disk, and/or uploading to one or more backup services.
8141 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
8142 * to disk/backups. And, on every update, you **must** persist either the
8143 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
8144 * of situations such as revoking a transaction, then crashing before this
8145 * revocation can be persisted, then unintentionally broadcasting a revoked
8146 * transaction and losing money. This is a risk because previous channel states
8147 * are toxic, so it's important that whatever channel state is persisted is
8150 typedef struct LDKPersist {
8152 * An opaque pointer which is passed to your function implementations as an argument.
8153 * This has no meaning in the LDK, and can be NULL or any other value.
8157 * Persist a new channel's data. The data can be stored any way you want, but
8158 * the identifier provided by Rust-Lightning is the channel's outpoint (and
8159 * it is up to you to maintain a correct mapping between the outpoint and the
8160 * stored channel data). Note that you **must** persist every new monitor to
8161 * disk. See the `Persist` trait documentation for more details.
8163 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
8164 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
8166 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
8168 * Update one channel's data. The provided `ChannelMonitor` has already
8169 * applied the given update.
8171 * Note that on every update, you **must** persist either the
8172 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
8173 * the `Persist` trait documentation for more details.
8175 * If an implementer chooses to persist the updates only, they need to make
8176 * sure that all the updates are applied to the `ChannelMonitors` *before*
8177 * the set of channel monitors is given to the `ChannelManager`
8178 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
8179 * applying a monitor update to a monitor. If full `ChannelMonitors` are
8180 * persisted, then there is no need to persist individual updates.
8182 * Note that there could be a performance tradeoff between persisting complete
8183 * channel monitors on every update vs. persisting only updates and applying
8184 * them in batches. The size of each monitor grows `O(number of state updates)`
8185 * whereas updates are small and `O(1)`.
8187 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
8188 * [`ChannelMonitorUpdate::write`] for writing out an update, and
8189 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
8191 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);
8193 * Frees any resources associated with this object given its this_arg pointer.
8194 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8196 void (*free)(void *this_arg);
8202 * An implementation of [`chain::Watch`] for monitoring channels.
8204 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
8205 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
8206 * or used independently to monitor channels remotely. See the [module-level documentation] for
8209 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
8210 * [module-level documentation]: crate::chain::chainmonitor
8212 typedef struct MUST_USE_STRUCT LDKChainMonitor {
8214 * A pointer to the opaque Rust object.
8215 * Nearly everywhere, inner must be non-null, however in places where
8216 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8218 LDKnativeChainMonitor *inner;
8220 * Indicates that this is the only struct which contains the same pointer.
8221 * Rust functions which take ownership of an object provided via an argument require
8222 * this to be true and invalidate the object pointed to by inner.
8230 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
8231 * and derives keys from that.
8233 * Your node_id is seed/0'
8234 * ChannelMonitor closes may use seed/1'
8235 * Cooperative closes may use seed/2'
8236 * The two close keys may be needed to claim on-chain funds!
8238 typedef struct MUST_USE_STRUCT LDKKeysManager {
8240 * A pointer to the opaque Rust object.
8241 * Nearly everywhere, inner must be non-null, however in places where
8242 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8244 LDKnativeKeysManager *inner;
8246 * Indicates that this is the only struct which contains the same pointer.
8247 * Rust functions which take ownership of an object provided via an argument require
8248 * this to be true and invalidate the object pointed to by inner.
8256 * Chain-related parameters used to construct a new `ChannelManager`.
8258 * Typically, the block-specific parameters are derived from the best block hash for the network,
8259 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
8260 * are not needed when deserializing a previously constructed `ChannelManager`.
8262 typedef struct MUST_USE_STRUCT LDKChainParameters {
8264 * A pointer to the opaque Rust object.
8265 * Nearly everywhere, inner must be non-null, however in places where
8266 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8268 LDKnativeChainParameters *inner;
8270 * Indicates that this is the only struct which contains the same pointer.
8271 * Rust functions which take ownership of an object provided via an argument require
8272 * this to be true and invalidate the object pointed to by inner.
8275 } LDKChainParameters;
8280 * The best known block as identified by its hash and height.
8282 typedef struct MUST_USE_STRUCT LDKBestBlock {
8284 * A pointer to the opaque Rust object.
8285 * Nearly everywhere, inner must be non-null, however in places where
8286 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8288 LDKnativeBestBlock *inner;
8290 * Indicates that this is the only struct which contains the same pointer.
8291 * Rust functions which take ownership of an object provided via an argument require
8292 * this to be true and invalidate the object pointed to by inner.
8298 * A 3-byte byte array.
8300 typedef struct LDKThreeBytes {
8308 * A trait to describe an object which can receive channel messages.
8310 * Messages MAY be called in parallel when they originate from different their_node_ids, however
8311 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
8313 typedef struct LDKChannelMessageHandler {
8315 * An opaque pointer which is passed to your function implementations as an argument.
8316 * This has no meaning in the LDK, and can be NULL or any other value.
8320 * Handle an incoming open_channel message from the given peer.
8322 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
8324 * Handle an incoming accept_channel message from the given peer.
8326 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
8328 * Handle an incoming funding_created message from the given peer.
8330 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
8332 * Handle an incoming funding_signed message from the given peer.
8334 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
8336 * Handle an incoming funding_locked message from the given peer.
8338 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
8340 * Handle an incoming shutdown message from the given peer.
8342 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);
8344 * Handle an incoming closing_signed message from the given peer.
8346 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
8348 * Handle an incoming update_add_htlc message from the given peer.
8350 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
8352 * Handle an incoming update_fulfill_htlc message from the given peer.
8354 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
8356 * Handle an incoming update_fail_htlc message from the given peer.
8358 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
8360 * Handle an incoming update_fail_malformed_htlc message from the given peer.
8362 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
8364 * Handle an incoming commitment_signed message from the given peer.
8366 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
8368 * Handle an incoming revoke_and_ack message from the given peer.
8370 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
8372 * Handle an incoming update_fee message from the given peer.
8374 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
8376 * Handle an incoming announcement_signatures message from the given peer.
8378 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
8380 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
8381 * is believed to be possible in the future (eg they're sending us messages we don't
8382 * understand or indicate they require unknown feature bits), no_connection_possible is set
8383 * and any outstanding channels should be failed.
8385 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
8387 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
8389 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
8391 * Handle an incoming channel_reestablish message from the given peer.
8393 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
8395 * Handle an incoming channel update from the given peer.
8397 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
8399 * Handle an incoming error message from the given peer.
8401 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
8403 * Implementation of MessageSendEventsProvider for this object.
8405 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8407 * Frees any resources associated with this object given its this_arg pointer.
8408 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8410 void (*free)(void *this_arg);
8411 } LDKChannelMessageHandler;
8416 * Arguments for the creation of a ChannelManager that are not deserialized.
8418 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
8420 * 1) Deserialize all stored ChannelMonitors.
8421 * 2) Deserialize the ChannelManager by filling in this struct and calling:
8422 * <(BlockHash, ChannelManager)>::read(reader, args)
8423 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
8424 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
8425 * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
8426 * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
8427 * ChannelMonitor::get_funding_txo().
8428 * 4) Reconnect blocks on your ChannelMonitors.
8429 * 5) Disconnect/connect blocks on the ChannelManager.
8430 * 6) Move the ChannelMonitors into your local chain::Watch.
8432 * Note that the ordering of #4-6 is not of importance, however all three must occur before you
8433 * call any other methods on the newly-deserialized ChannelManager.
8435 * Note that because some channels may be closed during deserialization, it is critical that you
8436 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
8437 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
8438 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
8439 * not force-close the same channels but consider them live), you may end up revoking a state for
8440 * which you've already broadcasted the transaction.
8442 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
8444 * A pointer to the opaque Rust object.
8445 * Nearly everywhere, inner must be non-null, however in places where
8446 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8448 LDKnativeChannelManagerReadArgs *inner;
8450 * Indicates that this is the only struct which contains the same pointer.
8451 * Rust functions which take ownership of an object provided via an argument require
8452 * this to be true and invalidate the object pointed to by inner.
8455 } LDKChannelManagerReadArgs;
8460 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
8461 * This is used to convince the recipient that the channel is at a certain commitment
8462 * number even if they lost that data due to a local failure. Of course, the peer may lie
8463 * and even later commitments may have been revoked.
8465 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
8467 * A pointer to the opaque Rust object.
8468 * Nearly everywhere, inner must be non-null, however in places where
8469 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8471 LDKnativeDataLossProtect *inner;
8473 * Indicates that this is the only struct which contains the same pointer.
8474 * Rust functions which take ownership of an object provided via an argument require
8475 * this to be true and invalidate the object pointed to by inner.
8478 } LDKDataLossProtect;
8481 * A trait to describe an object which can receive routing messages.
8483 * # Implementor DoS Warnings
8485 * For `gossip_queries` messages there are potential DoS vectors when handling
8486 * inbound queries. Implementors using an on-disk network graph should be aware of
8487 * repeated disk I/O for queries accessing different parts of the network graph.
8489 typedef struct LDKRoutingMessageHandler {
8491 * An opaque pointer which is passed to your function implementations as an argument.
8492 * This has no meaning in the LDK, and can be NULL or any other value.
8496 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
8497 * false or returning an Err otherwise.
8499 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
8501 * Handle a channel_announcement message, returning true if it should be forwarded on, false
8502 * or returning an Err otherwise.
8504 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
8506 * Handle an incoming channel_update message, returning true if it should be forwarded on,
8507 * false or returning an Err otherwise.
8509 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
8511 * Handle some updates to the route graph that we learned due to an outbound failed payment.
8513 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
8515 * Gets a subset of the channel announcements and updates required to dump our routing table
8516 * to a remote node, starting at the short_channel_id indicated by starting_point and
8517 * including the batch_amount entries immediately higher in numerical value than starting_point.
8519 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
8521 * Gets a subset of the node announcements required to dump our routing table to a remote node,
8522 * starting at the node *after* the provided publickey and including batch_amount entries
8523 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
8524 * If None is provided for starting_point, we start at the first node.
8526 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
8528 * Called when a connection is established with a peer. This can be used to
8529 * perform routing table synchronization using a strategy defined by the
8532 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
8534 * Handles the reply of a query we initiated to learn about channels
8535 * for a given range of blocks. We can expect to receive one or more
8536 * replies to a single query.
8538 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
8540 * Handles the reply of a query we initiated asking for routing gossip
8541 * messages for a list of channels. We should receive this message when
8542 * a node has completed its best effort to send us the pertaining routing
8545 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
8547 * Handles when a peer asks us to send a list of short_channel_ids
8548 * for the requested range of blocks.
8550 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
8552 * Handles when a peer asks us to send routing gossip messages for a
8553 * list of short_channel_ids.
8555 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
8557 * Implementation of MessageSendEventsProvider for this object.
8559 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8561 * Frees any resources associated with this object given its this_arg pointer.
8562 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8564 void (*free)(void *this_arg);
8565 } LDKRoutingMessageHandler;
8570 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
8571 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
8573 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
8575 * A pointer to the opaque Rust object.
8576 * Nearly everywhere, inner must be non-null, however in places where
8577 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8579 LDKnativeIgnoringMessageHandler *inner;
8581 * Indicates that this is the only struct which contains the same pointer.
8582 * Rust functions which take ownership of an object provided via an argument require
8583 * this to be true and invalidate the object pointed to by inner.
8586 } LDKIgnoringMessageHandler;
8591 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
8592 * You can provide one of these as the route_handler in a MessageHandler.
8594 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
8596 * A pointer to the opaque Rust object.
8597 * Nearly everywhere, inner must be non-null, however in places where
8598 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8600 LDKnativeErroringMessageHandler *inner;
8602 * Indicates that this is the only struct which contains the same pointer.
8603 * Rust functions which take ownership of an object provided via an argument require
8604 * this to be true and invalidate the object pointed to by inner.
8607 } LDKErroringMessageHandler;
8612 * Provides references to trait impls which handle different types of messages.
8614 typedef struct MUST_USE_STRUCT LDKMessageHandler {
8616 * A pointer to the opaque Rust object.
8617 * Nearly everywhere, inner must be non-null, however in places where
8618 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8620 LDKnativeMessageHandler *inner;
8622 * Indicates that this is the only struct which contains the same pointer.
8623 * Rust functions which take ownership of an object provided via an argument require
8624 * this to be true and invalidate the object pointed to by inner.
8627 } LDKMessageHandler;
8630 * Provides an object which can be used to send data to and which uniquely identifies a connection
8631 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
8632 * implement Hash to meet the PeerManager API.
8634 * For efficiency, Clone should be relatively cheap for this type.
8636 * You probably want to just extend an int and put a file descriptor in a struct and implement
8637 * send_data. Note that if you are using a higher-level net library that may call close() itself,
8638 * be careful to ensure you don't have races whereby you might register a new connection with an
8639 * fd which is the same as a previous one which has yet to be removed via
8640 * PeerManager::socket_disconnected().
8642 typedef struct LDKSocketDescriptor {
8644 * An opaque pointer which is passed to your function implementations as an argument.
8645 * This has no meaning in the LDK, and can be NULL or any other value.
8649 * Attempts to send some data from the given slice to the peer.
8651 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
8652 * Note that in the disconnected case, socket_disconnected must still fire and further write
8653 * attempts may occur until that time.
8655 * If the returned size is smaller than data.len(), a write_available event must
8656 * trigger the next time more data can be written. Additionally, until the a send_data event
8657 * completes fully, no further read_events should trigger on the same peer!
8659 * If a read_event on this descriptor had previously returned true (indicating that read
8660 * events should be paused to prevent DoS in the send buffer), resume_read may be set
8661 * indicating that read events on this descriptor should resume. A resume_read of false does
8662 * *not* imply that further read events should be paused.
8664 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
8666 * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no
8667 * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with
8668 * this descriptor. No socket_disconnected call should be generated as a result of this call,
8669 * though races may occur whereby disconnect_socket is called after a call to
8670 * socket_disconnected but prior to socket_disconnected returning.
8672 void (*disconnect_socket)(void *this_arg);
8674 * Checks if two objects are equal given this object's this_arg pointer and another object.
8676 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
8678 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
8679 * This is used, for example, for inclusion of this object in a hash map.
8681 uint64_t (*hash)(const void *this_arg);
8683 * Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
8684 * Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
8685 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
8687 void *(*clone)(const void *this_arg);
8689 * Frees any resources associated with this object given its this_arg pointer.
8690 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8692 void (*free)(void *this_arg);
8693 } LDKSocketDescriptor;
8698 * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket
8699 * events into messages which it passes on to its MessageHandlers.
8701 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
8702 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
8703 * essentially you should default to using a SimpleRefPeerManager, and use a
8704 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
8705 * you're using lightning-net-tokio.
8707 typedef struct MUST_USE_STRUCT LDKPeerManager {
8709 * A pointer to the opaque Rust object.
8710 * Nearly everywhere, inner must be non-null, however in places where
8711 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8713 LDKnativePeerManager *inner;
8715 * Indicates that this is the only struct which contains the same pointer.
8716 * Rust functions which take ownership of an object provided via an argument require
8717 * this to be true and invalidate the object pointed to by inner.
8725 * Static channel fields used to build transactions given per-commitment fields, organized by
8726 * broadcaster/countersignatory.
8728 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
8729 * as_holder_broadcastable and as_counterparty_broadcastable functions.
8731 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
8733 * A pointer to the opaque Rust object.
8734 * Nearly everywhere, inner must be non-null, however in places where
8735 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8737 LDKnativeDirectedChannelTransactionParameters *inner;
8739 * Indicates that this is the only struct which contains the same pointer.
8740 * Rust functions which take ownership of an object provided via an argument require
8741 * this to be true and invalidate the object pointed to by inner.
8744 } LDKDirectedChannelTransactionParameters;
8749 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
8750 * This exists only to make accessing a RwLock<NetworkGraph> possible from
8751 * the C bindings, as it can be done directly in Rust code.
8753 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
8755 * A pointer to the opaque Rust object.
8756 * Nearly everywhere, inner must be non-null, however in places where
8757 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8759 LDKnativeLockedNetworkGraph *inner;
8761 * Indicates that this is the only struct which contains the same pointer.
8762 * Rust functions which take ownership of an object provided via an argument require
8763 * this to be true and invalidate the object pointed to by inner.
8766 } LDKLockedNetworkGraph;
8771 * Receives and validates network updates from peers,
8772 * stores authentic and relevant data as a network graph.
8773 * This network graph is then used for routing payments.
8774 * Provides interface to help with initial routing sync by
8775 * serving historical announcements.
8777 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
8779 * A pointer to the opaque Rust object.
8780 * Nearly everywhere, inner must be non-null, however in places where
8781 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8783 LDKnativeNetGraphMsgHandler *inner;
8785 * Indicates that this is the only struct which contains the same pointer.
8786 * Rust functions which take ownership of an object provided via an argument require
8787 * this to be true and invalidate the object pointed to by inner.
8790 } LDKNetGraphMsgHandler;
8795 * FilesystemPersister persists channel data on disk, where each channel's
8796 * data is stored in a file named after its funding outpoint.
8798 * Warning: this module does the best it can with calls to persist data, but it
8799 * can only guarantee that the data is passed to the drive. It is up to the
8800 * drive manufacturers to do the actual persistence properly, which they often
8801 * don't (especially on consumer-grade hardware). Therefore, it is up to the
8802 * user to validate their entire storage stack, to ensure the writes are
8804 * Corollary: especially when dealing with larger amounts of money, it is best
8805 * practice to have multiple channel data backups and not rely only on one
8806 * FilesystemPersister.
8808 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
8810 * A pointer to the opaque Rust object.
8811 * Nearly everywhere, inner must be non-null, however in places where
8812 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8814 LDKnativeFilesystemPersister *inner;
8816 * Indicates that this is the only struct which contains the same pointer.
8817 * Rust functions which take ownership of an object provided via an argument require
8818 * this to be true and invalidate the object pointed to by inner.
8821 } LDKFilesystemPersister;
8826 * BackgroundProcessor takes care of tasks that (1) need to happen periodically to keep
8827 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
8828 * responsibilities are:
8829 * * Monitoring whether the ChannelManager needs to be re-persisted to disk, and if so,
8830 * writing it to disk/backups by invoking the callback given to it at startup.
8831 * ChannelManager persistence should be done in the background.
8832 * * Calling `ChannelManager::timer_tick_occurred()` and
8833 * `PeerManager::timer_tick_occurred()` every minute (can be done in the
8836 * Note that if ChannelManager persistence fails and the persisted manager becomes out-of-date,
8837 * then there is a risk of channels force-closing on startup when the manager realizes it's
8838 * outdated. However, as long as `ChannelMonitor` backups are sound, no funds besides those used
8839 * for unilateral chain closure fees are at risk.
8841 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
8843 * A pointer to the opaque Rust object.
8844 * Nearly everywhere, inner must be non-null, however in places where
8845 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8847 LDKnativeBackgroundProcessor *inner;
8849 * Indicates that this is the only struct which contains the same pointer.
8850 * Rust functions which take ownership of an object provided via an argument require
8851 * this to be true and invalidate the object pointed to by inner.
8854 } LDKBackgroundProcessor;
8857 * Trait which handles persisting a [`ChannelManager`] to disk.
8859 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
8861 typedef struct LDKChannelManagerPersister {
8863 * An opaque pointer which is passed to your function implementations as an argument.
8864 * This has no meaning in the LDK, and can be NULL or any other value.
8868 * Persist the given [`ChannelManager`] to disk, returning an error if persistence failed
8869 * (which will cause the [`BackgroundProcessor`] which called this method to exit.
8871 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
8873 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
8875 * Frees any resources associated with this object given its this_arg pointer.
8876 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8878 void (*free)(void *this_arg);
8879 } LDKChannelManagerPersister;
8884 * Data of the `RawInvoice` that is encoded in the data part
8886 typedef struct MUST_USE_STRUCT LDKRawDataPart {
8888 * A pointer to the opaque Rust object.
8889 * Nearly everywhere, inner must be non-null, however in places where
8890 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8892 LDKnativeRawDataPart *inner;
8894 * Indicates that this is the only struct which contains the same pointer.
8895 * Rust functions which take ownership of an object provided via an argument require
8896 * this to be true and invalidate the object pointed to by inner.
8906 typedef struct MUST_USE_STRUCT LDKSha256 {
8908 * A pointer to the opaque Rust object.
8909 * Nearly everywhere, inner must be non-null, however in places where
8910 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8912 LDKnativeSha256 *inner;
8914 * Indicates that this is the only struct which contains the same pointer.
8915 * Rust functions which take ownership of an object provided via an argument require
8916 * this to be true and invalidate the object pointed to by inner.
8924 * `min_final_cltv_expiry` to use for the last HTLC in the route
8926 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
8928 * A pointer to the opaque Rust object.
8929 * Nearly everywhere, inner must be non-null, however in places where
8930 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8932 LDKnativeMinFinalCltvExpiry *inner;
8934 * Indicates that this is the only struct which contains the same pointer.
8935 * Rust functions which take ownership of an object provided via an argument require
8936 * this to be true and invalidate the object pointed to by inner.
8939 } LDKMinFinalCltvExpiry;
8942 * Integer in the range `0..32`
8944 typedef struct LDKu5 {
8949 * A 20-byte byte array.
8951 typedef struct LDKTwentyBytes {
8959 * Fallback address in case no LN payment is possible
8961 typedef enum LDKFallback_Tag {
8962 LDKFallback_SegWitProgram,
8963 LDKFallback_PubKeyHash,
8964 LDKFallback_ScriptHash,
8966 * Must be last for serialization purposes
8968 LDKFallback_Sentinel,
8971 typedef struct LDKFallback_LDKSegWitProgram_Body {
8972 struct LDKu5 version;
8973 struct LDKCVec_u8Z program;
8974 } LDKFallback_LDKSegWitProgram_Body;
8976 typedef struct MUST_USE_STRUCT LDKFallback {
8977 LDKFallback_Tag tag;
8979 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
8981 struct LDKTwentyBytes pub_key_hash;
8984 struct LDKTwentyBytes script_hash;
8989 extern const uintptr_t MAX_BUF_SIZE;
8991 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
8993 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
8995 extern const uint32_t ANTI_REORG_DELAY;
8997 extern const uint16_t BREAKDOWN_TIMEOUT;
8999 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
9001 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
9003 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
9005 extern const uint8_t TAG_PAYMENT_HASH;
9007 extern const uint8_t TAG_DESCRIPTION;
9009 extern const uint8_t TAG_PAYEE_PUB_KEY;
9011 extern const uint8_t TAG_DESCRIPTION_HASH;
9013 extern const uint8_t TAG_EXPIRY_TIME;
9015 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
9017 extern const uint8_t TAG_FALLBACK;
9019 extern const uint8_t TAG_ROUTE;
9021 extern const uint8_t TAG_PAYMENT_SECRET;
9023 extern const uint8_t TAG_FEATURES;
9025 struct LDKStr _ldk_get_compiled_version(void);
9027 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
9030 * Frees the data buffer, if data_is_owned is set and datalen > 0.
9032 void Transaction_free(struct LDKTransaction _res);
9035 * Frees the data pointed to by script_pubkey.
9037 void TxOut_free(struct LDKTxOut _res);
9040 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
9042 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
9045 * Frees the data buffer, if chars_is_owned is set and len > 0.
9047 void Str_free(struct LDKStr _res);
9050 * Creates a new CResult_SecretKeyErrorZ in the success state.
9052 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
9055 * Creates a new CResult_SecretKeyErrorZ in the error state.
9057 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
9060 * Frees any resources used by the CResult_SecretKeyErrorZ.
9062 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
9065 * Creates a new CResult_PublicKeyErrorZ in the success state.
9067 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
9070 * Creates a new CResult_PublicKeyErrorZ in the error state.
9072 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
9075 * Frees any resources used by the CResult_PublicKeyErrorZ.
9077 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
9080 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
9081 * but with all dynamically-allocated buffers duplicated in new buffers.
9083 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
9086 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
9088 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
9091 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
9093 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
9096 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
9098 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
9101 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
9102 * but with all dynamically-allocated buffers duplicated in new buffers.
9104 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
9107 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
9109 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
9112 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
9114 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
9117 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
9119 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
9122 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
9123 * but with all dynamically-allocated buffers duplicated in new buffers.
9125 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
9128 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
9130 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
9133 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
9135 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
9138 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
9140 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
9143 * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig`
9144 * but with all dynamically-allocated buffers duplicated in new buffers.
9146 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig);
9149 * Constructs a new COption_u32Z containing a u32
9151 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
9154 * Constructs a new COption_u32Z containing nothing
9156 struct LDKCOption_u32Z COption_u32Z_none(void);
9159 * Frees any resources associated with the u32, if we are in the Some state
9161 void COption_u32Z_free(struct LDKCOption_u32Z _res);
9164 * Creates a new COption_u32Z which has the same data as `orig`
9165 * but with all dynamically-allocated buffers duplicated in new buffers.
9167 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
9170 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
9172 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
9175 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
9177 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
9180 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
9182 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
9185 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
9186 * but with all dynamically-allocated buffers duplicated in new buffers.
9188 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
9191 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
9193 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
9196 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
9198 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
9201 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
9203 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
9206 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
9207 * but with all dynamically-allocated buffers duplicated in new buffers.
9209 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
9212 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
9214 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
9217 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
9219 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
9222 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
9224 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
9227 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
9228 * but with all dynamically-allocated buffers duplicated in new buffers.
9230 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
9233 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9235 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
9238 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
9240 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
9243 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
9245 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9248 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
9250 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
9253 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
9254 * but with all dynamically-allocated buffers duplicated in new buffers.
9256 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9259 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
9261 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
9264 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
9266 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9269 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
9271 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
9274 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
9275 * but with all dynamically-allocated buffers duplicated in new buffers.
9277 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9280 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
9282 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
9285 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
9287 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9290 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
9292 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
9295 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
9296 * but with all dynamically-allocated buffers duplicated in new buffers.
9298 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9301 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
9303 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
9306 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
9308 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
9311 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
9313 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
9316 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
9318 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
9321 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
9323 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
9326 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
9328 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
9331 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
9332 * but with all dynamically-allocated buffers duplicated in new buffers.
9334 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
9337 * Creates a new CResult_NoneErrorZ in the success state.
9339 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
9342 * Creates a new CResult_NoneErrorZ in the error state.
9344 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
9347 * Frees any resources used by the CResult_NoneErrorZ.
9349 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
9352 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
9353 * but with all dynamically-allocated buffers duplicated in new buffers.
9355 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
9358 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
9360 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
9363 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
9365 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
9368 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
9370 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
9373 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
9374 * but with all dynamically-allocated buffers duplicated in new buffers.
9376 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
9379 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9381 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
9384 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9386 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
9389 * Creates a new CResult_RouteDecodeErrorZ in the success state.
9391 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
9394 * Creates a new CResult_RouteDecodeErrorZ in the error state.
9396 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
9399 * Frees any resources used by the CResult_RouteDecodeErrorZ.
9401 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
9404 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
9405 * but with all dynamically-allocated buffers duplicated in new buffers.
9407 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
9410 * Constructs a new COption_u64Z containing a u64
9412 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
9415 * Constructs a new COption_u64Z containing nothing
9417 struct LDKCOption_u64Z COption_u64Z_none(void);
9420 * Frees any resources associated with the u64, if we are in the Some state
9422 void COption_u64Z_free(struct LDKCOption_u64Z _res);
9425 * Creates a new COption_u64Z which has the same data as `orig`
9426 * but with all dynamically-allocated buffers duplicated in new buffers.
9428 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
9431 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9433 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
9436 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9438 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
9441 * Creates a new CResult_RouteLightningErrorZ in the success state.
9443 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
9446 * Creates a new CResult_RouteLightningErrorZ in the error state.
9448 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
9451 * Frees any resources used by the CResult_RouteLightningErrorZ.
9453 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
9456 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
9457 * but with all dynamically-allocated buffers duplicated in new buffers.
9459 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
9462 * Creates a new CResult_TxOutAccessErrorZ in the success state.
9464 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
9467 * Creates a new CResult_TxOutAccessErrorZ in the error state.
9469 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
9472 * Frees any resources used by the CResult_TxOutAccessErrorZ.
9474 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
9477 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
9478 * but with all dynamically-allocated buffers duplicated in new buffers.
9480 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
9483 * Creates a new tuple which has the same data as `orig`
9484 * but with all dynamically-allocated buffers duplicated in new buffers.
9486 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
9489 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
9491 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
9494 * Frees any resources used by the C2Tuple_usizeTransactionZ.
9496 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
9499 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9501 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
9504 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9506 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
9509 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
9511 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
9514 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
9516 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
9519 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
9521 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
9524 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
9525 * but with all dynamically-allocated buffers duplicated in new buffers.
9527 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
9530 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9532 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
9535 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
9537 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
9540 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
9542 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
9545 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
9547 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
9550 * Creates a new COption_C2Tuple_usizeTransactionZZ which has the same data as `orig`
9551 * but with all dynamically-allocated buffers duplicated in new buffers.
9553 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig);
9556 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9558 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
9561 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9563 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
9566 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
9568 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
9571 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
9573 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9576 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
9578 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
9581 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
9583 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
9586 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
9588 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9591 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
9593 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
9596 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
9598 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
9601 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
9603 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9606 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
9608 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
9611 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
9613 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
9616 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
9618 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9621 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
9623 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
9626 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
9628 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
9631 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
9633 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
9636 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
9638 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
9641 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
9642 * but with all dynamically-allocated buffers duplicated in new buffers.
9644 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
9647 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
9649 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
9652 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
9654 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
9657 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
9659 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
9662 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
9663 * but with all dynamically-allocated buffers duplicated in new buffers.
9665 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
9668 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
9670 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
9673 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
9675 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
9678 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
9680 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
9683 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
9684 * but with all dynamically-allocated buffers duplicated in new buffers.
9686 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
9689 * Creates a new tuple which has the same data as `orig`
9690 * but with all dynamically-allocated buffers duplicated in new buffers.
9692 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
9695 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
9697 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
9700 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
9702 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
9705 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
9707 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
9710 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
9712 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
9715 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
9717 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
9720 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
9721 * but with all dynamically-allocated buffers duplicated in new buffers.
9723 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
9726 * Creates a new CResult_SignatureNoneZ in the success state.
9728 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
9731 * Creates a new CResult_SignatureNoneZ in the error state.
9733 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
9736 * Frees any resources used by the CResult_SignatureNoneZ.
9738 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
9741 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
9742 * but with all dynamically-allocated buffers duplicated in new buffers.
9744 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
9747 * Creates a new CResult_SignDecodeErrorZ in the success state.
9749 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
9752 * Creates a new CResult_SignDecodeErrorZ in the error state.
9754 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
9757 * Frees any resources used by the CResult_SignDecodeErrorZ.
9759 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
9762 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
9763 * but with all dynamically-allocated buffers duplicated in new buffers.
9765 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
9768 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9770 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
9773 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
9775 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
9778 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
9780 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
9783 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
9785 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
9788 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
9789 * but with all dynamically-allocated buffers duplicated in new buffers.
9791 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
9794 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9796 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
9799 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
9801 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
9804 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
9806 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
9809 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
9811 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
9814 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
9815 * but with all dynamically-allocated buffers duplicated in new buffers.
9817 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
9820 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
9822 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
9825 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
9827 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
9830 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
9832 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
9835 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
9836 * but with all dynamically-allocated buffers duplicated in new buffers.
9838 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
9841 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9843 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
9846 * Creates a new CResult_TransactionNoneZ in the success state.
9848 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
9851 * Creates a new CResult_TransactionNoneZ in the error state.
9853 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
9856 * Frees any resources used by the CResult_TransactionNoneZ.
9858 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
9861 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
9862 * but with all dynamically-allocated buffers duplicated in new buffers.
9864 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
9867 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
9869 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
9872 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
9874 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
9877 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9879 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
9882 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
9884 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
9887 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
9889 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
9892 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
9894 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
9897 * Creates a new CResult_NoneAPIErrorZ in the success state.
9899 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
9902 * Creates a new CResult_NoneAPIErrorZ in the error state.
9904 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
9907 * Frees any resources used by the CResult_NoneAPIErrorZ.
9909 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
9912 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
9913 * but with all dynamically-allocated buffers duplicated in new buffers.
9915 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
9918 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9920 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
9923 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9925 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
9928 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
9930 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
9933 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
9935 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
9938 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
9940 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
9943 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
9944 * but with all dynamically-allocated buffers duplicated in new buffers.
9946 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
9949 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9951 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
9954 * Creates a new tuple which has the same data as `orig`
9955 * but with all dynamically-allocated buffers duplicated in new buffers.
9957 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
9960 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
9962 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
9965 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
9967 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
9970 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
9972 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
9975 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
9977 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
9980 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
9982 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
9985 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
9986 * but with all dynamically-allocated buffers duplicated in new buffers.
9988 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
9991 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9993 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
9996 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
9998 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
10001 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
10003 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
10006 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
10008 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
10011 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
10013 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
10016 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
10018 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
10021 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
10023 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
10026 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
10028 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
10031 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
10033 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
10036 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
10037 * but with all dynamically-allocated buffers duplicated in new buffers.
10039 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
10042 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
10044 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
10047 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
10049 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
10052 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
10054 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
10057 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
10058 * but with all dynamically-allocated buffers duplicated in new buffers.
10060 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
10063 * Creates a new CResult_SiPrefixNoneZ in the success state.
10065 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_ok(enum LDKSiPrefix o);
10068 * Creates a new CResult_SiPrefixNoneZ in the error state.
10070 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_err(void);
10073 * Frees any resources used by the CResult_SiPrefixNoneZ.
10075 void CResult_SiPrefixNoneZ_free(struct LDKCResult_SiPrefixNoneZ _res);
10078 * Creates a new CResult_SiPrefixNoneZ which has the same data as `orig`
10079 * but with all dynamically-allocated buffers duplicated in new buffers.
10081 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_clone(const struct LDKCResult_SiPrefixNoneZ *NONNULL_PTR orig);
10084 * Creates a new CResult_InvoiceNoneZ in the success state.
10086 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_ok(struct LDKInvoice o);
10089 * Creates a new CResult_InvoiceNoneZ in the error state.
10091 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_err(void);
10094 * Frees any resources used by the CResult_InvoiceNoneZ.
10096 void CResult_InvoiceNoneZ_free(struct LDKCResult_InvoiceNoneZ _res);
10099 * Creates a new CResult_InvoiceNoneZ which has the same data as `orig`
10100 * but with all dynamically-allocated buffers duplicated in new buffers.
10102 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_clone(const struct LDKCResult_InvoiceNoneZ *NONNULL_PTR orig);
10105 * Creates a new CResult_SignedRawInvoiceNoneZ in the success state.
10107 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_ok(struct LDKSignedRawInvoice o);
10110 * Creates a new CResult_SignedRawInvoiceNoneZ in the error state.
10112 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_err(void);
10115 * Frees any resources used by the CResult_SignedRawInvoiceNoneZ.
10117 void CResult_SignedRawInvoiceNoneZ_free(struct LDKCResult_SignedRawInvoiceNoneZ _res);
10120 * Creates a new CResult_SignedRawInvoiceNoneZ which has the same data as `orig`
10121 * but with all dynamically-allocated buffers duplicated in new buffers.
10123 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_clone(const struct LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR orig);
10126 * Creates a new tuple which has the same data as `orig`
10127 * but with all dynamically-allocated buffers duplicated in new buffers.
10129 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
10132 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
10134 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
10137 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
10139 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
10142 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
10144 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
10147 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
10149 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
10152 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
10154 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
10157 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
10158 * but with all dynamically-allocated buffers duplicated in new buffers.
10160 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
10163 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10165 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
10168 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
10170 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
10173 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
10175 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
10178 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
10180 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
10183 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
10184 * but with all dynamically-allocated buffers duplicated in new buffers.
10186 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
10189 * Creates a new CResult_NoneSemanticErrorZ in the success state.
10191 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
10194 * Creates a new CResult_NoneSemanticErrorZ in the error state.
10196 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
10199 * Frees any resources used by the CResult_NoneSemanticErrorZ.
10201 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
10204 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
10205 * but with all dynamically-allocated buffers duplicated in new buffers.
10207 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
10210 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
10212 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
10215 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
10217 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
10220 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
10222 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
10225 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
10226 * but with all dynamically-allocated buffers duplicated in new buffers.
10228 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
10231 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
10233 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
10236 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
10238 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
10241 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
10243 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
10246 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
10247 * but with all dynamically-allocated buffers duplicated in new buffers.
10249 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
10252 * Creates a new CResult_ExpiryTimeCreationErrorZ in the success state.
10254 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_ok(struct LDKExpiryTime o);
10257 * Creates a new CResult_ExpiryTimeCreationErrorZ in the error state.
10259 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_err(enum LDKCreationError e);
10262 * Frees any resources used by the CResult_ExpiryTimeCreationErrorZ.
10264 void CResult_ExpiryTimeCreationErrorZ_free(struct LDKCResult_ExpiryTimeCreationErrorZ _res);
10267 * Creates a new CResult_ExpiryTimeCreationErrorZ which has the same data as `orig`
10268 * but with all dynamically-allocated buffers duplicated in new buffers.
10270 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_clone(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR orig);
10273 * Creates a new CResult_RouteHintCreationErrorZ in the success state.
10275 struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_ok(struct LDKRouteHint o);
10278 * Creates a new CResult_RouteHintCreationErrorZ in the error state.
10280 struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_err(enum LDKCreationError e);
10283 * Frees any resources used by the CResult_RouteHintCreationErrorZ.
10285 void CResult_RouteHintCreationErrorZ_free(struct LDKCResult_RouteHintCreationErrorZ _res);
10288 * Creates a new CResult_RouteHintCreationErrorZ which has the same data as `orig`
10289 * but with all dynamically-allocated buffers duplicated in new buffers.
10291 struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_clone(const struct LDKCResult_RouteHintCreationErrorZ *NONNULL_PTR orig);
10294 * Creates a new CResult_StringErrorZ in the success state.
10296 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
10299 * Creates a new CResult_StringErrorZ in the error state.
10301 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
10304 * Frees any resources used by the CResult_StringErrorZ.
10306 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
10309 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
10311 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
10314 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
10316 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10319 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
10321 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
10324 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
10325 * but with all dynamically-allocated buffers duplicated in new buffers.
10327 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
10330 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
10332 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
10335 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
10337 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10340 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
10342 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
10345 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
10346 * but with all dynamically-allocated buffers duplicated in new buffers.
10348 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
10351 * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
10353 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
10356 * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
10358 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
10361 * Frees any resources used by the CResult_NoneMonitorUpdateErrorZ.
10363 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
10366 * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
10367 * but with all dynamically-allocated buffers duplicated in new buffers.
10369 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
10372 * Creates a new tuple which has the same data as `orig`
10373 * but with all dynamically-allocated buffers duplicated in new buffers.
10375 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
10378 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
10380 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
10383 * Frees any resources used by the C2Tuple_OutPointScriptZ.
10385 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
10388 * Creates a new tuple which has the same data as `orig`
10389 * but with all dynamically-allocated buffers duplicated in new buffers.
10391 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
10394 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
10396 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
10399 * Frees any resources used by the C2Tuple_u32ScriptZ.
10401 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
10404 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10406 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
10409 * Creates a new tuple which has the same data as `orig`
10410 * but with all dynamically-allocated buffers duplicated in new buffers.
10412 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
10415 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
10417 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
10420 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
10422 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
10425 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10427 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
10430 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10432 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
10435 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10437 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
10440 * Creates a new tuple which has the same data as `orig`
10441 * but with all dynamically-allocated buffers duplicated in new buffers.
10443 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
10446 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
10448 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
10451 * Frees any resources used by the C2Tuple_u32TxOutZ.
10453 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
10456 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10458 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
10461 * Creates a new tuple which has the same data as `orig`
10462 * but with all dynamically-allocated buffers duplicated in new buffers.
10464 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
10467 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
10469 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
10472 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
10474 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
10477 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10479 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
10482 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
10484 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
10487 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
10489 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
10492 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
10494 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
10497 * Creates a new CResult_boolLightningErrorZ in the success state.
10499 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
10502 * Creates a new CResult_boolLightningErrorZ in the error state.
10504 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
10507 * Frees any resources used by the CResult_boolLightningErrorZ.
10509 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
10512 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
10513 * but with all dynamically-allocated buffers duplicated in new buffers.
10515 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
10518 * Creates a new tuple which has the same data as `orig`
10519 * but with all dynamically-allocated buffers duplicated in new buffers.
10521 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
10524 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
10526 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
10529 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
10531 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
10534 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10536 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
10539 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10541 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
10544 * Creates a new CResult_NoneLightningErrorZ in the success state.
10546 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
10549 * Creates a new CResult_NoneLightningErrorZ in the error state.
10551 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
10554 * Frees any resources used by the CResult_NoneLightningErrorZ.
10556 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
10559 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
10560 * but with all dynamically-allocated buffers duplicated in new buffers.
10562 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
10565 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10567 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
10570 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
10572 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
10575 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
10577 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
10580 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
10582 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
10585 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
10586 * but with all dynamically-allocated buffers duplicated in new buffers.
10588 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
10591 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
10593 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
10596 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
10598 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
10601 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
10603 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
10606 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
10607 * but with all dynamically-allocated buffers duplicated in new buffers.
10609 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
10612 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
10614 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
10617 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
10619 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
10622 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
10624 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
10627 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
10628 * but with all dynamically-allocated buffers duplicated in new buffers.
10630 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
10633 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
10635 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
10638 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
10640 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
10643 * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
10645 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
10648 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
10649 * but with all dynamically-allocated buffers duplicated in new buffers.
10651 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
10654 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
10656 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
10659 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
10661 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
10664 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
10666 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
10669 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
10670 * but with all dynamically-allocated buffers duplicated in new buffers.
10672 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
10675 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
10677 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
10680 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
10682 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
10685 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
10687 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
10690 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
10691 * but with all dynamically-allocated buffers duplicated in new buffers.
10693 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
10696 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
10698 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
10701 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
10703 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
10706 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
10708 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
10711 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
10712 * but with all dynamically-allocated buffers duplicated in new buffers.
10714 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
10717 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10719 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
10722 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
10724 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
10727 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
10729 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
10732 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
10734 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
10737 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
10738 * but with all dynamically-allocated buffers duplicated in new buffers.
10740 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
10743 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
10745 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
10748 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
10750 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
10753 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
10755 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
10758 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
10759 * but with all dynamically-allocated buffers duplicated in new buffers.
10761 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
10764 * Creates a new CResult_NetAddressu8Z in the success state.
10766 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
10769 * Creates a new CResult_NetAddressu8Z in the error state.
10771 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
10774 * Frees any resources used by the CResult_NetAddressu8Z.
10776 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
10779 * Creates a new CResult_NetAddressu8Z which has the same data as `orig`
10780 * but with all dynamically-allocated buffers duplicated in new buffers.
10782 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
10785 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state.
10787 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
10790 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state.
10792 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
10795 * Frees any resources used by the CResult_CResult_NetAddressu8ZDecodeErrorZ.
10797 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
10800 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig`
10801 * but with all dynamically-allocated buffers duplicated in new buffers.
10803 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
10806 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
10808 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
10811 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
10813 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
10816 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
10818 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
10821 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
10822 * but with all dynamically-allocated buffers duplicated in new buffers.
10824 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
10827 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10829 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
10832 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10834 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
10837 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10839 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
10842 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10844 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
10847 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
10849 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
10852 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
10854 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
10857 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
10859 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
10862 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
10863 * but with all dynamically-allocated buffers duplicated in new buffers.
10865 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
10868 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
10870 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
10873 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
10875 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
10878 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
10880 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
10883 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
10884 * but with all dynamically-allocated buffers duplicated in new buffers.
10886 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
10889 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
10891 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
10894 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
10896 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
10899 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
10901 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
10904 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
10905 * but with all dynamically-allocated buffers duplicated in new buffers.
10907 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
10910 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
10912 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
10915 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
10917 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
10920 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
10922 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
10925 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
10926 * but with all dynamically-allocated buffers duplicated in new buffers.
10928 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
10931 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
10933 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
10936 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
10938 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
10941 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
10943 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
10946 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
10947 * but with all dynamically-allocated buffers duplicated in new buffers.
10949 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
10952 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
10954 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
10957 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
10959 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
10962 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
10964 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
10967 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
10968 * but with all dynamically-allocated buffers duplicated in new buffers.
10970 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
10973 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
10975 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
10978 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
10980 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
10983 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
10985 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
10988 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
10989 * but with all dynamically-allocated buffers duplicated in new buffers.
10991 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
10994 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
10996 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
10999 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
11001 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
11004 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
11006 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
11009 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
11010 * but with all dynamically-allocated buffers duplicated in new buffers.
11012 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
11015 * Creates a new CResult_InitDecodeErrorZ in the success state.
11017 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
11020 * Creates a new CResult_InitDecodeErrorZ in the error state.
11022 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
11025 * Frees any resources used by the CResult_InitDecodeErrorZ.
11027 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
11030 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
11031 * but with all dynamically-allocated buffers duplicated in new buffers.
11033 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
11036 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
11038 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
11041 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
11043 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
11046 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
11048 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
11051 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
11052 * but with all dynamically-allocated buffers duplicated in new buffers.
11054 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
11057 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
11059 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
11062 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
11064 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
11067 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
11069 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
11072 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
11073 * but with all dynamically-allocated buffers duplicated in new buffers.
11075 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
11078 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
11080 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
11083 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
11085 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
11088 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
11090 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
11093 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
11094 * but with all dynamically-allocated buffers duplicated in new buffers.
11096 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
11099 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
11101 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
11104 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
11106 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11109 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
11111 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
11114 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
11115 * but with all dynamically-allocated buffers duplicated in new buffers.
11117 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
11120 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
11122 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
11125 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
11127 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11130 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
11132 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
11135 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
11136 * but with all dynamically-allocated buffers duplicated in new buffers.
11138 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
11141 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
11143 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
11146 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
11148 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
11151 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
11153 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
11156 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
11157 * but with all dynamically-allocated buffers duplicated in new buffers.
11159 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
11162 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
11164 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
11167 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
11169 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11172 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
11174 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
11177 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
11178 * but with all dynamically-allocated buffers duplicated in new buffers.
11180 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
11183 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
11185 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
11188 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
11190 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11193 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
11195 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
11198 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
11199 * but with all dynamically-allocated buffers duplicated in new buffers.
11201 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
11204 * Creates a new CResult_PingDecodeErrorZ in the success state.
11206 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
11209 * Creates a new CResult_PingDecodeErrorZ in the error state.
11211 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
11214 * Frees any resources used by the CResult_PingDecodeErrorZ.
11216 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
11219 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
11220 * but with all dynamically-allocated buffers duplicated in new buffers.
11222 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
11225 * Creates a new CResult_PongDecodeErrorZ in the success state.
11227 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
11230 * Creates a new CResult_PongDecodeErrorZ in the error state.
11232 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
11235 * Frees any resources used by the CResult_PongDecodeErrorZ.
11237 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
11240 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
11241 * but with all dynamically-allocated buffers duplicated in new buffers.
11243 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
11246 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
11248 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
11251 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
11253 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11256 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
11258 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
11261 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
11262 * but with all dynamically-allocated buffers duplicated in new buffers.
11264 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11267 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
11269 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
11272 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
11274 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11277 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
11279 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
11282 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
11283 * but with all dynamically-allocated buffers duplicated in new buffers.
11285 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11288 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
11290 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
11293 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
11295 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
11298 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
11300 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
11303 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
11304 * but with all dynamically-allocated buffers duplicated in new buffers.
11306 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
11309 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
11311 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
11314 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
11316 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
11319 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
11321 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
11324 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
11325 * but with all dynamically-allocated buffers duplicated in new buffers.
11327 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
11330 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
11332 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
11335 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
11337 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
11340 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
11342 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
11345 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
11346 * but with all dynamically-allocated buffers duplicated in new buffers.
11348 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
11351 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
11353 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
11356 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
11358 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11361 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
11363 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
11366 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
11367 * but with all dynamically-allocated buffers duplicated in new buffers.
11369 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11372 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
11374 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
11377 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
11379 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11382 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
11384 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
11387 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
11388 * but with all dynamically-allocated buffers duplicated in new buffers.
11390 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11393 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
11395 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
11398 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
11400 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
11403 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
11405 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
11408 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
11409 * but with all dynamically-allocated buffers duplicated in new buffers.
11411 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
11414 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
11416 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
11419 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
11421 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
11424 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
11426 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
11429 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
11430 * but with all dynamically-allocated buffers duplicated in new buffers.
11432 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
11435 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
11437 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
11440 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
11442 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
11445 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
11447 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
11450 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
11451 * but with all dynamically-allocated buffers duplicated in new buffers.
11453 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
11456 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
11458 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
11461 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
11463 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
11466 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
11468 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
11471 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
11472 * but with all dynamically-allocated buffers duplicated in new buffers.
11474 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
11477 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
11479 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
11482 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
11484 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
11487 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
11489 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
11492 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
11493 * but with all dynamically-allocated buffers duplicated in new buffers.
11495 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
11498 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
11500 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
11503 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
11505 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
11508 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
11510 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
11513 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
11514 * but with all dynamically-allocated buffers duplicated in new buffers.
11516 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
11519 * Frees any resources used by the Event
11521 void Event_free(struct LDKEvent this_ptr);
11524 * Creates a copy of the Event
11526 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
11529 * Serialize the Event object into a byte array which can be read by Event_read
11531 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
11534 * Frees any resources used by the MessageSendEvent
11536 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
11539 * Creates a copy of the MessageSendEvent
11541 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
11544 * Calls the free function if one is set
11546 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
11549 * Calls the free function if one is set
11551 void EventsProvider_free(struct LDKEventsProvider this_ptr);
11554 * Calls the free function if one is set
11556 void EventHandler_free(struct LDKEventHandler this_ptr);
11559 * Frees any resources used by the APIError
11561 void APIError_free(struct LDKAPIError this_ptr);
11564 * Creates a copy of the APIError
11566 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
11569 * Creates a digital signature of a message given a SecretKey, like the node's secret.
11570 * 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.
11571 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
11573 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, struct LDKSecretKey sk);
11576 * Recovers the PublicKey of the signer of the message given the message and the signature.
11578 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
11581 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
11582 * and the PublicKey.
11584 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
11587 * Creates a copy of the Level
11589 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
11592 * Checks if two Levels contain equal inner contents.
11593 * This ignores pointers and is_owned flags and looks at the values in fields.
11595 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
11598 * Checks if two Levels contain equal inner contents.
11600 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
11603 * Returns the most verbose logging level.
11605 MUST_USE_RES enum LDKLevel Level_max(void);
11608 * Calls the free function if one is set
11610 void Logger_free(struct LDKLogger this_ptr);
11613 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
11615 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
11618 * Confirmations we will wait for before considering the channel locked in.
11619 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
11620 * equivalent limit applied to outbound channels).
11622 * Default value: 6.
11624 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11627 * Confirmations we will wait for before considering the channel locked in.
11628 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
11629 * equivalent limit applied to outbound channels).
11631 * Default value: 6.
11633 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
11636 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
11637 * the number of blocks we have to punish our counterparty if they broadcast a revoked
11640 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
11641 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
11642 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
11643 * possibly with time in between to RBF the spending transaction).
11645 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
11646 * case of an honest unilateral channel close, which implicitly decrease the economic value of
11649 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
11650 * can tweak config to ask for more security, not less.
11652 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11655 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
11656 * the number of blocks we have to punish our counterparty if they broadcast a revoked
11659 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
11660 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
11661 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
11662 * possibly with time in between to RBF the spending transaction).
11664 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
11665 * case of an honest unilateral channel close, which implicitly decrease the economic value of
11668 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
11669 * can tweak config to ask for more security, not less.
11671 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
11674 * Set to the smallest value HTLC we will accept to process.
11676 * This value is sent to our counterparty on channel-open and we close the channel any time
11677 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
11679 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
11682 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11685 * Set to the smallest value HTLC we will accept to process.
11687 * This value is sent to our counterparty on channel-open and we close the channel any time
11688 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
11690 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
11693 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
11696 * Constructs a new ChannelHandshakeConfig given each field
11698 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);
11701 * Creates a copy of the ChannelHandshakeConfig
11703 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
11706 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
11708 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
11711 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
11713 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
11716 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
11717 * only applies to inbound channels.
11719 * Default value: 0.
11721 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11724 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
11725 * only applies to inbound channels.
11727 * Default value: 0.
11729 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11732 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
11733 * you to limit the maximum minimum-size they can require.
11735 * Default value: u64::max_value.
11737 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11740 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
11741 * you to limit the maximum minimum-size they can require.
11743 * Default value: u64::max_value.
11745 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11748 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
11749 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
11751 * Default value: 0.
11753 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11756 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
11757 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
11759 * Default value: 0.
11761 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11764 * The remote node will require we keep a certain amount in direct payment to ourselves at all
11765 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
11766 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
11768 * Default value: u64::max_value.
11770 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11773 * The remote node will require we keep a certain amount in direct payment to ourselves at all
11774 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
11775 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
11777 * Default value: u64::max_value.
11779 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11782 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
11783 * time. This allows you to set a minimum such value.
11785 * Default value: 0.
11787 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11790 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
11791 * time. This allows you to set a minimum such value.
11793 * Default value: 0.
11795 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
11798 * Before a channel is usable the funding transaction will need to be confirmed by at least a
11799 * certain number of blocks, specified by the node which is not the funder (as the funder can
11800 * assume they aren't going to double-spend themselves).
11801 * This config allows you to set a limit on the maximum amount of time to wait.
11803 * Default value: 144, or roughly one day and only applies to outbound channels.
11805 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11808 * Before a channel is usable the funding transaction will need to be confirmed by at least a
11809 * certain number of blocks, specified by the node which is not the funder (as the funder can
11810 * assume they aren't going to double-spend themselves).
11811 * This config allows you to set a limit on the maximum amount of time to wait.
11813 * Default value: 144, or roughly one day and only applies to outbound channels.
11815 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
11818 * Set to force the incoming channel to match our announced channel preference in
11821 * Default value: true, to make the default that no announced channels are possible (which is
11822 * appropriate for any nodes which are not online very reliably).
11824 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11827 * Set to force the incoming channel to match our announced channel preference in
11830 * Default value: true, to make the default that no announced channels are possible (which is
11831 * appropriate for any nodes which are not online very reliably).
11833 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
11836 * Set to the amount of time we're willing to wait to claim money back to us.
11838 * Not checking this value would be a security issue, as our peer would be able to set it to
11839 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
11841 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
11842 * reduce the loss of having useless locked funds (if your peer accepts)
11844 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11847 * Set to the amount of time we're willing to wait to claim money back to us.
11849 * Not checking this value would be a security issue, as our peer would be able to set it to
11850 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
11852 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
11853 * reduce the loss of having useless locked funds (if your peer accepts)
11855 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
11858 * Constructs a new ChannelHandshakeLimits given each field
11860 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, uint32_t max_minimum_depth_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg);
11863 * Creates a copy of the ChannelHandshakeLimits
11865 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
11868 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
11870 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
11873 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
11875 void ChannelConfig_free(struct LDKChannelConfig this_obj);
11878 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
11879 * This may be allowed to change at runtime in a later update, however doing so must result in
11880 * update messages sent to notify all nodes of our updated relay fee.
11882 * Default value: 0.
11884 uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11887 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
11888 * This may be allowed to change at runtime in a later update, however doing so must result in
11889 * update messages sent to notify all nodes of our updated relay fee.
11891 * Default value: 0.
11893 void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
11896 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
11897 * the channel this config applies to.
11899 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
11900 * HTLC balance when a channel appears on-chain whereas
11901 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
11902 * (non-HTLC-encumbered) balance.
11904 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
11905 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
11906 * commitment transaction at least once per this many blocks (minus some margin to allow us
11907 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
11908 * the spending transaction).
11910 * Default value: 72 (12 hours at an average of 6 blocks/hour).
11911 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
11912 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
11914 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
11916 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11919 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
11920 * the channel this config applies to.
11922 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
11923 * HTLC balance when a channel appears on-chain whereas
11924 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
11925 * (non-HTLC-encumbered) balance.
11927 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
11928 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
11929 * commitment transaction at least once per this many blocks (minus some margin to allow us
11930 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
11931 * the spending transaction).
11933 * Default value: 72 (12 hours at an average of 6 blocks/hour).
11934 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
11935 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
11937 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
11939 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
11942 * Set to announce the channel publicly and notify all nodes that they can route via this
11945 * This should only be set to true for nodes which expect to be online reliably.
11947 * As the node which funds a channel picks this value this will only apply for new outbound
11948 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
11950 * This cannot be changed after the initial channel handshake.
11952 * Default value: false.
11954 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11957 * Set to announce the channel publicly and notify all nodes that they can route via this
11960 * This should only be set to true for nodes which expect to be online reliably.
11962 * As the node which funds a channel picks this value this will only apply for new outbound
11963 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
11965 * This cannot be changed after the initial channel handshake.
11967 * Default value: false.
11969 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
11972 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
11973 * supports it, they will then enforce the mutual-close output to us matches what we provided
11974 * at intialization, preventing us from closing to an alternate pubkey.
11976 * This is set to true by default to provide a slight increase in security, though ultimately
11977 * any attacker who is able to take control of a channel can just as easily send the funds via
11978 * lightning payments, so we never require that our counterparties support this option.
11980 * This cannot be changed after a channel has been initialized.
11982 * Default value: true.
11984 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11987 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
11988 * supports it, they will then enforce the mutual-close output to us matches what we provided
11989 * at intialization, preventing us from closing to an alternate pubkey.
11991 * This is set to true by default to provide a slight increase in security, though ultimately
11992 * any attacker who is able to take control of a channel can just as easily send the funds via
11993 * lightning payments, so we never require that our counterparties support this option.
11995 * This cannot be changed after a channel has been initialized.
11997 * Default value: true.
11999 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
12002 * Constructs a new ChannelConfig given each field
12004 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);
12007 * Creates a copy of the ChannelConfig
12009 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
12012 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
12014 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
12017 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
12019 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
12022 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
12024 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
12027 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
12029 void UserConfig_free(struct LDKUserConfig this_obj);
12032 * Channel config that we propose to our counterparty.
12034 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
12037 * Channel config that we propose to our counterparty.
12039 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
12042 * Limits applied to our counterparty's proposed channel config settings.
12044 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
12047 * Limits applied to our counterparty's proposed channel config settings.
12049 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
12052 * Channel config which affects behavior during channel lifetime.
12054 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
12057 * Channel config which affects behavior during channel lifetime.
12059 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
12062 * Constructs a new UserConfig given each field
12064 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);
12067 * Creates a copy of the UserConfig
12069 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
12072 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
12074 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
12077 * Creates a copy of the AccessError
12079 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
12082 * Calls the free function if one is set
12084 void Access_free(struct LDKAccess this_ptr);
12087 * Calls the free function if one is set
12089 void Listen_free(struct LDKListen this_ptr);
12092 * Calls the free function if one is set
12094 void Confirm_free(struct LDKConfirm this_ptr);
12097 * Calls the free function if one is set
12099 void Watch_free(struct LDKWatch this_ptr);
12102 * Calls the free function if one is set
12104 void Filter_free(struct LDKFilter this_ptr);
12107 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
12109 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
12112 * First block where the transaction output may have been spent.
12114 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
12117 * First block where the transaction output may have been spent.
12119 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12122 * Outpoint identifying the transaction output.
12124 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
12127 * Outpoint identifying the transaction output.
12129 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12132 * Spending condition of the transaction output.
12134 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
12137 * Spending condition of the transaction output.
12139 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
12142 * Constructs a new WatchedOutput given each field
12144 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
12147 * Creates a copy of the WatchedOutput
12149 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
12152 * Checks if two WatchedOutputs contain equal inner contents.
12154 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
12157 * Calls the free function if one is set
12159 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
12162 * Creates a copy of the ConfirmationTarget
12164 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
12167 * Calls the free function if one is set
12169 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
12172 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
12174 void ChainMonitor_free(struct LDKChainMonitor this_obj);
12177 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
12179 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
12180 * will call back to it indicating transactions and outputs of interest. This allows clients to
12181 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
12182 * always need to fetch full blocks absent another means for determining which blocks contain
12183 * transactions relevant to the watched channels.
12185 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
12188 * Constructs a new Listen which calls the relevant methods on this_arg.
12189 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
12191 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12194 * Constructs a new Confirm which calls the relevant methods on this_arg.
12195 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
12197 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12200 * Constructs a new Watch which calls the relevant methods on this_arg.
12201 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
12203 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12206 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
12207 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
12209 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12212 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
12214 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
12217 * The sequence number of this update. Updates *must* be replayed in-order according to this
12218 * sequence number (and updates may panic if they are not). The update_id values are strictly
12219 * increasing and increase by one for each new update, with one exception specified below.
12221 * This sequence number is also used to track up to which points updates which returned
12222 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
12223 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
12225 * The only instance where update_id values are not strictly increasing is the case where we
12226 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
12227 * its docs for more details.
12229 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
12232 * The sequence number of this update. Updates *must* be replayed in-order according to this
12233 * sequence number (and updates may panic if they are not). The update_id values are strictly
12234 * increasing and increase by one for each new update, with one exception specified below.
12236 * This sequence number is also used to track up to which points updates which returned
12237 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
12238 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
12240 * The only instance where update_id values are not strictly increasing is the case where we
12241 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
12242 * its docs for more details.
12244 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
12247 * Creates a copy of the ChannelMonitorUpdate
12249 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
12252 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
12254 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
12257 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
12259 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
12262 * Creates a copy of the ChannelMonitorUpdateErr
12264 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
12267 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
12269 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
12272 * Creates a copy of the MonitorUpdateError
12274 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
12277 * Frees any resources used by the MonitorEvent
12279 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
12282 * Creates a copy of the MonitorEvent
12284 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
12287 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
12289 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
12292 * Creates a copy of the HTLCUpdate
12294 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
12297 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
12299 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
12302 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
12304 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
12307 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
12309 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
12312 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
12314 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
12317 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
12320 * panics if the given update is not the next update by update_id.
12322 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);
12325 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
12328 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12331 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
12333 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12336 * Gets a list of txids, with their output scripts (in the order they appear in the
12337 * transaction), which we must learn about spends of via block_connected().
12339 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12342 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
12343 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
12344 * have been registered.
12346 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
12349 * Get the list of HTLCs who's status has been updated on chain. This should be called by
12350 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
12352 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12355 * Gets the list of pending events which were generated by previous actions, clearing the list
12358 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
12359 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
12360 * no internal locking in ChannelMonitors.
12362 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12365 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
12366 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
12367 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
12368 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
12369 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
12370 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
12371 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
12372 * out-of-band the other node operator to coordinate with him if option is available to you.
12373 * In any-case, choice is up to the user.
12375 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);
12378 * Processes transactions in a newly connected block, which may result in any of the following:
12379 * - update the monitor's state against resolved HTLCs
12380 * - punish the counterparty in the case of seeing a revoked commitment transaction
12381 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
12382 * - detect settled outputs for later spending
12383 * - schedule and bump any in-flight claims
12385 * Returns any new outputs to watch from `txdata`; after called, these are also included in
12386 * [`get_outputs_to_watch`].
12388 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
12390 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);
12393 * Determines if the disconnected block contained any transactions of interest and updates
12396 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);
12399 * Processes transactions confirmed in a block with the given header and height, returning new
12400 * outputs to watch. See [`block_connected`] for details.
12402 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
12403 * blocks. See [`chain::Confirm`] for calling expectations.
12405 * [`block_connected`]: Self::block_connected
12407 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);
12410 * Processes a transaction that was reorganized out of the chain.
12412 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
12413 * than blocks. See [`chain::Confirm`] for calling expectations.
12415 * [`block_disconnected`]: Self::block_disconnected
12417 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);
12420 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
12421 * [`block_connected`] for details.
12423 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
12424 * blocks. See [`chain::Confirm`] for calling expectations.
12426 * [`block_connected`]: Self::block_connected
12428 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_best_block_updated(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);
12431 * Returns the set of txids that should be monitored for re-organization out of the chain.
12433 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12436 * Calls the free function if one is set
12438 void Persist_free(struct LDKPersist this_ptr);
12441 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
12443 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
12446 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
12448 void OutPoint_free(struct LDKOutPoint this_obj);
12451 * The referenced transaction's txid.
12453 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
12456 * The referenced transaction's txid.
12458 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12461 * The index of the referenced output in its transaction's vout.
12463 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
12466 * The index of the referenced output in its transaction's vout.
12468 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
12471 * Constructs a new OutPoint given each field
12473 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
12476 * Creates a copy of the OutPoint
12478 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
12481 * Checks if two OutPoints contain equal inner contents.
12482 * This ignores pointers and is_owned flags and looks at the values in fields.
12483 * Two objects with NULL inner values will be considered "equal" here.
12485 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
12488 * Checks if two OutPoints contain equal inner contents.
12490 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
12493 * Convert an `OutPoint` to a lightning channel id.
12495 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
12498 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
12500 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
12503 * Read a OutPoint from a byte array, created by OutPoint_write
12505 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
12508 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
12510 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
12513 * The outpoint which is spendable
12515 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12518 * The outpoint which is spendable
12520 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12523 * Per commitment point to derive delayed_payment_key by key holder
12525 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12528 * Per commitment point to derive delayed_payment_key by key holder
12530 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12533 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
12534 * the witness_script.
12536 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12539 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
12540 * the witness_script.
12542 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
12545 * The output which is referenced by the given outpoint
12547 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
12550 * The revocation point specific to the commitment transaction which was broadcast. Used to
12551 * derive the witnessScript for this output.
12553 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12556 * The revocation point specific to the commitment transaction which was broadcast. Used to
12557 * derive the witnessScript for this output.
12559 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12562 * Arbitrary identification information returned by a call to
12563 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12564 * the channel to spend the output.
12566 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
12569 * Arbitrary identification information returned by a call to
12570 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12571 * the channel to spend the output.
12573 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12576 * The value of the channel which this output originated from, possibly indirectly.
12578 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12581 * The value of the channel which this output originated from, possibly indirectly.
12583 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
12586 * Constructs a new DelayedPaymentOutputDescriptor given each field
12588 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);
12591 * Creates a copy of the DelayedPaymentOutputDescriptor
12593 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
12596 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
12598 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
12601 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
12603 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
12606 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
12608 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
12611 * The outpoint which is spendable
12613 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12616 * The outpoint which is spendable
12618 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12621 * The output which is referenced by the given outpoint
12623 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
12626 * Arbitrary identification information returned by a call to
12627 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12628 * the channel to spend the output.
12630 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
12633 * Arbitrary identification information returned by a call to
12634 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12635 * the channel to spend the output.
12637 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12640 * The value of the channel which this transactions spends.
12642 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12645 * The value of the channel which this transactions spends.
12647 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
12650 * Constructs a new StaticPaymentOutputDescriptor given each field
12652 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);
12655 * Creates a copy of the StaticPaymentOutputDescriptor
12657 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
12660 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
12662 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
12665 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
12667 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
12670 * Frees any resources used by the SpendableOutputDescriptor
12672 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
12675 * Creates a copy of the SpendableOutputDescriptor
12677 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
12680 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
12682 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
12685 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
12687 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
12690 * Calls the free function if one is set
12692 void BaseSign_free(struct LDKBaseSign this_ptr);
12695 * Creates a copy of a Sign
12697 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
12700 * Calls the free function if one is set
12702 void Sign_free(struct LDKSign this_ptr);
12705 * Calls the free function if one is set
12707 void KeysInterface_free(struct LDKKeysInterface this_ptr);
12710 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
12712 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
12715 * Private key of anchor tx
12717 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12720 * Private key of anchor tx
12722 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12725 * Holder secret key for blinded revocation pubkey
12727 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12730 * Holder secret key for blinded revocation pubkey
12732 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12735 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
12737 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12740 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
12742 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12745 * Holder secret key used in HTLC tx
12747 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12750 * Holder secret key used in HTLC tx
12752 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12755 * Holder htlc secret key used in commitment tx htlc outputs
12757 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12760 * Holder htlc secret key used in commitment tx htlc outputs
12762 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12767 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12772 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12775 * Creates a copy of the InMemorySigner
12777 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
12780 * Create a new InMemorySigner
12782 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);
12785 * Counterparty pubkeys.
12786 * Will panic if ready_channel wasn't called.
12788 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12791 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
12792 * transactions, ie the amount of time that we have to wait to recover our funds if we
12793 * broadcast a transaction.
12794 * Will panic if ready_channel wasn't called.
12796 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12799 * The contest_delay value specified by us and applied on transactions broadcastable
12800 * by our counterparty, ie the amount of time that they have to wait to recover their funds
12801 * if they broadcast a transaction.
12802 * Will panic if ready_channel wasn't called.
12804 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12807 * Whether the holder is the initiator
12808 * Will panic if ready_channel wasn't called.
12810 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12814 * Will panic if ready_channel wasn't called.
12816 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12819 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
12820 * building transactions.
12822 * Will panic if ready_channel wasn't called.
12824 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12827 * Sign the single input of spend_tx at index `input_idx` which spends the output
12828 * described by descriptor, returning the witness stack for the input.
12830 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
12831 * or is not spending the outpoint described by `descriptor.outpoint`.
12833 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);
12836 * Sign the single input of spend_tx at index `input_idx` which spends the output
12837 * described by descriptor, returning the witness stack for the input.
12839 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
12840 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
12841 * sequence set to `descriptor.to_self_delay`.
12843 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);
12846 * Constructs a new BaseSign which calls the relevant methods on this_arg.
12847 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
12849 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12852 * Constructs a new Sign which calls the relevant methods on this_arg.
12853 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
12855 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12858 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
12860 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
12863 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
12865 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
12868 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
12870 void KeysManager_free(struct LDKKeysManager this_obj);
12873 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
12874 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
12875 * starting_time isn't strictly required to actually be a time, but it must absolutely,
12876 * without a doubt, be unique to this instance. ie if you start multiple times with the same
12877 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
12878 * simply use the current time (with very high precision).
12880 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
12881 * obviously, starting_time should be unique every time you reload the library - it is only
12882 * used to generate new ephemeral key data (which will be stored by the individual channel if
12885 * Note that the seed is required to recover certain on-chain funds independent of
12886 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
12887 * channel, and some on-chain during-closing funds.
12889 * Note that until the 0.1 release there is no guarantee of backward compatibility between
12890 * versions. Once the library is more fully supported, the docs will be updated to include a
12891 * detailed description of the guarantee.
12893 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
12896 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
12898 * Key derivation parameters are accessible through a per-channel secrets
12899 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
12900 * onchain output detection for which a corresponding delayed_payment_key must be derived.
12902 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]);
12905 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
12906 * output to the given change destination (if sufficient change value remains). The
12907 * transaction will have a feerate, at least, of the given value.
12909 * Returns `Err(())` if the output value is greater than the input value minus required fee or
12910 * if a descriptor was duplicated.
12912 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
12914 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
12915 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
12917 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);
12920 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
12921 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
12923 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
12926 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
12928 void ChannelManager_free(struct LDKChannelManager this_obj);
12931 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
12933 void ChainParameters_free(struct LDKChainParameters this_obj);
12936 * The network for determining the `chain_hash` in Lightning messages.
12938 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
12941 * The network for determining the `chain_hash` in Lightning messages.
12943 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
12946 * The hash and height of the latest block successfully connected.
12948 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
12950 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
12953 * The hash and height of the latest block successfully connected.
12955 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
12957 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
12960 * Constructs a new ChainParameters given each field
12962 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
12965 * Creates a copy of the ChainParameters
12967 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
12970 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
12972 void BestBlock_free(struct LDKBestBlock this_obj);
12975 * Creates a copy of the BestBlock
12977 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
12980 * Returns the best block from the genesis of the given network.
12982 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
12985 * Returns the best block as identified by the given block hash and height.
12987 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
12990 * Returns the best block hash.
12992 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
12995 * Returns the best block height.
12997 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
13000 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
13002 void ChannelDetails_free(struct LDKChannelDetails this_obj);
13005 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
13006 * thereafter this is the txid of the funding transaction xor the funding transaction output).
13007 * Note that this means this value is *not* persistent - it can change once during the
13008 * lifetime of the channel.
13010 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
13013 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
13014 * thereafter this is the txid of the funding transaction xor the funding transaction output).
13015 * Note that this means this value is *not* persistent - it can change once during the
13016 * lifetime of the channel.
13018 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13021 * The Channel's funding transaction output, if we've negotiated the funding transaction with
13022 * our counterparty already.
13024 * Note that, if this has been set, `channel_id` will be equivalent to
13025 * `funding_txo.unwrap().to_channel_id()`.
13027 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13030 * The Channel's funding transaction output, if we've negotiated the funding transaction with
13031 * our counterparty already.
13033 * Note that, if this has been set, `channel_id` will be equivalent to
13034 * `funding_txo.unwrap().to_channel_id()`.
13036 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
13039 * The position of the funding transaction in the chain. None if the funding transaction has
13040 * not yet been confirmed and the channel fully opened.
13042 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13045 * The position of the funding transaction in the chain. None if the funding transaction has
13046 * not yet been confirmed and the channel fully opened.
13048 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
13051 * The node_id of our counterparty
13053 struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13056 * The node_id of our counterparty
13058 void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13061 * The Features the channel counterparty provided upon last connection.
13062 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
13063 * many routing-relevant features are present in the init context.
13065 struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13068 * The Features the channel counterparty provided upon last connection.
13069 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
13070 * many routing-relevant features are present in the init context.
13072 void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
13075 * The value, in satoshis, of this channel as appears in the funding output
13077 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13080 * The value, in satoshis, of this channel as appears in the funding output
13082 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
13085 * The user_id passed in to create_channel, or 0 if the channel was inbound.
13087 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13090 * The user_id passed in to create_channel, or 0 if the channel was inbound.
13092 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
13095 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
13096 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
13097 * available for inclusion in new outbound HTLCs). This further does not include any pending
13098 * outgoing HTLCs which are awaiting some other resolution to be sent.
13100 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13103 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
13104 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
13105 * available for inclusion in new outbound HTLCs). This further does not include any pending
13106 * outgoing HTLCs which are awaiting some other resolution to be sent.
13108 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
13111 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
13112 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
13113 * available for inclusion in new inbound HTLCs).
13114 * Note that there are some corner cases not fully handled here, so the actual available
13115 * inbound capacity may be slightly higher than this.
13117 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13120 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
13121 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
13122 * available for inclusion in new inbound HTLCs).
13123 * Note that there are some corner cases not fully handled here, so the actual available
13124 * inbound capacity may be slightly higher than this.
13126 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
13129 * True if the channel was initiated (and thus funded) by us.
13131 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13134 * True if the channel was initiated (and thus funded) by us.
13136 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
13139 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
13140 * channel is not currently being shut down. `funding_locked` message exchange implies the
13141 * required confirmation count has been reached (and we were connected to the peer at some
13142 * point after the funding transaction received enough confirmations).
13144 bool ChannelDetails_get_is_funding_locked(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13147 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
13148 * channel is not currently being shut down. `funding_locked` message exchange implies the
13149 * required confirmation count has been reached (and we were connected to the peer at some
13150 * point after the funding transaction received enough confirmations).
13152 void ChannelDetails_set_is_funding_locked(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
13155 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
13156 * the peer is connected, (c) no monitor update failure is pending resolution, and (d) the
13157 * channel is not currently negotiating a shutdown.
13159 * This is a strict superset of `is_funding_locked`.
13161 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13164 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
13165 * the peer is connected, (c) no monitor update failure is pending resolution, and (d) the
13166 * channel is not currently negotiating a shutdown.
13168 * This is a strict superset of `is_funding_locked`.
13170 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
13173 * True if this channel is (or will be) publicly-announced.
13175 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13178 * True if this channel is (or will be) publicly-announced.
13180 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
13183 * Creates a copy of the ChannelDetails
13185 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
13188 * Frees any resources used by the PaymentSendFailure
13190 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
13193 * Creates a copy of the PaymentSendFailure
13195 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
13198 * Constructs a new ChannelManager to hold several channels and route between them.
13200 * This is the main \"logic hub\" for all channel-related actions, and implements
13201 * ChannelMessageHandler.
13203 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
13205 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
13207 * Users need to notify the new ChannelManager when a new block is connected or
13208 * disconnected using its `block_connected` and `block_disconnected` methods, starting
13209 * from after `params.latest_hash`.
13211 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);
13214 * Gets the current configuration applied to all new channels, as
13216 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
13219 * Creates a new outbound channel to the given remote node and with the given value.
13221 * user_id will be provided back as user_channel_id in FundingGenerationReady events to allow
13222 * tracking of which events correspond with which create_channel call. Note that the
13223 * user_channel_id defaults to 0 for inbound channels, so you may wish to avoid using 0 for
13224 * user_id here. user_id has no meaning inside of LDK, it is simply copied to events and
13225 * otherwise ignored.
13227 * If successful, will generate a SendOpenChannel message event, so you should probably poll
13228 * PeerManager::process_events afterwards.
13230 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
13231 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
13233 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);
13236 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
13237 * more information.
13239 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
13242 * Gets the list of usable channels, in random order. Useful as an argument to
13243 * get_route to ensure non-announced channels are used.
13245 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
13246 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
13249 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
13252 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
13253 * will be accepted on the given channel, and after additional timeout/the closing of all
13254 * pending HTLCs, the channel will be closed on chain.
13256 * May generate a SendShutdown message event on success, which should be relayed.
13258 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
13261 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
13262 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
13264 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
13267 * Force close all channels, immediately broadcasting the latest local commitment transaction
13268 * for each to the chain and rejecting new HTLCs on each.
13270 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
13273 * Sends a payment along a given route.
13275 * Value parameters are provided via the last hop in route, see documentation for RouteHop
13276 * fields for more info.
13278 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
13279 * payment), we don't do anything to stop you! We always try to ensure that if the provided
13280 * next hop knows the preimage to payment_hash they can claim an additional amount as
13281 * specified in the last hop in the route! Thus, you should probably do your own
13282 * payment_preimage tracking (which you should already be doing as they represent \"proof of
13283 * payment\") and prevent double-sends yourself.
13285 * May generate SendHTLCs message(s) event on success, which should be relayed.
13287 * Each path may have a different return value, and PaymentSendValue may return a Vec with
13288 * each entry matching the corresponding-index entry in the route paths, see
13289 * PaymentSendFailure for more info.
13291 * In general, a path may raise:
13292 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
13293 * node public key) is specified.
13294 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
13295 * (including due to previous monitor update failure or new permanent monitor update
13297 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
13298 * relevant updates.
13300 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
13301 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
13302 * different route unless you intend to pay twice!
13304 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
13305 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
13306 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
13307 * must not contain multiple paths as multi-path payments require a recipient-provided
13309 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
13310 * bit set (either as required or as available). If multiple paths are present in the Route,
13311 * we assume the invoice had the basic_mpp feature set.
13313 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);
13316 * Call this upon creation of a funding transaction for the given channel.
13318 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
13319 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
13321 * Panics if a funding transaction has already been provided for this channel.
13323 * May panic if the output found in the funding transaction is duplicative with some other
13324 * channel (note that this should be trivially prevented by using unique funding transaction
13325 * keys per-channel).
13327 * Do NOT broadcast the funding transaction yourself. When we have safely received our
13328 * counterparty's signature the funding transaction will automatically be broadcast via the
13329 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
13331 * Note that this includes RBF or similar transaction replacement strategies - lightning does
13332 * not currently support replacing a funding transaction on an existing channel. Instead,
13333 * create a new channel with a conflicting funding transaction.
13335 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
13337 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);
13340 * Regenerates channel_announcements and generates a signed node_announcement from the given
13341 * arguments, providing them in corresponding events via
13342 * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed
13343 * on-chain. This effectively re-broadcasts all channel announcements and sends our node
13344 * announcement to ensure that the lightning P2P network is aware of the channels we have and
13345 * our network addresses.
13347 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
13348 * node to humans. They carry no in-protocol meaning.
13350 * `addresses` represent the set (possibly empty) of socket addresses on which this node
13351 * accepts incoming connections. These will be included in the node_announcement, publicly
13352 * tying these addresses together and to this node. If you wish to preserve user privacy,
13353 * addresses should likely contain only Tor Onion addresses.
13355 * Panics if `addresses` is absurdly large (more than 500).
13357 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
13359 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
13362 * Processes HTLCs which are pending waiting on random forward delay.
13364 * Should only really ever be called in response to a PendingHTLCsForwardable event.
13365 * Will likely generate further events.
13367 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
13370 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
13371 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
13372 * to inform the network about the uselessness of these channels.
13374 * This method handles all the details, and must be called roughly once per minute.
13376 * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
13378 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
13381 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
13382 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
13383 * along the path (including in our own channel on which we received it).
13384 * Returns false if no payment was found to fail backwards, true if the process of failing the
13385 * HTLC backwards has been started.
13387 MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
13390 * Provides a payment preimage in response to a PaymentReceived event, returning true and
13391 * generating message events for the net layer to claim the payment, if possible. Thus, you
13392 * should probably kick the net layer to go send messages if this returns true!
13394 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
13395 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
13396 * event matches your expectation. If you fail to do so and call this method, you may provide
13397 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
13399 * May panic if called except in response to a PaymentReceived event.
13401 * [`create_inbound_payment`]: Self::create_inbound_payment
13402 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
13404 MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
13407 * Gets the node_id held by this ChannelManager
13409 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
13412 * Restores a single, given channel to normal operation after a
13413 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
13416 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
13417 * fully committed in every copy of the given channels' ChannelMonitors.
13419 * Note that there is no effect to calling with a highest_applied_update_id other than the
13420 * current latest ChannelMonitorUpdate and one call to this function after multiple
13421 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
13422 * exists largely only to prevent races between this and concurrent update_monitor calls.
13424 * Thus, the anticipated use is, at a high level:
13425 * 1) You register a chain::Watch with this ChannelManager,
13426 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
13427 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
13428 * any time it cannot do so instantly,
13429 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
13430 * 4) once all remote copies are updated, you call this function with the update_id that
13431 * completed, and once it is the latest the Channel will be re-enabled.
13433 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);
13436 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
13439 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
13440 * [`PaymentHash`] and [`PaymentPreimage`] for you, returning the first and storing the second.
13442 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
13443 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
13444 * passed directly to [`claim_funds`].
13446 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
13448 * [`claim_funds`]: Self::claim_funds
13449 * [`PaymentReceived`]: events::Event::PaymentReceived
13450 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
13451 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
13453 MUST_USE_RES struct LDKC2Tuple_PaymentHashPaymentSecretZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, uint64_t user_payment_id);
13456 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
13457 * stored external to LDK.
13459 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
13460 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
13461 * the `min_value_msat` provided here, if one is provided.
13463 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) must be globally unique. This
13464 * method may return an Err if another payment with the same payment_hash is still pending.
13466 * `user_payment_id` will be provided back in [`PaymentReceived::user_payment_id`] events to
13467 * allow tracking of which events correspond with which calls to this and
13468 * [`create_inbound_payment`]. `user_payment_id` has no meaning inside of LDK, it is simply
13469 * copied to events and otherwise ignored. It may be used to correlate PaymentReceived events
13470 * with invoice metadata stored elsewhere.
13472 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
13473 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
13474 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
13475 * sender \"proof-of-payment\" unless they have paid the required amount.
13477 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
13478 * in excess of the current time. This should roughly match the expiry time set in the invoice.
13479 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
13480 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
13481 * invoices when no timeout is set.
13483 * Note that we use block header time to time-out pending inbound payments (with some margin
13484 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
13485 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
13486 * If you need exact expiry semantics, you should enforce them upon receipt of
13487 * [`PaymentReceived`].
13489 * Pending inbound payments are stored in memory and in serialized versions of this
13490 * [`ChannelManager`]. If potentially unbounded numbers of inbound payments may exist and
13491 * space is limited, you may wish to rate-limit inbound payment creation.
13493 * May panic if `invoice_expiry_delta_secs` is greater than one year.
13495 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
13496 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
13498 * [`create_inbound_payment`]: Self::create_inbound_payment
13499 * [`PaymentReceived`]: events::Event::PaymentReceived
13500 * [`PaymentReceived::user_payment_id`]: events::Event::PaymentReceived::user_payment_id
13502 MUST_USE_RES struct LDKCResult_PaymentSecretAPIErrorZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, uint64_t user_payment_id);
13505 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
13506 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
13508 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
13511 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
13512 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
13514 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
13517 * Constructs a new Listen which calls the relevant methods on this_arg.
13518 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
13520 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
13523 * Constructs a new Confirm which calls the relevant methods on this_arg.
13524 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
13526 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
13529 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
13530 * indicating whether persistence is necessary. Only one listener on
13531 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
13533 * Note that the feature `allow_wallclock_use` must be enabled to use this function.
13535 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
13538 * Blocks until ChannelManager needs to be persisted. Only one listener on
13539 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
13542 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
13545 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
13546 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
13548 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
13551 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
13553 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
13556 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
13558 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
13561 * The keys provider which will give us relevant keys. Some keys will be loaded during
13562 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
13565 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13568 * The keys provider which will give us relevant keys. Some keys will be loaded during
13569 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
13572 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
13575 * The fee_estimator for use in the ChannelManager in the future.
13577 * No calls to the FeeEstimator will be made during deserialization.
13579 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13582 * The fee_estimator for use in the ChannelManager in the future.
13584 * No calls to the FeeEstimator will be made during deserialization.
13586 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
13589 * The chain::Watch for use in the ChannelManager in the future.
13591 * No calls to the chain::Watch will be made during deserialization. It is assumed that
13592 * you have deserialized ChannelMonitors separately and will add them to your
13593 * chain::Watch after deserializing this ChannelManager.
13595 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13598 * The chain::Watch for use in the ChannelManager in the future.
13600 * No calls to the chain::Watch will be made during deserialization. It is assumed that
13601 * you have deserialized ChannelMonitors separately and will add them to your
13602 * chain::Watch after deserializing this ChannelManager.
13604 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
13607 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
13608 * used to broadcast the latest local commitment transactions of channels which must be
13609 * force-closed during deserialization.
13611 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13614 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
13615 * used to broadcast the latest local commitment transactions of channels which must be
13616 * force-closed during deserialization.
13618 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
13621 * The Logger for use in the ChannelManager and which may be used to log information during
13624 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13627 * The Logger for use in the ChannelManager and which may be used to log information during
13630 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
13633 * Default settings used for new channels. Any existing channels will continue to use the
13634 * runtime settings which were stored when the ChannelManager was serialized.
13636 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13639 * Default settings used for new channels. Any existing channels will continue to use the
13640 * runtime settings which were stored when the ChannelManager was serialized.
13642 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
13645 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
13646 * HashMap for you. This is primarily useful for C bindings where it is not practical to
13647 * populate a HashMap directly from C.
13649 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);
13652 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
13654 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
13657 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
13659 void DecodeError_free(struct LDKDecodeError this_obj);
13662 * Creates a copy of the DecodeError
13664 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
13667 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
13669 void Init_free(struct LDKInit this_obj);
13672 * The relevant features which the sender supports
13674 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
13677 * The relevant features which the sender supports
13679 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
13682 * Constructs a new Init given each field
13684 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
13687 * Creates a copy of the Init
13689 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
13692 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
13694 void ErrorMessage_free(struct LDKErrorMessage this_obj);
13697 * The channel ID involved in the error
13699 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
13702 * The channel ID involved in the error
13704 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13707 * A possibly human-readable error description.
13708 * The string should be sanitized before it is used (e.g. emitted to logs
13709 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
13710 * vulnerability in the terminal emulator or the logging subsystem.
13712 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
13715 * A possibly human-readable error description.
13716 * The string should be sanitized before it is used (e.g. emitted to logs
13717 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
13718 * vulnerability in the terminal emulator or the logging subsystem.
13720 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
13723 * Constructs a new ErrorMessage given each field
13725 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
13728 * Creates a copy of the ErrorMessage
13730 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
13733 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
13735 void Ping_free(struct LDKPing this_obj);
13738 * The desired response length
13740 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
13743 * The desired response length
13745 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
13748 * The ping packet size.
13749 * This field is not sent on the wire. byteslen zeros are sent.
13751 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
13754 * The ping packet size.
13755 * This field is not sent on the wire. byteslen zeros are sent.
13757 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
13760 * Constructs a new Ping given each field
13762 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
13765 * Creates a copy of the Ping
13767 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
13770 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
13772 void Pong_free(struct LDKPong this_obj);
13775 * The pong packet size.
13776 * This field is not sent on the wire. byteslen zeros are sent.
13778 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
13781 * The pong packet size.
13782 * This field is not sent on the wire. byteslen zeros are sent.
13784 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
13787 * Constructs a new Pong given each field
13789 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
13792 * Creates a copy of the Pong
13794 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
13797 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
13799 void OpenChannel_free(struct LDKOpenChannel this_obj);
13802 * The genesis hash of the blockchain where the channel is to be opened
13804 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
13807 * The genesis hash of the blockchain where the channel is to be opened
13809 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13812 * A temporary channel ID, until the funding outpoint is announced
13814 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
13817 * A temporary channel ID, until the funding outpoint is announced
13819 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13822 * The channel value
13824 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13827 * The channel value
13829 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13832 * The amount to push to the counterparty as part of the open, in milli-satoshi
13834 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13837 * The amount to push to the counterparty as part of the open, in milli-satoshi
13839 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13842 * The threshold below which outputs on transactions broadcast by sender will be omitted
13844 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13847 * The threshold below which outputs on transactions broadcast by sender will be omitted
13849 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13852 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13854 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13857 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13859 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13862 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13864 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13867 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13869 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13872 * The minimum HTLC size incoming to sender, in milli-satoshi
13874 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13877 * The minimum HTLC size incoming to sender, in milli-satoshi
13879 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13882 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
13884 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13887 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
13889 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
13892 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13894 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13897 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13899 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
13902 * The maximum number of inbound HTLCs towards sender
13904 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13907 * The maximum number of inbound HTLCs towards sender
13909 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
13912 * The sender's key controlling the funding transaction
13914 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13917 * The sender's key controlling the funding transaction
13919 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13922 * Used to derive a revocation key for transactions broadcast by counterparty
13924 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13927 * Used to derive a revocation key for transactions broadcast by counterparty
13929 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13932 * A payment key to sender for transactions broadcast by counterparty
13934 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13937 * A payment key to sender for transactions broadcast by counterparty
13939 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13942 * Used to derive a payment key to sender for transactions broadcast by sender
13944 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13947 * Used to derive a payment key to sender for transactions broadcast by sender
13949 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13952 * Used to derive an HTLC payment key to sender
13954 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13957 * Used to derive an HTLC payment key to sender
13959 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13962 * The first to-be-broadcast-by-sender transaction's per commitment point
13964 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13967 * The first to-be-broadcast-by-sender transaction's per commitment point
13969 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13974 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13979 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
13982 * Creates a copy of the OpenChannel
13984 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
13987 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
13989 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
13992 * A temporary channel ID, until the funding outpoint is announced
13994 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
13997 * A temporary channel ID, until the funding outpoint is announced
13999 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14002 * The threshold below which outputs on transactions broadcast by sender will be omitted
14004 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14007 * The threshold below which outputs on transactions broadcast by sender will be omitted
14009 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
14012 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
14014 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14017 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
14019 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
14022 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
14024 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14027 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
14029 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
14032 * The minimum HTLC size incoming to sender, in milli-satoshi
14034 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14037 * The minimum HTLC size incoming to sender, in milli-satoshi
14039 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
14042 * Minimum depth of the funding transaction before the channel is considered open
14044 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14047 * Minimum depth of the funding transaction before the channel is considered open
14049 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
14052 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
14054 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14057 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
14059 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
14062 * The maximum number of inbound HTLCs towards sender
14064 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14067 * The maximum number of inbound HTLCs towards sender
14069 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
14072 * The sender's key controlling the funding transaction
14074 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14077 * The sender's key controlling the funding transaction
14079 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14082 * Used to derive a revocation key for transactions broadcast by counterparty
14084 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14087 * Used to derive a revocation key for transactions broadcast by counterparty
14089 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14092 * A payment key to sender for transactions broadcast by counterparty
14094 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14097 * A payment key to sender for transactions broadcast by counterparty
14099 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14102 * Used to derive a payment key to sender for transactions broadcast by sender
14104 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14107 * Used to derive a payment key to sender for transactions broadcast by sender
14109 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14112 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
14114 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14117 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
14119 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14122 * The first to-be-broadcast-by-sender transaction's per commitment point
14124 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14127 * The first to-be-broadcast-by-sender transaction's per commitment point
14129 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14132 * Creates a copy of the AcceptChannel
14134 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
14137 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
14139 void FundingCreated_free(struct LDKFundingCreated this_obj);
14142 * A temporary channel ID, until the funding is established
14144 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
14147 * A temporary channel ID, until the funding is established
14149 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14152 * The funding transaction ID
14154 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
14157 * The funding transaction ID
14159 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14162 * The specific output index funding this channel
14164 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
14167 * The specific output index funding this channel
14169 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
14172 * The signature of the channel initiator (funder) on the funding transaction
14174 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
14177 * The signature of the channel initiator (funder) on the funding transaction
14179 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
14182 * Constructs a new FundingCreated given each field
14184 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);
14187 * Creates a copy of the FundingCreated
14189 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
14192 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
14194 void FundingSigned_free(struct LDKFundingSigned this_obj);
14199 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
14204 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14207 * The signature of the channel acceptor (fundee) on the funding transaction
14209 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
14212 * The signature of the channel acceptor (fundee) on the funding transaction
14214 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
14217 * Constructs a new FundingSigned given each field
14219 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
14222 * Creates a copy of the FundingSigned
14224 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
14227 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
14229 void FundingLocked_free(struct LDKFundingLocked this_obj);
14234 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
14239 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14242 * The per-commitment point of the second commitment transaction
14244 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
14247 * The per-commitment point of the second commitment transaction
14249 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14252 * Constructs a new FundingLocked given each field
14254 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
14257 * Creates a copy of the FundingLocked
14259 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
14262 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
14264 void Shutdown_free(struct LDKShutdown this_obj);
14269 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
14274 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14277 * The destination of this peer's funds on closing.
14278 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
14280 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
14283 * The destination of this peer's funds on closing.
14284 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
14286 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
14289 * Constructs a new Shutdown given each field
14291 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
14294 * Creates a copy of the Shutdown
14296 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
14299 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
14301 void ClosingSigned_free(struct LDKClosingSigned this_obj);
14306 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
14311 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14314 * The proposed total fee for the closing transaction
14316 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
14319 * The proposed total fee for the closing transaction
14321 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
14324 * A signature on the closing transaction
14326 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
14329 * A signature on the closing transaction
14331 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
14334 * Constructs a new ClosingSigned given each field
14336 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
14339 * Creates a copy of the ClosingSigned
14341 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
14344 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
14346 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
14351 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
14356 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14361 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
14366 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
14369 * The HTLC value in milli-satoshi
14371 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
14374 * The HTLC value in milli-satoshi
14376 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
14379 * The payment hash, the pre-image of which controls HTLC redemption
14381 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
14384 * The payment hash, the pre-image of which controls HTLC redemption
14386 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14389 * The expiry height of the HTLC
14391 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
14394 * The expiry height of the HTLC
14396 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
14399 * Creates a copy of the UpdateAddHTLC
14401 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
14404 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
14406 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
14411 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
14416 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14421 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
14426 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
14429 * The pre-image of the payment hash, allowing HTLC redemption
14431 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
14434 * The pre-image of the payment hash, allowing HTLC redemption
14436 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14439 * Constructs a new UpdateFulfillHTLC given each field
14441 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
14444 * Creates a copy of the UpdateFulfillHTLC
14446 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
14449 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
14451 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
14456 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
14461 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14466 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
14471 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
14474 * Creates a copy of the UpdateFailHTLC
14476 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
14479 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
14481 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
14486 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
14491 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14496 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
14501 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
14506 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
14511 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
14514 * Creates a copy of the UpdateFailMalformedHTLC
14516 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
14519 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
14521 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
14526 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
14531 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14534 * A signature on the commitment transaction
14536 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
14539 * A signature on the commitment transaction
14541 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
14544 * Signatures on the HTLC transactions
14546 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
14549 * Constructs a new CommitmentSigned given each field
14551 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
14554 * Creates a copy of the CommitmentSigned
14556 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
14559 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
14561 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
14566 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
14571 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14574 * The secret corresponding to the per-commitment point
14576 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
14579 * The secret corresponding to the per-commitment point
14581 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14584 * The next sender-broadcast commitment transaction's per-commitment point
14586 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
14589 * The next sender-broadcast commitment transaction's per-commitment point
14591 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14594 * Constructs a new RevokeAndACK given each field
14596 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);
14599 * Creates a copy of the RevokeAndACK
14601 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
14604 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
14606 void UpdateFee_free(struct LDKUpdateFee this_obj);
14611 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
14616 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14619 * Fee rate per 1000-weight of the transaction
14621 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
14624 * Fee rate per 1000-weight of the transaction
14626 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
14629 * Constructs a new UpdateFee given each field
14631 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
14634 * Creates a copy of the UpdateFee
14636 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
14639 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
14641 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
14644 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
14645 * belonging to the recipient
14647 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
14650 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
14651 * belonging to the recipient
14653 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14656 * The sender's per-commitment point for their current commitment transaction
14658 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
14661 * The sender's per-commitment point for their current commitment transaction
14663 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14666 * Constructs a new DataLossProtect given each field
14668 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
14671 * Creates a copy of the DataLossProtect
14673 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
14676 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
14678 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
14683 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
14688 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14691 * The next commitment number for the sender
14693 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
14696 * The next commitment number for the sender
14698 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
14701 * The next commitment number for the recipient
14703 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
14706 * The next commitment number for the recipient
14708 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
14711 * Creates a copy of the ChannelReestablish
14713 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
14716 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
14718 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
14723 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
14728 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14731 * The short channel ID
14733 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
14736 * The short channel ID
14738 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
14741 * A signature by the node key
14743 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
14746 * A signature by the node key
14748 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
14751 * A signature by the funding key
14753 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
14756 * A signature by the funding key
14758 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
14761 * Constructs a new AnnouncementSignatures given each field
14763 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);
14766 * Creates a copy of the AnnouncementSignatures
14768 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
14771 * Frees any resources used by the NetAddress
14773 void NetAddress_free(struct LDKNetAddress this_ptr);
14776 * Creates a copy of the NetAddress
14778 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
14781 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
14783 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
14786 * Read a Result from a byte array, created by Result_write
14788 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
14791 * Read a NetAddress from a byte array, created by NetAddress_write
14793 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
14796 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
14798 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
14801 * The advertised features
14803 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
14806 * The advertised features
14808 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
14811 * A strictly monotonic announcement counter, with gaps allowed
14813 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
14816 * A strictly monotonic announcement counter, with gaps allowed
14818 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
14821 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
14824 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
14827 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
14830 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14833 * An RGB color for UI purposes
14835 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
14838 * An RGB color for UI purposes
14840 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
14843 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
14846 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
14849 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
14852 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14855 * List of addresses on which this node is reachable
14857 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
14860 * Creates a copy of the UnsignedNodeAnnouncement
14862 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
14865 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
14867 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
14870 * The signature by the node key
14872 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
14875 * The signature by the node key
14877 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14880 * The actual content of the announcement
14882 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
14885 * The actual content of the announcement
14887 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
14890 * Constructs a new NodeAnnouncement given each field
14892 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
14895 * Creates a copy of the NodeAnnouncement
14897 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
14900 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
14902 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
14905 * The advertised channel features
14907 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14910 * The advertised channel features
14912 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
14915 * The genesis hash of the blockchain where the channel is to be opened
14917 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
14920 * The genesis hash of the blockchain where the channel is to be opened
14922 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14925 * The short channel ID
14927 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14930 * The short channel ID
14932 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
14935 * One of the two node_ids which are endpoints of this channel
14937 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14940 * One of the two node_ids which are endpoints of this channel
14942 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14945 * The other of the two node_ids which are endpoints of this channel
14947 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14950 * The other of the two node_ids which are endpoints of this channel
14952 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14955 * The funding key for the first node
14957 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14960 * The funding key for the first node
14962 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14965 * The funding key for the second node
14967 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14970 * The funding key for the second node
14972 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14975 * Creates a copy of the UnsignedChannelAnnouncement
14977 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
14980 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
14982 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
14985 * Authentication of the announcement by the first public node
14987 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14990 * Authentication of the announcement by the first public node
14992 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14995 * Authentication of the announcement by the second public node
14997 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
15000 * Authentication of the announcement by the second public node
15002 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
15005 * Proof of funding UTXO ownership by the first public node
15007 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
15010 * Proof of funding UTXO ownership by the first public node
15012 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
15015 * Proof of funding UTXO ownership by the second public node
15017 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
15020 * Proof of funding UTXO ownership by the second public node
15022 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
15025 * The actual announcement
15027 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
15030 * The actual announcement
15032 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
15035 * Constructs a new ChannelAnnouncement given each field
15037 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);
15040 * Creates a copy of the ChannelAnnouncement
15042 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
15045 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
15047 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
15050 * The genesis hash of the blockchain where the channel is to be opened
15052 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
15055 * The genesis hash of the blockchain where the channel is to be opened
15057 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15060 * The short channel ID
15062 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15065 * The short channel ID
15067 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
15070 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
15072 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15075 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
15077 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
15082 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15087 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
15090 * The number of blocks such that if:
15091 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
15092 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
15093 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
15094 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
15095 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
15096 * forwarding. Note that the HTLC sender is the one who originally sets this value when
15097 * constructing the route.
15099 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15102 * The number of blocks such that if:
15103 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
15104 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
15105 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
15106 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
15107 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
15108 * forwarding. Note that the HTLC sender is the one who originally sets this value when
15109 * constructing the route.
15111 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
15114 * The minimum HTLC size incoming to sender, in milli-satoshi
15116 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15119 * The minimum HTLC size incoming to sender, in milli-satoshi
15121 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
15124 * The base HTLC fee charged by sender, in milli-satoshi
15126 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15129 * The base HTLC fee charged by sender, in milli-satoshi
15131 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
15134 * The amount to fee multiplier, in micro-satoshi
15136 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15139 * The amount to fee multiplier, in micro-satoshi
15141 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
15144 * Creates a copy of the UnsignedChannelUpdate
15146 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
15149 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
15151 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
15154 * A signature of the channel update
15156 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
15159 * A signature of the channel update
15161 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
15164 * The actual channel update
15166 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
15169 * The actual channel update
15171 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
15174 * Constructs a new ChannelUpdate given each field
15176 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
15179 * Creates a copy of the ChannelUpdate
15181 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
15184 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
15186 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
15189 * The genesis hash of the blockchain being queried
15191 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
15194 * The genesis hash of the blockchain being queried
15196 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15199 * The height of the first block for the channel UTXOs being queried
15201 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
15204 * The height of the first block for the channel UTXOs being queried
15206 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15209 * The number of blocks to include in the query results
15211 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
15214 * The number of blocks to include in the query results
15216 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15219 * Constructs a new QueryChannelRange given each field
15221 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
15224 * Creates a copy of the QueryChannelRange
15226 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
15229 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
15231 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
15234 * The genesis hash of the blockchain being queried
15236 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
15239 * The genesis hash of the blockchain being queried
15241 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15244 * The height of the first block in the range of the reply
15246 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
15249 * The height of the first block in the range of the reply
15251 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15254 * The number of blocks included in the range of the reply
15256 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
15259 * The number of blocks included in the range of the reply
15261 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15264 * True when this is the final reply for a query
15266 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
15269 * True when this is the final reply for a query
15271 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
15274 * The short_channel_ids in the channel range
15276 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
15279 * Constructs a new ReplyChannelRange given each field
15281 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);
15284 * Creates a copy of the ReplyChannelRange
15286 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
15289 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
15291 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
15294 * The genesis hash of the blockchain being queried
15296 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
15299 * The genesis hash of the blockchain being queried
15301 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15304 * The short_channel_ids that are being queried
15306 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
15309 * Constructs a new QueryShortChannelIds given each field
15311 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
15314 * Creates a copy of the QueryShortChannelIds
15316 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
15319 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
15321 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
15324 * The genesis hash of the blockchain that was queried
15326 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
15329 * The genesis hash of the blockchain that was queried
15331 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15334 * Indicates if the query recipient maintains up-to-date channel
15335 * information for the chain_hash
15337 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
15340 * Indicates if the query recipient maintains up-to-date channel
15341 * information for the chain_hash
15343 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
15346 * Constructs a new ReplyShortChannelIdsEnd given each field
15348 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
15351 * Creates a copy of the ReplyShortChannelIdsEnd
15353 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
15356 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
15358 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
15361 * The genesis hash of the blockchain for channel and node information
15363 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
15366 * The genesis hash of the blockchain for channel and node information
15368 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15371 * The starting unix timestamp
15373 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
15376 * The starting unix timestamp
15378 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
15381 * The range of information in seconds
15383 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
15386 * The range of information in seconds
15388 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
15391 * Constructs a new GossipTimestampFilter given each field
15393 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
15396 * Creates a copy of the GossipTimestampFilter
15398 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
15401 * Frees any resources used by the ErrorAction
15403 void ErrorAction_free(struct LDKErrorAction this_ptr);
15406 * Creates a copy of the ErrorAction
15408 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
15411 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
15413 void LightningError_free(struct LDKLightningError this_obj);
15416 * A human-readable message describing the error
15418 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
15421 * A human-readable message describing the error
15423 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
15426 * The action which should be taken against the offending peer.
15428 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
15431 * The action which should be taken against the offending peer.
15433 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
15436 * Constructs a new LightningError given each field
15438 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
15441 * Creates a copy of the LightningError
15443 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
15446 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
15448 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
15451 * update_add_htlc messages which should be sent
15453 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
15456 * update_fulfill_htlc messages which should be sent
15458 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
15461 * update_fail_htlc messages which should be sent
15463 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
15466 * update_fail_malformed_htlc messages which should be sent
15468 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
15471 * An update_fee message which should be sent
15473 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
15476 * An update_fee message which should be sent
15478 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
15481 * Finally, the commitment_signed message which should be sent
15483 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
15486 * Finally, the commitment_signed message which should be sent
15488 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
15491 * Constructs a new CommitmentUpdate given each field
15493 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);
15496 * Creates a copy of the CommitmentUpdate
15498 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
15501 * Frees any resources used by the HTLCFailChannelUpdate
15503 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
15506 * Creates a copy of the HTLCFailChannelUpdate
15508 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
15511 * Calls the free function if one is set
15513 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
15516 * Calls the free function if one is set
15518 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
15521 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
15523 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
15526 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
15528 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
15531 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
15533 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
15536 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
15538 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
15541 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
15543 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
15546 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
15548 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
15551 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
15553 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
15556 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
15558 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
15561 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
15563 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
15566 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
15568 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
15571 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
15573 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
15576 * Read a FundingCreated from a byte array, created by FundingCreated_write
15578 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
15581 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
15583 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
15586 * Read a FundingSigned from a byte array, created by FundingSigned_write
15588 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
15591 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
15593 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
15596 * Read a FundingLocked from a byte array, created by FundingLocked_write
15598 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
15601 * Serialize the Init object into a byte array which can be read by Init_read
15603 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
15606 * Read a Init from a byte array, created by Init_write
15608 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
15611 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
15613 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
15616 * Read a OpenChannel from a byte array, created by OpenChannel_write
15618 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
15621 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
15623 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
15626 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
15628 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
15631 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
15633 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
15636 * Read a Shutdown from a byte array, created by Shutdown_write
15638 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
15641 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
15643 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
15646 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
15648 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
15651 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
15653 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
15656 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
15658 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
15661 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
15663 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
15666 * Read a UpdateFee from a byte array, created by UpdateFee_write
15668 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
15671 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
15673 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
15676 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
15678 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
15681 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
15683 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
15686 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
15688 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
15691 * Serialize the Ping object into a byte array which can be read by Ping_read
15693 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
15696 * Read a Ping from a byte array, created by Ping_write
15698 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
15701 * Serialize the Pong object into a byte array which can be read by Pong_read
15703 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
15706 * Read a Pong from a byte array, created by Pong_write
15708 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
15711 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
15713 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
15716 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
15718 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
15721 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
15723 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
15726 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
15728 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
15731 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
15733 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
15736 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
15738 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
15741 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
15743 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
15746 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
15748 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
15751 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
15753 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
15756 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
15758 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
15761 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
15763 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
15766 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
15768 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
15771 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
15773 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
15776 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
15778 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
15781 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
15783 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
15786 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
15788 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
15791 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
15793 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
15796 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
15798 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
15801 *\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
15803 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
15806 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
15808 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
15811 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
15813 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
15816 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
15818 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
15821 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
15823 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
15826 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
15828 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
15831 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
15833 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
15836 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
15838 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
15841 * Constructs a new IgnoringMessageHandler given each field
15843 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
15846 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
15847 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
15849 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
15852 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
15853 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
15855 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
15858 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
15860 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
15863 * Constructs a new ErroringMessageHandler
15865 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
15868 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
15869 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
15871 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
15874 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
15875 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
15877 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
15880 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
15882 void MessageHandler_free(struct LDKMessageHandler this_obj);
15885 * A message handler which handles messages specific to channels. Usually this is just a
15886 * ChannelManager object or a ErroringMessageHandler.
15888 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
15891 * A message handler which handles messages specific to channels. Usually this is just a
15892 * ChannelManager object or a ErroringMessageHandler.
15894 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
15897 * A message handler which handles messages updating our knowledge of the network channel
15898 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
15900 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
15903 * A message handler which handles messages updating our knowledge of the network channel
15904 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
15906 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
15909 * Constructs a new MessageHandler given each field
15911 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
15914 * Creates a copy of a SocketDescriptor
15916 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
15919 * Calls the free function if one is set
15921 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
15924 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
15926 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
15929 * Used to indicate that we probably can't make any future connections to this peer, implying
15930 * we should go ahead and force-close any channels we have with it.
15932 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
15935 * Used to indicate that we probably can't make any future connections to this peer, implying
15936 * we should go ahead and force-close any channels we have with it.
15938 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
15941 * Constructs a new PeerHandleError given each field
15943 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
15946 * Creates a copy of the PeerHandleError
15948 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
15951 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
15953 void PeerManager_free(struct LDKPeerManager this_obj);
15956 * Constructs a new PeerManager with the given message handlers and node_id secret key
15957 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
15958 * cryptographically secure random bytes.
15960 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);
15963 * Get the list of node ids for peers which have completed the initial handshake.
15965 * For outbound connections, this will be the same as the their_node_id parameter passed in to
15966 * new_outbound_connection, however entries will only appear once the initial handshake has
15967 * completed and we are sure the remote peer has the private key for the given node_id.
15969 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
15972 * Indicates a new outbound connection has been established to a node with the given node_id.
15973 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
15974 * descriptor but must disconnect the connection immediately.
15976 * Returns a small number of bytes to send to the remote node (currently always 50).
15978 * Panics if descriptor is duplicative with some other descriptor which has not yet had a
15979 * socket_disconnected().
15981 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);
15984 * Indicates a new inbound connection has been established.
15986 * May refuse the connection by returning an Err, but will never write bytes to the remote end
15987 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
15988 * call socket_disconnected for the new descriptor but must disconnect the connection
15991 * Panics if descriptor is duplicative with some other descriptor which has not yet had
15992 * socket_disconnected called.
15994 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
15997 * Indicates that there is room to write data to the given socket descriptor.
15999 * May return an Err to indicate that the connection should be closed.
16001 * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
16002 * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
16003 * invariants around calling write_buffer_space_avail in case a write did not fully complete
16004 * must still hold - be ready to call write_buffer_space_avail again if a write call generated
16005 * here isn't sufficient! Panics if the descriptor was not previously registered in a
16006 * new_\\*_connection event.
16008 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
16011 * Indicates that data was read from the given socket descriptor.
16013 * May return an Err to indicate that the connection should be closed.
16015 * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
16016 * Thus, however, you almost certainly want to call process_events() after any read_event to
16017 * generate send_data calls to handle responses.
16019 * If Ok(true) is returned, further read_events should not be triggered until a send_data call
16020 * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
16022 * Panics if the descriptor was not previously registered in a new_*_connection event.
16024 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);
16027 * Checks for any events generated by our handlers and processes them. Includes sending most
16028 * response messages as well as messages generated by calls to handler functions directly (eg
16029 * functions like ChannelManager::process_pending_htlc_forward or send_payment).
16031 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
16034 * Indicates that the given socket descriptor's connection is now closed.
16036 * This must only be called if the socket has been disconnected by the peer or your own
16037 * decision to disconnect it and must NOT be called in any case where other parts of this
16038 * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
16041 * Panics if the descriptor was not previously registered in a successful new_*_connection event.
16043 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
16046 * Disconnect a peer given its node id.
16048 * Set no_connection_possible to true to prevent any further connection with this peer,
16049 * force-closing any channels we have with it.
16051 * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer,
16052 * so be careful about reentrancy issues.
16054 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
16057 * This function should be called roughly once every 30 seconds.
16058 * It will send pings to each peer and disconnect those which did not respond to the last round of pings.
16059 * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
16061 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
16064 * Build the commitment secret from the seed and the commitment number
16066 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
16069 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
16070 * from the base secret and the per_commitment_point.
16072 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
16073 * generated (ie our own).
16075 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
16078 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
16079 * from the base point and the per_commitment_key. This is the public equivalent of
16080 * derive_private_key - using only public keys to derive a public key instead of private keys.
16082 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
16083 * generated (ie our own).
16085 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
16088 * Derives a per-commitment-transaction revocation key from its constituent parts.
16090 * Only the cheating participant owns a valid witness to propagate a revoked
16091 * commitment transaction, thus per_commitment_secret always come from cheater
16092 * and revocation_base_secret always come from punisher, which is the broadcaster
16093 * of the transaction spending with this key knowledge.
16095 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
16096 * generated (ie our own).
16098 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
16101 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
16102 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
16103 * public key instead of private keys.
16105 * Only the cheating participant owns a valid witness to propagate a revoked
16106 * commitment transaction, thus per_commitment_point always come from cheater
16107 * and revocation_base_point always come from punisher, which is the broadcaster
16108 * of the transaction spending with this key knowledge.
16110 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
16111 * generated (ie our own).
16113 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
16116 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
16118 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
16121 * The broadcaster's per-commitment public key which was used to derive the other keys.
16123 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16126 * The broadcaster's per-commitment public key which was used to derive the other keys.
16128 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16131 * The revocation key which is used to allow the broadcaster of the commitment
16132 * transaction to provide their counterparty the ability to punish them if they broadcast
16135 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16138 * The revocation key which is used to allow the broadcaster of the commitment
16139 * transaction to provide their counterparty the ability to punish them if they broadcast
16142 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16145 * Broadcaster's HTLC Key
16147 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16150 * Broadcaster's HTLC Key
16152 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16155 * Countersignatory's HTLC Key
16157 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16160 * Countersignatory's HTLC Key
16162 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16165 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
16167 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16170 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
16172 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16175 * Constructs a new TxCreationKeys given each field
16177 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);
16180 * Creates a copy of the TxCreationKeys
16182 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
16185 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
16187 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
16190 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
16192 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
16195 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
16197 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
16200 * The public key which is used to sign all commitment transactions, as it appears in the
16201 * on-chain channel lock-in 2-of-2 multisig output.
16203 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16206 * The public key which is used to sign all commitment transactions, as it appears in the
16207 * on-chain channel lock-in 2-of-2 multisig output.
16209 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16212 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
16213 * revocation keys. This is combined with the per-commitment-secret generated by the
16214 * counterparty to create a secret which the counterparty can reveal to revoke previous
16217 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16220 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
16221 * revocation keys. This is combined with the per-commitment-secret generated by the
16222 * counterparty to create a secret which the counterparty can reveal to revoke previous
16225 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16228 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
16229 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
16230 * static across every commitment transaction.
16232 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16235 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
16236 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
16237 * static across every commitment transaction.
16239 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16242 * The base point which is used (with derive_public_key) to derive a per-commitment payment
16243 * public key which receives non-HTLC-encumbered funds which are only available for spending
16244 * after some delay (or can be claimed via the revocation path).
16246 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16249 * The base point which is used (with derive_public_key) to derive a per-commitment payment
16250 * public key which receives non-HTLC-encumbered funds which are only available for spending
16251 * after some delay (or can be claimed via the revocation path).
16253 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16256 * The base point which is used (with derive_public_key) to derive a per-commitment public key
16257 * which is used to encumber HTLC-in-flight outputs.
16259 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16262 * The base point which is used (with derive_public_key) to derive a per-commitment public key
16263 * which is used to encumber HTLC-in-flight outputs.
16265 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16268 * Constructs a new ChannelPublicKeys given each field
16270 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);
16273 * Creates a copy of the ChannelPublicKeys
16275 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
16278 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
16280 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
16283 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
16285 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
16288 * Create per-state keys from channel base points and the per-commitment point.
16289 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
16291 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);
16294 * Generate per-state keys from channel static keys.
16295 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
16297 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);
16300 * A script either spendable by the revocation
16301 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
16302 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
16304 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
16307 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
16309 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
16312 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
16313 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
16314 * need to compare this value to whether the commitment transaction in question is that of
16315 * the counterparty or our own.
16317 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
16320 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
16321 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
16322 * need to compare this value to whether the commitment transaction in question is that of
16323 * the counterparty or our own.
16325 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
16328 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
16329 * this divided by 1000.
16331 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
16334 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
16335 * this divided by 1000.
16337 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
16340 * The CLTV lock-time at which this HTLC expires.
16342 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
16345 * The CLTV lock-time at which this HTLC expires.
16347 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
16350 * The hash of the preimage which unlocks this HTLC.
16352 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
16355 * The hash of the preimage which unlocks this HTLC.
16357 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16360 * The position within the commitment transactions' outputs. This may be None if the value is
16361 * below the dust limit (in which case no output appears in the commitment transaction and the
16362 * value is spent to additional transaction fees).
16364 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
16367 * The position within the commitment transactions' outputs. This may be None if the value is
16368 * below the dust limit (in which case no output appears in the commitment transaction and the
16369 * value is spent to additional transaction fees).
16371 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
16374 * Constructs a new HTLCOutputInCommitment given each field
16376 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);
16379 * Creates a copy of the HTLCOutputInCommitment
16381 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
16384 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
16386 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
16389 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
16391 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
16394 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
16395 * does not need to have its previous_output_index filled.
16397 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
16400 * Gets the redeemscript for a funding output from the two funding public keys.
16401 * Note that the order of funding public keys does not matter.
16403 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
16406 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
16407 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
16408 * transaction which needs signing, and can be used to construct an HTLC transaction which is
16409 * broadcastable given a counterparty HTLC signature.
16411 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
16412 * commitment transaction).
16414 struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[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);
16417 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
16419 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
16422 * Holder public keys
16424 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16427 * Holder public keys
16429 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
16432 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
16434 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16437 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
16439 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
16442 * Whether the holder is the initiator of this channel.
16443 * This is an input to the commitment number obscure factor computation.
16445 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16448 * Whether the holder is the initiator of this channel.
16449 * This is an input to the commitment number obscure factor computation.
16451 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
16454 * The late-bound counterparty channel transaction parameters.
16455 * These parameters are populated at the point in the protocol where the counterparty provides them.
16457 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16460 * The late-bound counterparty channel transaction parameters.
16461 * These parameters are populated at the point in the protocol where the counterparty provides them.
16463 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
16466 * The late-bound funding outpoint
16468 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16471 * The late-bound funding outpoint
16473 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
16476 * Constructs a new ChannelTransactionParameters given each field
16478 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);
16481 * Creates a copy of the ChannelTransactionParameters
16483 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
16486 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
16488 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
16491 * Counter-party public keys
16493 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
16496 * Counter-party public keys
16498 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
16501 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
16503 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
16506 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
16508 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
16511 * Constructs a new CounterpartyChannelTransactionParameters given each field
16513 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
16516 * Creates a copy of the CounterpartyChannelTransactionParameters
16518 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
16521 * Whether the late bound parameters are populated.
16523 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
16526 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
16527 * given that the holder is the broadcaster.
16529 * self.is_populated() must be true before calling this function.
16531 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
16534 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
16535 * given that the counterparty is the broadcaster.
16537 * self.is_populated() must be true before calling this function.
16539 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
16542 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
16544 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
16547 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
16549 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
16552 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
16554 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
16557 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
16559 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
16562 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
16564 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
16567 * Get the channel pubkeys for the broadcaster
16569 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16572 * Get the channel pubkeys for the countersignatory
16574 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16577 * Get the contest delay applicable to the transactions.
16578 * Note that the contest delay was selected by the countersignatory.
16580 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16583 * Whether the channel is outbound from the broadcaster.
16585 * The boolean representing the side that initiated the channel is
16586 * an input to the commitment number obscure factor computation.
16588 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16591 * The funding outpoint
16593 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16596 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
16598 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
16601 * Our counterparty's signature for the transaction
16603 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
16606 * Our counterparty's signature for the transaction
16608 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
16611 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
16613 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
16616 * Creates a copy of the HolderCommitmentTransaction
16618 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
16621 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
16623 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
16626 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
16628 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
16631 * Create a new holder transaction with the given counterparty signatures.
16632 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
16634 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);
16637 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
16639 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
16642 * The commitment transaction
16644 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
16647 * The commitment transaction
16649 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
16652 * The txid for the commitment transaction.
16654 * This is provided as a performance optimization, instead of calling transaction.txid()
16657 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
16660 * The txid for the commitment transaction.
16662 * This is provided as a performance optimization, instead of calling transaction.txid()
16665 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16668 * Constructs a new BuiltCommitmentTransaction given each field
16670 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
16673 * Creates a copy of the BuiltCommitmentTransaction
16675 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
16678 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
16680 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
16683 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
16685 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
16688 * Get the SIGHASH_ALL sighash value of the transaction.
16690 * This can be used to verify a signature.
16692 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);
16695 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
16696 * because we are about to broadcast a holder transaction.
16698 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);
16701 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
16703 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
16706 * Creates a copy of the CommitmentTransaction
16708 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
16711 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
16713 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
16716 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
16718 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
16721 * The backwards-counting commitment number
16723 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16726 * The value to be sent to the broadcaster
16728 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16731 * The value to be sent to the counterparty
16733 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16736 * The feerate paid per 1000-weight-unit in this commitment transaction.
16738 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16741 * Trust our pre-built transaction and derived transaction creation public keys.
16743 * Applies a wrapper which allows access to these fields.
16745 * This should only be used if you fully trust the builder of this object. It should not
16746 *\tbe used by an external signer - instead use the verify function.
16748 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16751 * Verify our pre-built transaction and derived transaction creation public keys.
16753 * Applies a wrapper which allows access to these fields.
16755 * An external validating signer must call this method before signing
16756 * or using the built transaction.
16758 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);
16761 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
16763 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
16766 * The transaction ID of the built Bitcoin transaction
16768 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
16771 * The pre-built Bitcoin commitment transaction
16773 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
16776 * The pre-calculated transaction creation public keys.
16778 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
16781 * Get a signature for each HTLC which was included in the commitment transaction (ie for
16782 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
16784 * The returned Vec has one entry for each HTLC, and in the same order.
16786 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);
16789 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
16790 * shared secret first. This prevents on-chain observers from discovering how many commitment
16791 * transactions occurred in a channel before it was closed.
16793 * This function gets the shared secret from relevant channel public keys and can be used to
16794 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
16796 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
16799 * Checks if two InitFeaturess contain equal inner contents.
16800 * This ignores pointers and is_owned flags and looks at the values in fields.
16801 * Two objects with NULL inner values will be considered "equal" here.
16803 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
16806 * Checks if two NodeFeaturess contain equal inner contents.
16807 * This ignores pointers and is_owned flags and looks at the values in fields.
16808 * Two objects with NULL inner values will be considered "equal" here.
16810 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
16813 * Checks if two ChannelFeaturess contain equal inner contents.
16814 * This ignores pointers and is_owned flags and looks at the values in fields.
16815 * Two objects with NULL inner values will be considered "equal" here.
16817 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
16820 * Checks if two InvoiceFeaturess contain equal inner contents.
16821 * This ignores pointers and is_owned flags and looks at the values in fields.
16822 * Two objects with NULL inner values will be considered "equal" here.
16824 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
16827 * Creates a copy of the InitFeatures
16829 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
16832 * Creates a copy of the NodeFeatures
16834 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
16837 * Creates a copy of the ChannelFeatures
16839 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
16842 * Creates a copy of the InvoiceFeatures
16844 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
16847 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
16849 void InitFeatures_free(struct LDKInitFeatures this_obj);
16852 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
16854 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
16857 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
16859 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
16862 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
16864 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
16867 * Create a blank Features with no features set
16869 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
16872 * Creates a Features with the bits set which are known by the implementation
16874 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
16877 * Create a blank Features with no features set
16879 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
16882 * Creates a Features with the bits set which are known by the implementation
16884 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
16887 * Create a blank Features with no features set
16889 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
16892 * Creates a Features with the bits set which are known by the implementation
16894 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
16897 * Create a blank Features with no features set
16899 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
16902 * Creates a Features with the bits set which are known by the implementation
16904 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
16907 * Returns whether the `payment_secret` feature is supported.
16909 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
16912 * Returns whether the `payment_secret` feature is supported.
16914 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
16917 * Returns whether the `payment_secret` feature is supported.
16919 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
16922 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
16924 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
16927 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
16929 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
16932 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
16934 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
16937 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
16939 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
16942 * Read a InitFeatures from a byte array, created by InitFeatures_write
16944 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
16947 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
16949 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
16952 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
16954 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
16957 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
16959 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
16962 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
16964 void RouteHop_free(struct LDKRouteHop this_obj);
16967 * The node_id of the node at this hop.
16969 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16972 * The node_id of the node at this hop.
16974 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16977 * The node_announcement features of the node at this hop. For the last hop, these may be
16978 * amended to match the features present in the invoice this node generated.
16980 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16983 * The node_announcement features of the node at this hop. For the last hop, these may be
16984 * amended to match the features present in the invoice this node generated.
16986 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
16989 * The channel that should be used from the previous hop to reach this node.
16991 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16994 * The channel that should be used from the previous hop to reach this node.
16996 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
16999 * The channel_announcement features of the channel that should be used from the previous hop
17000 * to reach this node.
17002 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
17005 * The channel_announcement features of the channel that should be used from the previous hop
17006 * to reach this node.
17008 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
17011 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
17012 * For the last hop, this should be the full value of the payment (might be more than
17013 * requested if we had to match htlc_minimum_msat).
17015 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
17018 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
17019 * For the last hop, this should be the full value of the payment (might be more than
17020 * requested if we had to match htlc_minimum_msat).
17022 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
17025 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
17026 * expected at the destination, in excess of the current block height.
17028 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
17031 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
17032 * expected at the destination, in excess of the current block height.
17034 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
17037 * Constructs a new RouteHop given each field
17039 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);
17042 * Creates a copy of the RouteHop
17044 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
17047 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
17049 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
17052 * Read a RouteHop from a byte array, created by RouteHop_write
17054 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
17057 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
17059 void Route_free(struct LDKRoute this_obj);
17062 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
17063 * last RouteHop in each path must be the same.
17064 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
17065 * destination. Thus, this must always be at least length one. While the maximum length of any
17066 * given path is variable, keeping the length of any path to less than 20 should currently
17067 * ensure it is viable.
17069 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
17072 * Constructs a new Route given each field
17074 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
17077 * Creates a copy of the Route
17079 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
17082 * Serialize the Route object into a byte array which can be read by Route_read
17084 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
17087 * Read a Route from a byte array, created by Route_write
17089 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
17092 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
17094 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
17097 * The node_id of the non-target end of the route
17099 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17102 * The node_id of the non-target end of the route
17104 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17107 * The short_channel_id of this channel
17109 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17112 * The short_channel_id of this channel
17114 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
17117 * The fees which must be paid to use this channel
17119 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17122 * The fees which must be paid to use this channel
17124 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
17127 * The difference in CLTV values between this node and the next node.
17129 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17132 * The difference in CLTV values between this node and the next node.
17134 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
17137 * The minimum value, in msat, which must be relayed to the next hop.
17139 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17142 * The minimum value, in msat, which must be relayed to the next hop.
17144 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
17147 * The maximum value in msat available for routing with a single HTLC.
17149 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17152 * The maximum value in msat available for routing with a single HTLC.
17154 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
17157 * Constructs a new RouteHintHop given each field
17159 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);
17162 * Checks if two RouteHintHops contain equal inner contents.
17163 * This ignores pointers and is_owned flags and looks at the values in fields.
17164 * Two objects with NULL inner values will be considered "equal" here.
17166 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
17169 * Creates a copy of the RouteHintHop
17171 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
17174 * Gets a route from us (payer) to the given target node (payee).
17176 * If the payee provided features in their invoice, they should be provided via payee_features.
17177 * Without this, MPP will only be used if the payee's features are available in the network graph.
17179 * Extra routing hops between known nodes and the target will be used if they are included in
17182 * If some channels aren't announced, it may be useful to fill in a first_hops with the
17183 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
17184 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
17185 * in first_hops will be used.
17187 * Panics if first_hops contains channels without short_channel_ids
17188 * (ChannelManager::list_usable_channels will never include such channels).
17190 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
17191 * equal), however the enabled/disabled bit on such channels as well as the
17192 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
17194 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);
17197 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
17199 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
17202 * Creates a copy of the NetworkGraph
17204 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
17207 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
17209 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
17212 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
17214 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
17217 * Creates a new tracker of the actual state of the network of channels and nodes,
17218 * assuming a fresh network graph.
17219 * Chain monitor is used to make sure announced channels exist on-chain,
17220 * channel data is correct, and that the announcement is signed with
17221 * channel owners' keys.
17223 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
17226 * Creates a new tracker of the actual state of the network of channels and nodes,
17227 * assuming an existing Network Graph.
17229 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
17232 * Adds a provider used to check new announcements. Does not affect
17233 * existing announcements unless they are updated.
17234 * Add, update or remove the provider would replace the current one.
17236 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
17239 * Take a read lock on the network_graph and return it in the C-bindings
17240 * newtype helper. This is likely only useful when called via the C
17241 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
17244 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
17247 * Get a reference to the NetworkGraph which this read-lock contains.
17249 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
17252 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
17253 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
17255 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
17258 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
17259 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
17261 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
17264 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
17266 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
17269 * When the last update to the channel direction was issued.
17270 * Value is opaque, as set in the announcement.
17272 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17275 * When the last update to the channel direction was issued.
17276 * Value is opaque, as set in the announcement.
17278 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
17281 * Whether the channel can be currently used for payments (in this one direction).
17283 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17286 * Whether the channel can be currently used for payments (in this one direction).
17288 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
17291 * The difference in CLTV values that you must have when routing through this channel.
17293 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17296 * The difference in CLTV values that you must have when routing through this channel.
17298 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
17301 * The minimum value, which must be relayed to the next hop via the channel
17303 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17306 * The minimum value, which must be relayed to the next hop via the channel
17308 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
17311 * The maximum value which may be relayed to the next hop via the channel.
17313 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17316 * The maximum value which may be relayed to the next hop via the channel.
17318 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
17321 * Fees charged when the channel is used for routing
17323 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17326 * Fees charged when the channel is used for routing
17328 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
17331 * Most recent update for the channel received from the network
17332 * Mostly redundant with the data we store in fields explicitly.
17333 * Everything else is useful only for sending out for initial routing sync.
17334 * Not stored if contains excess data to prevent DoS.
17336 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17339 * Most recent update for the channel received from the network
17340 * Mostly redundant with the data we store in fields explicitly.
17341 * Everything else is useful only for sending out for initial routing sync.
17342 * Not stored if contains excess data to prevent DoS.
17344 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
17347 * Constructs a new DirectionalChannelInfo given each field
17349 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);
17352 * Creates a copy of the DirectionalChannelInfo
17354 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
17357 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
17359 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
17362 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
17364 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
17367 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
17369 void ChannelInfo_free(struct LDKChannelInfo this_obj);
17372 * Protocol features of a channel communicated during its announcement
17374 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17377 * Protocol features of a channel communicated during its announcement
17379 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
17382 * Source node of the first direction of a channel
17384 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17387 * Source node of the first direction of a channel
17389 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17392 * Details about the first direction of a channel
17394 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17397 * Details about the first direction of a channel
17399 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
17402 * Source node of the second direction of a channel
17404 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17407 * Source node of the second direction of a channel
17409 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17412 * Details about the second direction of a channel
17414 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17417 * Details about the second direction of a channel
17419 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
17422 * The channel capacity as seen on-chain, if chain lookup is available.
17424 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17427 * The channel capacity as seen on-chain, if chain lookup is available.
17429 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
17432 * An initial announcement of the channel
17433 * Mostly redundant with the data we store in fields explicitly.
17434 * Everything else is useful only for sending out for initial routing sync.
17435 * Not stored if contains excess data to prevent DoS.
17437 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17440 * An initial announcement of the channel
17441 * Mostly redundant with the data we store in fields explicitly.
17442 * Everything else is useful only for sending out for initial routing sync.
17443 * Not stored if contains excess data to prevent DoS.
17445 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
17448 * Constructs a new ChannelInfo given each field
17450 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);
17453 * Creates a copy of the ChannelInfo
17455 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
17458 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
17460 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
17463 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
17465 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
17468 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
17470 void RoutingFees_free(struct LDKRoutingFees this_obj);
17473 * Flat routing fee in satoshis
17475 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
17478 * Flat routing fee in satoshis
17480 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
17483 * Liquidity-based routing fee in millionths of a routed amount.
17484 * In other words, 10000 is 1%.
17486 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
17489 * Liquidity-based routing fee in millionths of a routed amount.
17490 * In other words, 10000 is 1%.
17492 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
17495 * Constructs a new RoutingFees given each field
17497 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
17500 * Checks if two RoutingFeess contain equal inner contents.
17501 * This ignores pointers and is_owned flags and looks at the values in fields.
17502 * Two objects with NULL inner values will be considered "equal" here.
17504 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
17507 * Creates a copy of the RoutingFees
17509 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
17512 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
17514 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
17517 * Read a RoutingFees from a byte array, created by RoutingFees_write
17519 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
17522 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
17524 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
17527 * Protocol features the node announced support for
17529 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
17532 * Protocol features the node announced support for
17534 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
17537 * When the last known update to the node state was issued.
17538 * Value is opaque, as set in the announcement.
17540 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
17543 * When the last known update to the node state was issued.
17544 * Value is opaque, as set in the announcement.
17546 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
17549 * Color assigned to the node
17551 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
17554 * Color assigned to the node
17556 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
17559 * Moniker assigned to the node.
17560 * May be invalid or malicious (eg control chars),
17561 * should not be exposed to the user.
17563 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
17566 * Moniker assigned to the node.
17567 * May be invalid or malicious (eg control chars),
17568 * should not be exposed to the user.
17570 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
17573 * Internet-level addresses via which one can connect to the node
17575 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
17578 * An initial announcement of the node
17579 * Mostly redundant with the data we store in fields explicitly.
17580 * Everything else is useful only for sending out for initial routing sync.
17581 * Not stored if contains excess data to prevent DoS.
17583 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
17586 * An initial announcement of the node
17587 * Mostly redundant with the data we store in fields explicitly.
17588 * Everything else is useful only for sending out for initial routing sync.
17589 * Not stored if contains excess data to prevent DoS.
17591 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
17594 * Constructs a new NodeAnnouncementInfo given each field
17596 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);
17599 * Creates a copy of the NodeAnnouncementInfo
17601 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
17604 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
17606 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
17609 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
17611 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
17614 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
17616 void NodeInfo_free(struct LDKNodeInfo this_obj);
17619 * All valid channels a node has announced
17621 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
17624 * Lowest fees enabling routing via any of the enabled, known channels to a node.
17625 * The two fields (flat and proportional fee) are independent,
17626 * meaning they don't have to refer to the same channel.
17628 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
17631 * Lowest fees enabling routing via any of the enabled, known channels to a node.
17632 * The two fields (flat and proportional fee) are independent,
17633 * meaning they don't have to refer to the same channel.
17635 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
17638 * More information about a node from node_announcement.
17639 * Optional because we store a Node entry after learning about it from
17640 * a channel announcement, but before receiving a node announcement.
17642 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
17645 * More information about a node from node_announcement.
17646 * Optional because we store a Node entry after learning about it from
17647 * a channel announcement, but before receiving a node announcement.
17649 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
17652 * Constructs a new NodeInfo given each field
17654 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
17657 * Creates a copy of the NodeInfo
17659 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
17662 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
17664 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
17667 * Read a NodeInfo from a byte array, created by NodeInfo_write
17669 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
17672 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
17674 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
17677 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
17679 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
17682 * Creates a new, empty, network graph.
17684 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
17687 * For an already known node (from channel announcements), update its stored properties from a
17688 * given node announcement.
17690 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
17691 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
17692 * routing messages from a source using a protocol other than the lightning P2P protocol.
17694 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
17697 * For an already known node (from channel announcements), update its stored properties from a
17698 * given node announcement without verifying the associated signatures. Because we aren't
17699 * given the associated signatures here we cannot relay the node announcement to any of our
17702 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
17705 * Store or update channel info from a channel announcement.
17707 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
17708 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
17709 * routing messages from a source using a protocol other than the lightning P2P protocol.
17711 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
17712 * the corresponding UTXO exists on chain and is correctly-formatted.
17714 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);
17717 * Store or update channel info from a channel announcement without verifying the associated
17718 * signatures. Because we aren't given the associated signatures here we cannot relay the
17719 * channel announcement to any of our peers.
17721 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
17722 * the corresponding UTXO exists on chain and is correctly-formatted.
17724 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);
17727 * Close a channel if a corresponding HTLC fail was sent.
17728 * If permanent, removes a channel from the local storage.
17729 * May cause the removal of nodes too, if this was their last channel.
17730 * If not permanent, makes channels unavailable for routing.
17732 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
17735 * For an already known (from announcement) channel, update info about one of the directions
17738 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
17739 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
17740 * routing messages from a source using a protocol other than the lightning P2P protocol.
17742 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
17745 * For an already known (from announcement) channel, update info about one of the directions
17746 * of the channel without verifying the associated signatures. Because we aren't given the
17747 * associated signatures here we cannot relay the channel update to any of our peers.
17749 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
17752 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
17754 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
17757 * Initialize a new FilesystemPersister and set the path to the individual channels'
17760 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
17763 * Get the directory which was provided when this persister was initialized.
17765 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
17768 * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
17769 * initialization, within a file called \"manager\".
17771 MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKStr data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
17774 * Read `ChannelMonitor`s from disk.
17776 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
17779 * Constructs a new Persist which calls the relevant methods on this_arg.
17780 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
17782 struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
17785 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
17787 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
17790 * Calls the free function if one is set
17792 void ChannelManagerPersister_free(struct LDKChannelManagerPersister this_ptr);
17795 * Start a background thread that takes care of responsibilities enumerated in the top-level
17798 * If `persist_manager` returns an error, then this thread will return said error (and
17799 * `start()` will need to be called again to restart the `BackgroundProcessor`). Users should
17800 * wait on [`thread_handle`]'s `join()` method to be able to tell if and when an error is
17801 * returned, or implement `persist_manager` such that an error is never returned to the
17802 * `BackgroundProcessor`
17804 * `persist_manager` is responsible for writing out the [`ChannelManager`] to disk, and/or
17805 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
17806 * [`ChannelManager`]. See [`FilesystemPersister::persist_manager`] for Rust-Lightning's
17807 * provided implementation.
17809 * [`thread_handle`]: BackgroundProcessor::thread_handle
17810 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
17811 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
17812 * [`FilesystemPersister::persist_manager`]: lightning_persister::FilesystemPersister::persist_manager
17814 MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKChannelManagerPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger);
17817 * Stop `BackgroundProcessor`'s thread.
17819 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
17822 * **Call this function on startup to ensure that all assumptions about the platform are valid.**
17824 * Unfortunately we have to make assumptions about the upper bounds of the `SystemTime` type on
17825 * your platform which we can't fully verify at compile time and which isn't part of it's contract.
17826 * To our best knowledge our assumptions hold for all platforms officially supported by rust, but
17827 * since this check is fast we recommend to do it anyway.
17829 * If this function fails this is considered a bug. Please open an issue describing your
17830 * platform and stating your current system time.
17833 * If the check fails this function panics. By calling this function on startup you ensure that
17834 * this wont happen at an arbitrary later point in time.
17836 void check_platform(void);
17839 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
17841 void Invoice_free(struct LDKInvoice this_obj);
17844 * Checks if two Invoices contain equal inner contents.
17845 * This ignores pointers and is_owned flags and looks at the values in fields.
17846 * Two objects with NULL inner values will be considered "equal" here.
17848 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
17851 * Creates a copy of the Invoice
17853 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
17856 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
17858 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
17861 * Checks if two SignedRawInvoices contain equal inner contents.
17862 * This ignores pointers and is_owned flags and looks at the values in fields.
17863 * Two objects with NULL inner values will be considered "equal" here.
17865 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
17868 * Creates a copy of the SignedRawInvoice
17870 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
17873 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
17875 void RawInvoice_free(struct LDKRawInvoice this_obj);
17880 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
17885 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
17888 * Checks if two RawInvoices contain equal inner contents.
17889 * This ignores pointers and is_owned flags and looks at the values in fields.
17890 * Two objects with NULL inner values will be considered "equal" here.
17892 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
17895 * Creates a copy of the RawInvoice
17897 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
17900 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
17902 void RawDataPart_free(struct LDKRawDataPart this_obj);
17905 * generation time of the invoice
17907 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
17910 * generation time of the invoice
17912 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
17915 * Checks if two RawDataParts contain equal inner contents.
17916 * This ignores pointers and is_owned flags and looks at the values in fields.
17917 * Two objects with NULL inner values will be considered "equal" here.
17919 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
17922 * Creates a copy of the RawDataPart
17924 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
17927 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
17929 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
17932 * Checks if two PositiveTimestamps contain equal inner contents.
17933 * This ignores pointers and is_owned flags and looks at the values in fields.
17934 * Two objects with NULL inner values will be considered "equal" here.
17936 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
17939 * Creates a copy of the PositiveTimestamp
17941 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
17944 * Creates a copy of the SiPrefix
17946 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
17949 * Checks if two SiPrefixs contain equal inner contents.
17950 * This ignores pointers and is_owned flags and looks at the values in fields.
17952 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
17955 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
17956 * This is effectively 10^12 * the prefix multiplier
17958 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
17961 * Creates a copy of the Currency
17963 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
17966 * Checks if two Currencys contain equal inner contents.
17967 * This ignores pointers and is_owned flags and looks at the values in fields.
17969 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
17972 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
17974 void Sha256_free(struct LDKSha256 this_obj);
17977 * Checks if two Sha256s contain equal inner contents.
17978 * This ignores pointers and is_owned flags and looks at the values in fields.
17979 * Two objects with NULL inner values will be considered "equal" here.
17981 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
17984 * Creates a copy of the Sha256
17986 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
17989 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
17991 void Description_free(struct LDKDescription this_obj);
17994 * Checks if two Descriptions contain equal inner contents.
17995 * This ignores pointers and is_owned flags and looks at the values in fields.
17996 * Two objects with NULL inner values will be considered "equal" here.
17998 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
18001 * Creates a copy of the Description
18003 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
18006 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
18008 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
18011 * Checks if two PayeePubKeys contain equal inner contents.
18012 * This ignores pointers and is_owned flags and looks at the values in fields.
18013 * Two objects with NULL inner values will be considered "equal" here.
18015 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
18018 * Creates a copy of the PayeePubKey
18020 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
18023 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
18025 void ExpiryTime_free(struct LDKExpiryTime this_obj);
18028 * Checks if two ExpiryTimes contain equal inner contents.
18029 * This ignores pointers and is_owned flags and looks at the values in fields.
18030 * Two objects with NULL inner values will be considered "equal" here.
18032 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
18035 * Creates a copy of the ExpiryTime
18037 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
18040 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
18042 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
18045 * Checks if two MinFinalCltvExpirys contain equal inner contents.
18046 * This ignores pointers and is_owned flags and looks at the values in fields.
18047 * Two objects with NULL inner values will be considered "equal" here.
18049 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
18052 * Creates a copy of the MinFinalCltvExpiry
18054 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
18057 * Frees any resources used by the Fallback
18059 void Fallback_free(struct LDKFallback this_ptr);
18062 * Creates a copy of the Fallback
18064 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
18067 * Checks if two Fallbacks contain equal inner contents.
18068 * This ignores pointers and is_owned flags and looks at the values in fields.
18070 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
18073 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
18075 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
18078 * Checks if two InvoiceSignatures contain equal inner contents.
18079 * This ignores pointers and is_owned flags and looks at the values in fields.
18080 * Two objects with NULL inner values will be considered "equal" here.
18082 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
18085 * Creates a copy of the InvoiceSignature
18087 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
18090 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
18092 void RouteHint_free(struct LDKRouteHint this_obj);
18095 * Checks if two RouteHints contain equal inner contents.
18096 * This ignores pointers and is_owned flags and looks at the values in fields.
18097 * Two objects with NULL inner values will be considered "equal" here.
18099 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
18102 * Creates a copy of the RouteHint
18104 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
18107 * Disassembles the `SignedRawInvoice` into its three parts:
18109 * 2. hash of the raw invoice
18112 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
18115 * The `RawInvoice` which was signed.
18117 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
18120 * The hash of the `RawInvoice` that was signed.
18122 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
18125 * InvoiceSignature for the invoice.
18127 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
18130 * Recovers the public key used for signing the invoice from the recoverable signature.
18132 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
18135 * Checks if the signature is valid for the included payee public key or if none exists if it's
18136 * valid for the recovered signature (which should always be true?).
18138 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
18141 * Calculate the hash of the encoded `RawInvoice`
18143 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18145 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18147 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18149 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18151 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18153 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18155 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18157 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18159 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18161 MUST_USE_RES struct LDKCVec_RouteHintZ RawInvoice_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18163 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18165 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18168 * Create a new `PositiveTimestamp` from a unix timestamp in the Range
18169 * `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
18170 * `CreationError::TimestampOutOfBounds`.
18172 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
18175 * Create a new `PositiveTimestamp` from a `SystemTime` with a corresponding unix timestamp in
18176 * the Range `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
18177 * `CreationError::TimestampOutOfBounds`.
18179 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
18182 * Returns the UNIX timestamp representing the stored time
18184 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
18187 * Returns a reference to the internal `SystemTime` time representation
18189 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
18192 * Transform the `Invoice` into it's unchecked version
18194 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
18197 * Check that the invoice is signed correctly and that key recovery works
18199 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
18202 * Constructs an `Invoice` from a `SignedInvoice` by checking all its invariants.
18204 * use lightning_invoice::*;
18206 * let invoice = \"lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdp\\
18207 * \tl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d7\\
18208 * \t3gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ec\\
18209 * \tky03ylcqca784w\";
18211 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
18213 * assert!(Invoice::from_signed(signed).is_ok());
18216 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
18219 * Returns the `Invoice`'s timestamp (should equal it's creation time)
18221 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
18224 * Returns the hash to which we will receive the preimage on completion of the payment
18226 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
18229 * Get the payee's public key if one was included in the invoice
18231 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
18234 * Get the payment secret if one was included in the invoice
18236 MUST_USE_RES struct LDKThirtyTwoBytes Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg);
18239 * Get the invoice features if they were included in the invoice
18241 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
18244 * Recover the payee's public key (only to be used if none was included in the invoice)
18246 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
18249 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
18251 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
18254 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
18255 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
18257 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
18260 * Returns a list of all routes included in the invoice
18262 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
18265 * Returns the currency for which the invoice was issued
18267 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
18270 * Returns the amount if specified in the invoice as pico <currency>.
18272 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_pico_btc(const struct LDKInvoice *NONNULL_PTR this_arg);
18275 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
18276 * returns `CreationError::DescriptionTooLong` otherwise
18278 * Please note that single characters may use more than one byte due to UTF8 encoding.
18280 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
18283 * Returns the underlying description `String`
18285 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
18288 * Construct an `ExpiryTime` from seconds. If there exists a `PositiveTimestamp` which would
18289 * overflow on adding the `EpiryTime` to it then this function will return a
18290 * `CreationError::ExpiryTimeOutOfBounds`.
18292 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_seconds(uint64_t seconds);
18295 * Construct an `ExpiryTime` from a `Duration`. If there exists a `PositiveTimestamp` which
18296 * would overflow on adding the `EpiryTime` to it then this function will return a
18297 * `CreationError::ExpiryTimeOutOfBounds`.
18299 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_duration(uint64_t duration);
18302 * Returns the expiry time in seconds
18304 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
18307 * Returns a reference to the underlying `Duration` (=expiry time)
18309 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
18312 * Create a new (partial) route from a list of hops
18314 MUST_USE_RES struct LDKCResult_RouteHintCreationErrorZ RouteHint_new(struct LDKCVec_RouteHintHopZ hops);
18317 * Returrn the underlying vector of hops
18319 MUST_USE_RES struct LDKCVec_RouteHintHopZ RouteHint_into_inner(struct LDKRouteHint this_arg);
18322 * Creates a copy of the CreationError
18324 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
18327 * Checks if two CreationErrors contain equal inner contents.
18328 * This ignores pointers and is_owned flags and looks at the values in fields.
18330 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
18333 * Get the string representation of a CreationError object
18335 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
18338 * Creates a copy of the SemanticError
18340 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
18343 * Checks if two SemanticErrors contain equal inner contents.
18344 * This ignores pointers and is_owned flags and looks at the values in fields.
18346 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
18349 * Get the string representation of a SemanticError object
18351 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
18354 * Frees any resources used by the SignOrCreationError
18356 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
18359 * Creates a copy of the SignOrCreationError
18361 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
18364 * Checks if two SignOrCreationErrors contain equal inner contents.
18365 * This ignores pointers and is_owned flags and looks at the values in fields.
18367 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
18370 * Get the string representation of a SignOrCreationError object
18372 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
18375 * Utility to construct an invoice. Generally, unless you want to do something like a custom
18376 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
18377 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
18378 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
18379 * that the payment secret is valid when the invoice is paid.
18381 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description);
18384 * Read a SiPrefix object from a string
18386 struct LDKCResult_SiPrefixNoneZ SiPrefix_from_str(struct LDKStr s);
18389 * Read a Invoice object from a string
18391 struct LDKCResult_InvoiceNoneZ Invoice_from_str(struct LDKStr s);
18394 * Read a SignedRawInvoice object from a string
18396 struct LDKCResult_SignedRawInvoiceNoneZ SignedRawInvoice_from_str(struct LDKStr s);
18399 * Get the string representation of a Invoice object
18401 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
18404 * Get the string representation of a SignedRawInvoice object
18406 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
18409 * Get the string representation of a Currency object
18411 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
18414 * Get the string representation of a SiPrefix object
18416 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
18418 #endif /* LDK_C_BINDINGS_H */
18420 #include <ldk_ver.h>