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 very low priority, often extremely verbose, information
217 * Designates lower priority information
221 * Designates useful information
225 * Designates hazardous situations
229 * Designates very serious errors
233 * Must be last for serialization purposes
239 * An enum representing the possible Bitcoin or test networks which we can run on
241 typedef enum LDKNetwork {
243 * The main Bitcoin blockchain.
247 * The testnet3 blockchain.
251 * A local test blockchain.
255 * A blockchain on which blocks are signed instead of mined.
259 * Must be last for serialization purposes
265 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
267 typedef enum LDKSecp256k1Error {
269 * Signature failed verification
271 LDKSecp256k1Error_IncorrectSignature,
273 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
275 LDKSecp256k1Error_InvalidMessage,
279 LDKSecp256k1Error_InvalidPublicKey,
283 LDKSecp256k1Error_InvalidSignature,
287 LDKSecp256k1Error_InvalidSecretKey,
291 LDKSecp256k1Error_InvalidRecoveryId,
293 * Invalid tweak for add_assign or mul_assign
295 LDKSecp256k1Error_InvalidTweak,
297 * tweak_add_check failed on an xonly public key
299 LDKSecp256k1Error_TweakCheckFailed,
301 * Didn't pass enough memory to context creation with preallocated memory
303 LDKSecp256k1Error_NotEnoughMemory,
305 * Must be last for serialization purposes
307 LDKSecp256k1Error_Sentinel,
311 * Errors that may occur when converting a `RawInvoice` to an `Invoice`. They relate to the
312 * requirements sections in BOLT #11
314 typedef enum LDKSemanticError {
316 * The invoice is missing the mandatory payment hash
318 LDKSemanticError_NoPaymentHash,
320 * The invoice has multiple payment hashes which isn't allowed
322 LDKSemanticError_MultiplePaymentHashes,
324 * No description or description hash are part of the invoice
326 LDKSemanticError_NoDescription,
328 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
330 LDKSemanticError_MultipleDescriptions,
332 * The invoice contains multiple payment secrets
334 LDKSemanticError_MultiplePaymentSecrets,
336 * The invoice's features are invalid
338 LDKSemanticError_InvalidFeatures,
340 * The recovery id doesn't fit the signature/pub key
342 LDKSemanticError_InvalidRecoveryId,
344 * The invoice's signature is invalid
346 LDKSemanticError_InvalidSignature,
348 * Must be last for serialization purposes
350 LDKSemanticError_Sentinel,
354 * SI prefixes for the human readable part
356 typedef enum LDKSiPrefix {
374 * Must be last for serialization purposes
376 LDKSiPrefix_Sentinel,
380 * A Rust str object, ie a reference to a UTF8-valid string.
381 * This is *not* null-terminated so cannot be used directly as a C string!
383 typedef struct LDKStr {
385 * A pointer to the string's bytes, in UTF8 encoding
387 const uint8_t *chars;
389 * The number of bytes (not characters!) pointed to by `chars`
393 * Whether the data pointed to by `chars` should be freed or not.
399 * A serialized transaction, in (pointer, length) form.
401 * This type optionally owns its own memory, and thus the semantics around access change based on
402 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
403 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
404 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
405 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
406 * you would be invalid.
408 * Note that, while it may change in the future, because transactions on the Rust side are stored
409 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
410 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
411 * `data_is_owned` either set or unset at your discretion.
413 typedef struct LDKTransaction {
415 * The serialized transaction data.
417 * This is non-const for your convenience, an object passed to Rust is never written to.
421 * The length of the serialized transaction
425 * Whether the data pointed to by `data` should be freed or not.
431 * A dynamically-allocated array of u8s of arbitrary size.
432 * This corresponds to std::vector in C++
434 typedef struct LDKCVec_u8Z {
436 * The elements in the array.
437 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
441 * The number of elements pointed to by `data`.
447 * A transaction output including a scriptPubKey and value.
448 * This type *does* own its own memory, so must be free'd appropriately.
450 typedef struct LDKTxOut {
452 * The script_pubkey in this output
454 struct LDKCVec_u8Z script_pubkey;
456 * The value, in satoshis, of this output
462 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
464 typedef struct LDKSecretKey {
466 * The bytes of the secret key
472 * The contents of CResult_SecretKeyErrorZ
474 typedef union LDKCResult_SecretKeyErrorZPtr {
476 * A pointer to the contents in the success state.
477 * Reading from this pointer when `result_ok` is not set is undefined.
479 struct LDKSecretKey *result;
481 * A pointer to the contents in the error state.
482 * Reading from this pointer when `result_ok` is set is undefined.
484 enum LDKSecp256k1Error *err;
485 } LDKCResult_SecretKeyErrorZPtr;
488 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
489 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
490 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
492 typedef struct LDKCResult_SecretKeyErrorZ {
494 * The contents of this CResult_SecretKeyErrorZ, accessible via either
495 * `err` or `result` depending on the state of `result_ok`.
497 union LDKCResult_SecretKeyErrorZPtr contents;
499 * Whether this CResult_SecretKeyErrorZ represents a success state.
502 } LDKCResult_SecretKeyErrorZ;
505 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
507 typedef struct LDKPublicKey {
509 * The bytes of the public key
511 uint8_t compressed_form[33];
515 * The contents of CResult_PublicKeyErrorZ
517 typedef union LDKCResult_PublicKeyErrorZPtr {
519 * A pointer to the contents in the success state.
520 * Reading from this pointer when `result_ok` is not set is undefined.
522 struct LDKPublicKey *result;
524 * A pointer to the contents in the error state.
525 * Reading from this pointer when `result_ok` is set is undefined.
527 enum LDKSecp256k1Error *err;
528 } LDKCResult_PublicKeyErrorZPtr;
531 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
532 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
533 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
535 typedef struct LDKCResult_PublicKeyErrorZ {
537 * The contents of this CResult_PublicKeyErrorZ, accessible via either
538 * `err` or `result` depending on the state of `result_ok`.
540 union LDKCResult_PublicKeyErrorZPtr contents;
542 * Whether this CResult_PublicKeyErrorZ represents a success state.
545 } LDKCResult_PublicKeyErrorZ;
550 * The set of public keys which are used in the creation of one commitment transaction.
551 * These are derived from the channel base keys and per-commitment data.
553 * A broadcaster key is provided from potential broadcaster of the computed transaction.
554 * A countersignatory key is coming from a protocol participant unable to broadcast the
557 * These keys are assumed to be good, either because the code derived them from
558 * channel basepoints via the new function, or they were obtained via
559 * CommitmentTransaction.trust().keys() because we trusted the source of the
560 * pre-calculated keys.
562 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
564 * A pointer to the opaque Rust object.
565 * Nearly everywhere, inner must be non-null, however in places where
566 * the Rust equivalent takes an Option, it may be set to null to indicate None.
568 LDKnativeTxCreationKeys *inner;
570 * Indicates that this is the only struct which contains the same pointer.
571 * Rust functions which take ownership of an object provided via an argument require
572 * this to be true and invalidate the object pointed to by inner.
580 * An error in decoding a message or struct.
582 typedef struct MUST_USE_STRUCT LDKDecodeError {
584 * A pointer to the opaque Rust object.
585 * Nearly everywhere, inner must be non-null, however in places where
586 * the Rust equivalent takes an Option, it may be set to null to indicate None.
588 LDKnativeDecodeError *inner;
590 * Indicates that this is the only struct which contains the same pointer.
591 * Rust functions which take ownership of an object provided via an argument require
592 * this to be true and invalidate the object pointed to by inner.
598 * The contents of CResult_TxCreationKeysDecodeErrorZ
600 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
602 * A pointer to the contents in the success state.
603 * Reading from this pointer when `result_ok` is not set is undefined.
605 struct LDKTxCreationKeys *result;
607 * A pointer to the contents in the error state.
608 * Reading from this pointer when `result_ok` is set is undefined.
610 struct LDKDecodeError *err;
611 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
614 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
615 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
616 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
618 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
620 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
621 * `err` or `result` depending on the state of `result_ok`.
623 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
625 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
628 } LDKCResult_TxCreationKeysDecodeErrorZ;
633 * One counterparty's public keys which do not change over the life of a channel.
635 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
637 * A pointer to the opaque Rust object.
638 * Nearly everywhere, inner must be non-null, however in places where
639 * the Rust equivalent takes an Option, it may be set to null to indicate None.
641 LDKnativeChannelPublicKeys *inner;
643 * Indicates that this is the only struct which contains the same pointer.
644 * Rust functions which take ownership of an object provided via an argument require
645 * this to be true and invalidate the object pointed to by inner.
648 } LDKChannelPublicKeys;
651 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
653 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
655 * A pointer to the contents in the success state.
656 * Reading from this pointer when `result_ok` is not set is undefined.
658 struct LDKChannelPublicKeys *result;
660 * A pointer to the contents in the error state.
661 * Reading from this pointer when `result_ok` is set is undefined.
663 struct LDKDecodeError *err;
664 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
667 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
668 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
669 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
671 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
673 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
674 * `err` or `result` depending on the state of `result_ok`.
676 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
678 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
681 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
684 * The contents of CResult_TxCreationKeysErrorZ
686 typedef union LDKCResult_TxCreationKeysErrorZPtr {
688 * A pointer to the contents in the success state.
689 * Reading from this pointer when `result_ok` is not set is undefined.
691 struct LDKTxCreationKeys *result;
693 * A pointer to the contents in the error state.
694 * Reading from this pointer when `result_ok` is set is undefined.
696 enum LDKSecp256k1Error *err;
697 } LDKCResult_TxCreationKeysErrorZPtr;
700 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
701 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
702 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
704 typedef struct LDKCResult_TxCreationKeysErrorZ {
706 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
707 * `err` or `result` depending on the state of `result_ok`.
709 union LDKCResult_TxCreationKeysErrorZPtr contents;
711 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
714 } LDKCResult_TxCreationKeysErrorZ;
717 * An enum which can either contain a u32 or not
719 typedef enum LDKCOption_u32Z_Tag {
721 * When we're in this state, this COption_u32Z contains a u32
723 LDKCOption_u32Z_Some,
725 * When we're in this state, this COption_u32Z contains nothing
727 LDKCOption_u32Z_None,
729 * Must be last for serialization purposes
731 LDKCOption_u32Z_Sentinel,
732 } LDKCOption_u32Z_Tag;
734 typedef struct LDKCOption_u32Z {
735 LDKCOption_u32Z_Tag tag;
746 * Information about an HTLC as it appears in a commitment transaction
748 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
750 * A pointer to the opaque Rust object.
751 * Nearly everywhere, inner must be non-null, however in places where
752 * the Rust equivalent takes an Option, it may be set to null to indicate None.
754 LDKnativeHTLCOutputInCommitment *inner;
756 * Indicates that this is the only struct which contains the same pointer.
757 * Rust functions which take ownership of an object provided via an argument require
758 * this to be true and invalidate the object pointed to by inner.
761 } LDKHTLCOutputInCommitment;
764 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
766 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
768 * A pointer to the contents in the success state.
769 * Reading from this pointer when `result_ok` is not set is undefined.
771 struct LDKHTLCOutputInCommitment *result;
773 * A pointer to the contents in the error state.
774 * Reading from this pointer when `result_ok` is set is undefined.
776 struct LDKDecodeError *err;
777 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
780 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
781 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
782 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
784 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
786 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
787 * `err` or `result` depending on the state of `result_ok`.
789 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
791 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
794 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
799 * Late-bound per-channel counterparty data used to build transactions.
801 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
803 * A pointer to the opaque Rust object.
804 * Nearly everywhere, inner must be non-null, however in places where
805 * the Rust equivalent takes an Option, it may be set to null to indicate None.
807 LDKnativeCounterpartyChannelTransactionParameters *inner;
809 * Indicates that this is the only struct which contains the same pointer.
810 * Rust functions which take ownership of an object provided via an argument require
811 * this to be true and invalidate the object pointed to by inner.
814 } LDKCounterpartyChannelTransactionParameters;
817 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
819 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
821 * A pointer to the contents in the success state.
822 * Reading from this pointer when `result_ok` is not set is undefined.
824 struct LDKCounterpartyChannelTransactionParameters *result;
826 * A pointer to the contents in the error state.
827 * Reading from this pointer when `result_ok` is set is undefined.
829 struct LDKDecodeError *err;
830 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
833 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
834 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
835 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
837 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
839 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
840 * `err` or `result` depending on the state of `result_ok`.
842 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
844 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
847 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
852 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
853 * The fields are organized by holder/counterparty.
855 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
856 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
858 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
860 * A pointer to the opaque Rust object.
861 * Nearly everywhere, inner must be non-null, however in places where
862 * the Rust equivalent takes an Option, it may be set to null to indicate None.
864 LDKnativeChannelTransactionParameters *inner;
866 * Indicates that this is the only struct which contains the same pointer.
867 * Rust functions which take ownership of an object provided via an argument require
868 * this to be true and invalidate the object pointed to by inner.
871 } LDKChannelTransactionParameters;
874 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
876 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
878 * A pointer to the contents in the success state.
879 * Reading from this pointer when `result_ok` is not set is undefined.
881 struct LDKChannelTransactionParameters *result;
883 * A pointer to the contents in the error state.
884 * Reading from this pointer when `result_ok` is set is undefined.
886 struct LDKDecodeError *err;
887 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
890 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
891 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
892 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
894 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
896 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
897 * `err` or `result` depending on the state of `result_ok`.
899 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
901 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
904 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
907 * Represents a secp256k1 signature serialized as two 32-byte numbers
909 typedef struct LDKSignature {
911 * The bytes of the signature in "compact" form
913 uint8_t compact_form[64];
917 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
918 * This corresponds to std::vector in C++
920 typedef struct LDKCVec_SignatureZ {
922 * The elements in the array.
923 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
925 struct LDKSignature *data;
927 * The number of elements pointed to by `data`.
930 } LDKCVec_SignatureZ;
935 * Information needed to build and sign a holder's commitment transaction.
937 * The transaction is only signed once we are ready to broadcast.
939 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
941 * A pointer to the opaque Rust object.
942 * Nearly everywhere, inner must be non-null, however in places where
943 * the Rust equivalent takes an Option, it may be set to null to indicate None.
945 LDKnativeHolderCommitmentTransaction *inner;
947 * Indicates that this is the only struct which contains the same pointer.
948 * Rust functions which take ownership of an object provided via an argument require
949 * this to be true and invalidate the object pointed to by inner.
952 } LDKHolderCommitmentTransaction;
955 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
957 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
959 * A pointer to the contents in the success state.
960 * Reading from this pointer when `result_ok` is not set is undefined.
962 struct LDKHolderCommitmentTransaction *result;
964 * A pointer to the contents in the error state.
965 * Reading from this pointer when `result_ok` is set is undefined.
967 struct LDKDecodeError *err;
968 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
971 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
972 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
973 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
975 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
977 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
978 * `err` or `result` depending on the state of `result_ok`.
980 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
982 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
985 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
990 * A pre-built Bitcoin commitment transaction and its txid.
992 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
994 * A pointer to the opaque Rust object.
995 * Nearly everywhere, inner must be non-null, however in places where
996 * the Rust equivalent takes an Option, it may be set to null to indicate None.
998 LDKnativeBuiltCommitmentTransaction *inner;
1000 * Indicates that this is the only struct which contains the same pointer.
1001 * Rust functions which take ownership of an object provided via an argument require
1002 * this to be true and invalidate the object pointed to by inner.
1005 } LDKBuiltCommitmentTransaction;
1008 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1010 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
1012 * A pointer to the contents in the success state.
1013 * Reading from this pointer when `result_ok` is not set is undefined.
1015 struct LDKBuiltCommitmentTransaction *result;
1017 * A pointer to the contents in the error state.
1018 * Reading from this pointer when `result_ok` is set is undefined.
1020 struct LDKDecodeError *err;
1021 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1024 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1025 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1026 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1028 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1030 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1031 * `err` or `result` depending on the state of `result_ok`.
1033 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1035 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1038 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1043 * This class tracks the per-transaction information needed to build a commitment transaction and to
1044 * actually build it and sign. It is used for holder transactions that we sign only when needed
1045 * and for transactions we sign for the counterparty.
1047 * This class can be used inside a signer implementation to generate a signature given the relevant
1050 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1052 * A pointer to the opaque Rust object.
1053 * Nearly everywhere, inner must be non-null, however in places where
1054 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1056 LDKnativeCommitmentTransaction *inner;
1058 * Indicates that this is the only struct which contains the same pointer.
1059 * Rust functions which take ownership of an object provided via an argument require
1060 * this to be true and invalidate the object pointed to by inner.
1063 } LDKCommitmentTransaction;
1066 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1068 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1070 * A pointer to the contents in the success state.
1071 * Reading from this pointer when `result_ok` is not set is undefined.
1073 struct LDKCommitmentTransaction *result;
1075 * A pointer to the contents in the error state.
1076 * Reading from this pointer when `result_ok` is set is undefined.
1078 struct LDKDecodeError *err;
1079 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1082 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1083 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1084 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1086 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1088 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1089 * `err` or `result` depending on the state of `result_ok`.
1091 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1093 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1096 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1101 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1102 * transaction and the transaction creation keys) are trusted.
1104 * See trust() and verify() functions on CommitmentTransaction.
1106 * This structure implements Deref.
1108 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1110 * A pointer to the opaque Rust object.
1111 * Nearly everywhere, inner must be non-null, however in places where
1112 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1114 LDKnativeTrustedCommitmentTransaction *inner;
1116 * Indicates that this is the only struct which contains the same pointer.
1117 * Rust functions which take ownership of an object provided via an argument require
1118 * this to be true and invalidate the object pointed to by inner.
1121 } LDKTrustedCommitmentTransaction;
1124 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1126 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1128 * A pointer to the contents in the success state.
1129 * Reading from this pointer when `result_ok` is not set is undefined.
1131 struct LDKTrustedCommitmentTransaction *result;
1133 * Note that this value is always NULL, as there are no contents in the Err variant
1136 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1139 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1140 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1141 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1143 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1145 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1146 * `err` or `result` depending on the state of `result_ok`.
1148 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1150 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1153 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1156 * The contents of CResult_CVec_SignatureZNoneZ
1158 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1160 * A pointer to the contents in the success state.
1161 * Reading from this pointer when `result_ok` is not set is undefined.
1163 struct LDKCVec_SignatureZ *result;
1165 * Note that this value is always NULL, as there are no contents in the Err variant
1168 } LDKCResult_CVec_SignatureZNoneZPtr;
1171 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1172 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1173 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1175 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1177 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1178 * `err` or `result` depending on the state of `result_ok`.
1180 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1182 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1185 } LDKCResult_CVec_SignatureZNoneZ;
1188 * The contents of CResult_NoneErrorZ
1190 typedef union LDKCResult_NoneErrorZPtr {
1192 * Note that this value is always NULL, as there are no contents in the OK variant
1196 * A pointer to the contents in the error state.
1197 * Reading from this pointer when `result_ok` is set is undefined.
1199 enum LDKIOError *err;
1200 } LDKCResult_NoneErrorZPtr;
1203 * A CResult_NoneErrorZ represents the result of a fallible operation,
1204 * containing a () on success and a crate::c_types::IOError on failure.
1205 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1207 typedef struct LDKCResult_NoneErrorZ {
1209 * The contents of this CResult_NoneErrorZ, accessible via either
1210 * `err` or `result` depending on the state of `result_ok`.
1212 union LDKCResult_NoneErrorZPtr contents;
1214 * Whether this CResult_NoneErrorZ represents a success state.
1217 } LDKCResult_NoneErrorZ;
1224 typedef struct MUST_USE_STRUCT LDKRouteHop {
1226 * A pointer to the opaque Rust object.
1227 * Nearly everywhere, inner must be non-null, however in places where
1228 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1230 LDKnativeRouteHop *inner;
1232 * Indicates that this is the only struct which contains the same pointer.
1233 * Rust functions which take ownership of an object provided via an argument require
1234 * this to be true and invalidate the object pointed to by inner.
1240 * The contents of CResult_RouteHopDecodeErrorZ
1242 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
1244 * A pointer to the contents in the success state.
1245 * Reading from this pointer when `result_ok` is not set is undefined.
1247 struct LDKRouteHop *result;
1249 * A pointer to the contents in the error state.
1250 * Reading from this pointer when `result_ok` is set is undefined.
1252 struct LDKDecodeError *err;
1253 } LDKCResult_RouteHopDecodeErrorZPtr;
1256 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
1257 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
1258 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1260 typedef struct LDKCResult_RouteHopDecodeErrorZ {
1262 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
1263 * `err` or `result` depending on the state of `result_ok`.
1265 union LDKCResult_RouteHopDecodeErrorZPtr contents;
1267 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
1270 } LDKCResult_RouteHopDecodeErrorZ;
1273 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
1274 * This corresponds to std::vector in C++
1276 typedef struct LDKCVec_RouteHopZ {
1278 * The elements in the array.
1279 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1281 struct LDKRouteHop *data;
1283 * The number of elements pointed to by `data`.
1286 } LDKCVec_RouteHopZ;
1289 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
1290 * This corresponds to std::vector in C++
1292 typedef struct LDKCVec_CVec_RouteHopZZ {
1294 * The elements in the array.
1295 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1297 struct LDKCVec_RouteHopZ *data;
1299 * The number of elements pointed to by `data`.
1302 } LDKCVec_CVec_RouteHopZZ;
1307 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
1308 * it can take multiple paths. Each path is composed of one or more hops through the network.
1310 typedef struct MUST_USE_STRUCT LDKRoute {
1312 * A pointer to the opaque Rust object.
1313 * Nearly everywhere, inner must be non-null, however in places where
1314 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1316 LDKnativeRoute *inner;
1318 * Indicates that this is the only struct which contains the same pointer.
1319 * Rust functions which take ownership of an object provided via an argument require
1320 * this to be true and invalidate the object pointed to by inner.
1326 * The contents of CResult_RouteDecodeErrorZ
1328 typedef union LDKCResult_RouteDecodeErrorZPtr {
1330 * A pointer to the contents in the success state.
1331 * Reading from this pointer when `result_ok` is not set is undefined.
1333 struct LDKRoute *result;
1335 * A pointer to the contents in the error state.
1336 * Reading from this pointer when `result_ok` is set is undefined.
1338 struct LDKDecodeError *err;
1339 } LDKCResult_RouteDecodeErrorZPtr;
1342 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
1343 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
1344 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1346 typedef struct LDKCResult_RouteDecodeErrorZ {
1348 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
1349 * `err` or `result` depending on the state of `result_ok`.
1351 union LDKCResult_RouteDecodeErrorZPtr contents;
1353 * Whether this CResult_RouteDecodeErrorZ represents a success state.
1356 } LDKCResult_RouteDecodeErrorZ;
1359 * An enum which can either contain a u64 or not
1361 typedef enum LDKCOption_u64Z_Tag {
1363 * When we're in this state, this COption_u64Z contains a u64
1365 LDKCOption_u64Z_Some,
1367 * When we're in this state, this COption_u64Z contains nothing
1369 LDKCOption_u64Z_None,
1371 * Must be last for serialization purposes
1373 LDKCOption_u64Z_Sentinel,
1374 } LDKCOption_u64Z_Tag;
1376 typedef struct LDKCOption_u64Z {
1377 LDKCOption_u64Z_Tag tag;
1388 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
1390 typedef struct MUST_USE_STRUCT LDKChannelDetails {
1392 * A pointer to the opaque Rust object.
1393 * Nearly everywhere, inner must be non-null, however in places where
1394 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1396 LDKnativeChannelDetails *inner;
1398 * Indicates that this is the only struct which contains the same pointer.
1399 * Rust functions which take ownership of an object provided via an argument require
1400 * this to be true and invalidate the object pointed to by inner.
1403 } LDKChannelDetails;
1406 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
1407 * This corresponds to std::vector in C++
1409 typedef struct LDKCVec_ChannelDetailsZ {
1411 * The elements in the array.
1412 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1414 struct LDKChannelDetails *data;
1416 * The number of elements pointed to by `data`.
1419 } LDKCVec_ChannelDetailsZ;
1424 * A list of hops along a payment path terminating with a channel to the recipient.
1426 typedef struct MUST_USE_STRUCT LDKRouteHint {
1428 * A pointer to the opaque Rust object.
1429 * Nearly everywhere, inner must be non-null, however in places where
1430 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1432 LDKnativeRouteHint *inner;
1434 * Indicates that this is the only struct which contains the same pointer.
1435 * Rust functions which take ownership of an object provided via an argument require
1436 * this to be true and invalidate the object pointed to by inner.
1442 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
1443 * This corresponds to std::vector in C++
1445 typedef struct LDKCVec_RouteHintZ {
1447 * The elements in the array.
1448 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1450 struct LDKRouteHint *data;
1452 * The number of elements pointed to by `data`.
1455 } LDKCVec_RouteHintZ;
1460 * An Err type for failure to process messages.
1462 typedef struct MUST_USE_STRUCT LDKLightningError {
1464 * A pointer to the opaque Rust object.
1465 * Nearly everywhere, inner must be non-null, however in places where
1466 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1468 LDKnativeLightningError *inner;
1470 * Indicates that this is the only struct which contains the same pointer.
1471 * Rust functions which take ownership of an object provided via an argument require
1472 * this to be true and invalidate the object pointed to by inner.
1475 } LDKLightningError;
1478 * The contents of CResult_RouteLightningErrorZ
1480 typedef union LDKCResult_RouteLightningErrorZPtr {
1482 * A pointer to the contents in the success state.
1483 * Reading from this pointer when `result_ok` is not set is undefined.
1485 struct LDKRoute *result;
1487 * A pointer to the contents in the error state.
1488 * Reading from this pointer when `result_ok` is set is undefined.
1490 struct LDKLightningError *err;
1491 } LDKCResult_RouteLightningErrorZPtr;
1494 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
1495 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
1496 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1498 typedef struct LDKCResult_RouteLightningErrorZ {
1500 * The contents of this CResult_RouteLightningErrorZ, accessible via either
1501 * `err` or `result` depending on the state of `result_ok`.
1503 union LDKCResult_RouteLightningErrorZPtr contents;
1505 * Whether this CResult_RouteLightningErrorZ represents a success state.
1508 } LDKCResult_RouteLightningErrorZ;
1511 * The contents of CResult_TxOutAccessErrorZ
1513 typedef union LDKCResult_TxOutAccessErrorZPtr {
1515 * A pointer to the contents in the success state.
1516 * Reading from this pointer when `result_ok` is not set is undefined.
1518 struct LDKTxOut *result;
1520 * A pointer to the contents in the error state.
1521 * Reading from this pointer when `result_ok` is set is undefined.
1523 enum LDKAccessError *err;
1524 } LDKCResult_TxOutAccessErrorZPtr;
1527 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
1528 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
1529 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1531 typedef struct LDKCResult_TxOutAccessErrorZ {
1533 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
1534 * `err` or `result` depending on the state of `result_ok`.
1536 union LDKCResult_TxOutAccessErrorZPtr contents;
1538 * Whether this CResult_TxOutAccessErrorZ represents a success state.
1541 } LDKCResult_TxOutAccessErrorZ;
1544 * A tuple of 2 elements. See the individual fields for the types contained.
1546 typedef struct LDKC2Tuple_usizeTransactionZ {
1548 * The element at position 0
1552 * The element at position 1
1554 struct LDKTransaction b;
1555 } LDKC2Tuple_usizeTransactionZ;
1558 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
1559 * This corresponds to std::vector in C++
1561 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
1563 * The elements in the array.
1564 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1566 struct LDKC2Tuple_usizeTransactionZ *data;
1568 * The number of elements pointed to by `data`.
1571 } LDKCVec_C2Tuple_usizeTransactionZZ;
1574 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1575 * look up the corresponding function in rust-lightning's docs.
1577 typedef struct LDKThirtyTwoBytes {
1579 * The thirty-two bytes
1582 } LDKThirtyTwoBytes;
1585 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
1586 * This corresponds to std::vector in C++
1588 typedef struct LDKCVec_TxidZ {
1590 * The elements in the array.
1591 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1593 struct LDKThirtyTwoBytes *data;
1595 * The number of elements pointed to by `data`.
1601 * The contents of CResult_NoneChannelMonitorUpdateErrZ
1603 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
1605 * Note that this value is always NULL, as there are no contents in the OK variant
1609 * A pointer to the contents in the error state.
1610 * Reading from this pointer when `result_ok` is set is undefined.
1612 enum LDKChannelMonitorUpdateErr *err;
1613 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
1616 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
1617 * containing a () on success and a crate::lightning::chain::channelmonitor::ChannelMonitorUpdateErr on failure.
1618 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1620 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
1622 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
1623 * `err` or `result` depending on the state of `result_ok`.
1625 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
1627 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
1630 } LDKCResult_NoneChannelMonitorUpdateErrZ;
1635 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
1636 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
1637 * preimage claim backward will lead to loss of funds.
1639 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
1641 * A pointer to the opaque Rust object.
1642 * Nearly everywhere, inner must be non-null, however in places where
1643 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1645 LDKnativeHTLCUpdate *inner;
1647 * Indicates that this is the only struct which contains the same pointer.
1648 * Rust functions which take ownership of an object provided via an argument require
1649 * this to be true and invalidate the object pointed to by inner.
1657 * A reference to a transaction output.
1659 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
1660 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
1662 typedef struct MUST_USE_STRUCT LDKOutPoint {
1664 * A pointer to the opaque Rust object.
1665 * Nearly everywhere, inner must be non-null, however in places where
1666 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1668 LDKnativeOutPoint *inner;
1670 * Indicates that this is the only struct which contains the same pointer.
1671 * Rust functions which take ownership of an object provided via an argument require
1672 * this to be true and invalidate the object pointed to by inner.
1678 * An event to be processed by the ChannelManager.
1680 typedef enum LDKMonitorEvent_Tag {
1682 * A monitor event containing an HTLCUpdate.
1684 LDKMonitorEvent_HTLCEvent,
1686 * A monitor event that the Channel's commitment transaction was broadcasted.
1688 LDKMonitorEvent_CommitmentTxBroadcasted,
1690 * Must be last for serialization purposes
1692 LDKMonitorEvent_Sentinel,
1693 } LDKMonitorEvent_Tag;
1695 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
1696 LDKMonitorEvent_Tag tag;
1699 struct LDKHTLCUpdate htlc_event;
1702 struct LDKOutPoint commitment_tx_broadcasted;
1708 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
1709 * This corresponds to std::vector in C++
1711 typedef struct LDKCVec_MonitorEventZ {
1713 * The elements in the array.
1714 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1716 struct LDKMonitorEvent *data;
1718 * The number of elements pointed to by `data`.
1721 } LDKCVec_MonitorEventZ;
1724 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
1726 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
1728 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
1730 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
1732 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
1734 LDKCOption_C2Tuple_usizeTransactionZZ_None,
1736 * Must be last for serialization purposes
1738 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
1739 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
1741 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
1742 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
1745 struct LDKC2Tuple_usizeTransactionZ some;
1748 } LDKCOption_C2Tuple_usizeTransactionZZ;
1753 * Information about a spendable output to a P2WSH script. See
1754 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
1756 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
1758 * A pointer to the opaque Rust object.
1759 * Nearly everywhere, inner must be non-null, however in places where
1760 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1762 LDKnativeDelayedPaymentOutputDescriptor *inner;
1764 * Indicates that this is the only struct which contains the same pointer.
1765 * Rust functions which take ownership of an object provided via an argument require
1766 * this to be true and invalidate the object pointed to by inner.
1769 } LDKDelayedPaymentOutputDescriptor;
1774 * Information about a spendable output to our \"payment key\". See
1775 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
1777 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
1779 * A pointer to the opaque Rust object.
1780 * Nearly everywhere, inner must be non-null, however in places where
1781 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1783 LDKnativeStaticPaymentOutputDescriptor *inner;
1785 * Indicates that this is the only struct which contains the same pointer.
1786 * Rust functions which take ownership of an object provided via an argument require
1787 * this to be true and invalidate the object pointed to by inner.
1790 } LDKStaticPaymentOutputDescriptor;
1793 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
1794 * claim at any point in the future) an event is generated which you must track and be able to
1795 * spend on-chain. The information needed to do this is provided in this enum, including the
1796 * outpoint describing which txid and output index is available, the full output which exists at
1797 * that txid/index, and any keys or other information required to sign.
1799 typedef enum LDKSpendableOutputDescriptor_Tag {
1801 * An output to a script which was provided via KeysInterface directly, either from
1802 * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
1803 * spend it. No secret keys are provided as rust-lightning was never given any key.
1804 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
1805 * on-chain using the payment preimage or after it has timed out.
1807 LDKSpendableOutputDescriptor_StaticOutput,
1809 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
1811 * The witness in the spending input should be:
1812 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
1814 * Note that the nSequence field in the spending input must be set to to_self_delay
1815 * (which means the transaction is not broadcastable until at least to_self_delay
1816 * blocks after the outpoint confirms).
1818 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
1819 * it is an output from an old state which we broadcast (which should never happen).
1821 * To derive the delayed_payment key which is used to sign for this input, you must pass the
1822 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
1823 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
1824 * chan_utils::derive_private_key. The public key can be generated without the secret key
1825 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
1828 * To derive the revocation_pubkey provided here (which is used in the witness
1829 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
1830 * call to Sign::ready_channel) and the provided per_commitment point
1831 * to chan_utils::derive_public_revocation_key.
1833 * The witness script which is hashed and included in the output script_pubkey may be
1834 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
1835 * (derived as above), and the to_self_delay contained here to
1836 * chan_utils::get_revokeable_redeemscript.
1838 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
1840 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
1841 * corresponds to the public key in Sign::pubkeys().payment_point).
1842 * The witness in the spending input, is, thus, simply:
1843 * <BIP 143 signature> <payment key>
1845 * These are generally the result of our counterparty having broadcast the current state,
1846 * allowing us to claim the non-HTLC-encumbered outputs immediately.
1848 LDKSpendableOutputDescriptor_StaticPaymentOutput,
1850 * Must be last for serialization purposes
1852 LDKSpendableOutputDescriptor_Sentinel,
1853 } LDKSpendableOutputDescriptor_Tag;
1855 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
1857 * The outpoint which is spendable
1859 struct LDKOutPoint outpoint;
1861 * The output which is referenced by the given outpoint.
1863 struct LDKTxOut output;
1864 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
1866 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
1867 LDKSpendableOutputDescriptor_Tag tag;
1869 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
1871 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
1874 struct LDKStaticPaymentOutputDescriptor static_payment_output;
1877 } LDKSpendableOutputDescriptor;
1880 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
1881 * This corresponds to std::vector in C++
1883 typedef struct LDKCVec_SpendableOutputDescriptorZ {
1885 * The elements in the array.
1886 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1888 struct LDKSpendableOutputDescriptor *data;
1890 * The number of elements pointed to by `data`.
1893 } LDKCVec_SpendableOutputDescriptorZ;
1898 * An accept_channel message to be sent or received from a peer
1900 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
1902 * A pointer to the opaque Rust object.
1903 * Nearly everywhere, inner must be non-null, however in places where
1904 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1906 LDKnativeAcceptChannel *inner;
1908 * Indicates that this is the only struct which contains the same pointer.
1909 * Rust functions which take ownership of an object provided via an argument require
1910 * this to be true and invalidate the object pointed to by inner.
1918 * An open_channel message to be sent or received from a peer
1920 typedef struct MUST_USE_STRUCT LDKOpenChannel {
1922 * A pointer to the opaque Rust object.
1923 * Nearly everywhere, inner must be non-null, however in places where
1924 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1926 LDKnativeOpenChannel *inner;
1928 * Indicates that this is the only struct which contains the same pointer.
1929 * Rust functions which take ownership of an object provided via an argument require
1930 * this to be true and invalidate the object pointed to by inner.
1938 * A funding_created message to be sent or received from a peer
1940 typedef struct MUST_USE_STRUCT LDKFundingCreated {
1942 * A pointer to the opaque Rust object.
1943 * Nearly everywhere, inner must be non-null, however in places where
1944 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1946 LDKnativeFundingCreated *inner;
1948 * Indicates that this is the only struct which contains the same pointer.
1949 * Rust functions which take ownership of an object provided via an argument require
1950 * this to be true and invalidate the object pointed to by inner.
1953 } LDKFundingCreated;
1958 * A funding_signed message to be sent or received from a peer
1960 typedef struct MUST_USE_STRUCT LDKFundingSigned {
1962 * A pointer to the opaque Rust object.
1963 * Nearly everywhere, inner must be non-null, however in places where
1964 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1966 LDKnativeFundingSigned *inner;
1968 * Indicates that this is the only struct which contains the same pointer.
1969 * Rust functions which take ownership of an object provided via an argument require
1970 * this to be true and invalidate the object pointed to by inner.
1978 * A funding_locked message to be sent or received from a peer
1980 typedef struct MUST_USE_STRUCT LDKFundingLocked {
1982 * A pointer to the opaque Rust object.
1983 * Nearly everywhere, inner must be non-null, however in places where
1984 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1986 LDKnativeFundingLocked *inner;
1988 * Indicates that this is the only struct which contains the same pointer.
1989 * Rust functions which take ownership of an object provided via an argument require
1990 * this to be true and invalidate the object pointed to by inner.
1998 * An announcement_signatures message to be sent or received from a peer
2000 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
2002 * A pointer to the opaque Rust object.
2003 * Nearly everywhere, inner must be non-null, however in places where
2004 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2006 LDKnativeAnnouncementSignatures *inner;
2008 * Indicates that this is the only struct which contains the same pointer.
2009 * Rust functions which take ownership of an object provided via an argument require
2010 * this to be true and invalidate the object pointed to by inner.
2013 } LDKAnnouncementSignatures;
2018 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
2019 * transaction updates if they were pending.
2021 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
2023 * A pointer to the opaque Rust object.
2024 * Nearly everywhere, inner must be non-null, however in places where
2025 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2027 LDKnativeCommitmentUpdate *inner;
2029 * Indicates that this is the only struct which contains the same pointer.
2030 * Rust functions which take ownership of an object provided via an argument require
2031 * this to be true and invalidate the object pointed to by inner.
2034 } LDKCommitmentUpdate;
2039 * A revoke_and_ack message to be sent or received from a peer
2041 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
2043 * A pointer to the opaque Rust object.
2044 * Nearly everywhere, inner must be non-null, however in places where
2045 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2047 LDKnativeRevokeAndACK *inner;
2049 * Indicates that this is the only struct which contains the same pointer.
2050 * Rust functions which take ownership of an object provided via an argument require
2051 * this to be true and invalidate the object pointed to by inner.
2059 * A closing_signed message to be sent or received from a peer
2061 typedef struct MUST_USE_STRUCT LDKClosingSigned {
2063 * A pointer to the opaque Rust object.
2064 * Nearly everywhere, inner must be non-null, however in places where
2065 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2067 LDKnativeClosingSigned *inner;
2069 * Indicates that this is the only struct which contains the same pointer.
2070 * Rust functions which take ownership of an object provided via an argument require
2071 * this to be true and invalidate the object pointed to by inner.
2079 * A shutdown message to be sent or received from a peer
2081 typedef struct MUST_USE_STRUCT LDKShutdown {
2083 * A pointer to the opaque Rust object.
2084 * Nearly everywhere, inner must be non-null, however in places where
2085 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2087 LDKnativeShutdown *inner;
2089 * Indicates that this is the only struct which contains the same pointer.
2090 * Rust functions which take ownership of an object provided via an argument require
2091 * this to be true and invalidate the object pointed to by inner.
2099 * A channel_reestablish message to be sent or received from a peer
2101 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
2103 * A pointer to the opaque Rust object.
2104 * Nearly everywhere, inner must be non-null, however in places where
2105 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2107 LDKnativeChannelReestablish *inner;
2109 * Indicates that this is the only struct which contains the same pointer.
2110 * Rust functions which take ownership of an object provided via an argument require
2111 * this to be true and invalidate the object pointed to by inner.
2114 } LDKChannelReestablish;
2119 * A channel_announcement message to be sent or received from a peer
2121 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
2123 * A pointer to the opaque Rust object.
2124 * Nearly everywhere, inner must be non-null, however in places where
2125 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2127 LDKnativeChannelAnnouncement *inner;
2129 * Indicates that this is the only struct which contains the same pointer.
2130 * Rust functions which take ownership of an object provided via an argument require
2131 * this to be true and invalidate the object pointed to by inner.
2134 } LDKChannelAnnouncement;
2139 * A channel_update message to be sent or received from a peer
2141 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2143 * A pointer to the opaque Rust object.
2144 * Nearly everywhere, inner must be non-null, however in places where
2145 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2147 LDKnativeChannelUpdate *inner;
2149 * Indicates that this is the only struct which contains the same pointer.
2150 * Rust functions which take ownership of an object provided via an argument require
2151 * this to be true and invalidate the object pointed to by inner.
2159 * A node_announcement message to be sent or received from a peer
2161 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
2163 * A pointer to the opaque Rust object.
2164 * Nearly everywhere, inner must be non-null, however in places where
2165 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2167 LDKnativeNodeAnnouncement *inner;
2169 * Indicates that this is the only struct which contains the same pointer.
2170 * Rust functions which take ownership of an object provided via an argument require
2171 * this to be true and invalidate the object pointed to by inner.
2174 } LDKNodeAnnouncement;
2179 * An error message to be sent or received from a peer
2181 typedef struct MUST_USE_STRUCT LDKErrorMessage {
2183 * A pointer to the opaque Rust object.
2184 * Nearly everywhere, inner must be non-null, however in places where
2185 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2187 LDKnativeErrorMessage *inner;
2189 * Indicates that this is the only struct which contains the same pointer.
2190 * Rust functions which take ownership of an object provided via an argument require
2191 * this to be true and invalidate the object pointed to by inner.
2197 * Used to put an error message in a LightningError
2199 typedef enum LDKErrorAction_Tag {
2201 * The peer took some action which made us think they were useless. Disconnect them.
2203 LDKErrorAction_DisconnectPeer,
2205 * The peer did something harmless that we weren't able to process, just log and ignore
2207 LDKErrorAction_IgnoreError,
2209 * The peer did something harmless that we weren't able to meaningfully process.
2210 * If the error is logged, log it at the given level.
2212 LDKErrorAction_IgnoreAndLog,
2214 * The peer did something incorrect. Tell them.
2216 LDKErrorAction_SendErrorMessage,
2218 * Must be last for serialization purposes
2220 LDKErrorAction_Sentinel,
2221 } LDKErrorAction_Tag;
2223 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
2225 * An error message which we should make an effort to send before we disconnect.
2227 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2229 struct LDKErrorMessage msg;
2230 } LDKErrorAction_LDKDisconnectPeer_Body;
2232 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
2234 * The message to send.
2236 struct LDKErrorMessage msg;
2237 } LDKErrorAction_LDKSendErrorMessage_Body;
2239 typedef struct MUST_USE_STRUCT LDKErrorAction {
2240 LDKErrorAction_Tag tag;
2242 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
2244 enum LDKLevel ignore_and_log;
2246 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
2251 * The information we received from a peer along the route of a payment we originated. This is
2252 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
2253 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
2255 typedef enum LDKHTLCFailChannelUpdate_Tag {
2257 * We received an error which included a full ChannelUpdate message.
2259 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
2261 * We received an error which indicated only that a channel has been closed
2263 LDKHTLCFailChannelUpdate_ChannelClosed,
2265 * We received an error which indicated only that a node has failed
2267 LDKHTLCFailChannelUpdate_NodeFailure,
2269 * Must be last for serialization purposes
2271 LDKHTLCFailChannelUpdate_Sentinel,
2272 } LDKHTLCFailChannelUpdate_Tag;
2274 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
2276 * The unwrapped message we received
2278 struct LDKChannelUpdate msg;
2279 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
2281 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
2283 * The short_channel_id which has now closed.
2285 uint64_t short_channel_id;
2287 * when this true, this channel should be permanently removed from the
2288 * consideration. Otherwise, this channel can be restored as new channel_update is received
2291 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
2293 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
2295 * The node_id that has failed.
2297 struct LDKPublicKey node_id;
2299 * when this true, node should be permanently removed from the
2300 * consideration. Otherwise, the channels connected to this node can be
2301 * restored as new channel_update is received
2304 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
2306 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
2307 LDKHTLCFailChannelUpdate_Tag tag;
2309 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2310 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
2311 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
2313 } LDKHTLCFailChannelUpdate;
2318 * A query_channel_range message is used to query a peer for channel
2319 * UTXOs in a range of blocks. The recipient of a query makes a best
2320 * effort to reply to the query using one or more reply_channel_range
2323 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
2325 * A pointer to the opaque Rust object.
2326 * Nearly everywhere, inner must be non-null, however in places where
2327 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2329 LDKnativeQueryChannelRange *inner;
2331 * Indicates that this is the only struct which contains the same pointer.
2332 * Rust functions which take ownership of an object provided via an argument require
2333 * this to be true and invalidate the object pointed to by inner.
2336 } LDKQueryChannelRange;
2341 * A query_short_channel_ids message is used to query a peer for
2342 * routing gossip messages related to one or more short_channel_ids.
2343 * The query recipient will reply with the latest, if available,
2344 * channel_announcement, channel_update and node_announcement messages
2345 * it maintains for the requested short_channel_ids followed by a
2346 * reply_short_channel_ids_end message. The short_channel_ids sent in
2347 * this query are encoded. We only support encoding_type=0 uncompressed
2348 * serialization and do not support encoding_type=1 zlib serialization.
2350 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
2352 * A pointer to the opaque Rust object.
2353 * Nearly everywhere, inner must be non-null, however in places where
2354 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2356 LDKnativeQueryShortChannelIds *inner;
2358 * Indicates that this is the only struct which contains the same pointer.
2359 * Rust functions which take ownership of an object provided via an argument require
2360 * this to be true and invalidate the object pointed to by inner.
2363 } LDKQueryShortChannelIds;
2368 * A reply_channel_range message is a reply to a query_channel_range
2369 * message. Multiple reply_channel_range messages can be sent in reply
2370 * to a single query_channel_range message. The query recipient makes a
2371 * best effort to respond based on their local network view which may
2372 * not be a perfect view of the network. The short_channel_ids in the
2373 * reply are encoded. We only support encoding_type=0 uncompressed
2374 * serialization and do not support encoding_type=1 zlib serialization.
2376 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
2378 * A pointer to the opaque Rust object.
2379 * Nearly everywhere, inner must be non-null, however in places where
2380 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2382 LDKnativeReplyChannelRange *inner;
2384 * Indicates that this is the only struct which contains the same pointer.
2385 * Rust functions which take ownership of an object provided via an argument require
2386 * this to be true and invalidate the object pointed to by inner.
2389 } LDKReplyChannelRange;
2392 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
2393 * broadcast to most peers).
2394 * These events are handled by PeerManager::process_events if you are using a PeerManager.
2396 typedef enum LDKMessageSendEvent_Tag {
2398 * Used to indicate that we've accepted a channel open and should send the accept_channel
2399 * message provided to the given peer.
2401 LDKMessageSendEvent_SendAcceptChannel,
2403 * Used to indicate that we've initiated a channel open and should send the open_channel
2404 * message provided to the given peer.
2406 LDKMessageSendEvent_SendOpenChannel,
2408 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
2410 LDKMessageSendEvent_SendFundingCreated,
2412 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
2414 LDKMessageSendEvent_SendFundingSigned,
2416 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
2418 LDKMessageSendEvent_SendFundingLocked,
2420 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
2422 LDKMessageSendEvent_SendAnnouncementSignatures,
2424 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
2425 * message should be sent to the peer with the given node_id.
2427 LDKMessageSendEvent_UpdateHTLCs,
2429 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
2431 LDKMessageSendEvent_SendRevokeAndACK,
2433 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
2435 LDKMessageSendEvent_SendClosingSigned,
2437 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
2439 LDKMessageSendEvent_SendShutdown,
2441 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
2443 LDKMessageSendEvent_SendChannelReestablish,
2445 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
2446 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
2448 * Note that after doing so, you very likely (unless you did so very recently) want to call
2449 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
2450 * This ensures that any nodes which see our channel_announcement also have a relevant
2451 * node_announcement, including relevant feature flags which may be important for routing
2454 LDKMessageSendEvent_BroadcastChannelAnnouncement,
2456 * Used to indicate that a node_announcement should be broadcast to all peers.
2458 LDKMessageSendEvent_BroadcastNodeAnnouncement,
2460 * Used to indicate that a channel_update should be broadcast to all peers.
2462 LDKMessageSendEvent_BroadcastChannelUpdate,
2464 * Used to indicate that a channel_update should be sent to a single peer.
2465 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
2466 * private channel and we shouldn't be informing all of our peers of channel parameters.
2468 LDKMessageSendEvent_SendChannelUpdate,
2470 * Broadcast an error downstream to be handled
2472 LDKMessageSendEvent_HandleError,
2474 * When a payment fails we may receive updates back from the hop where it failed. In such
2475 * cases this event is generated so that we can inform the network graph of this information.
2477 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
2479 * Query a peer for channels with funding transaction UTXOs in a block range.
2481 LDKMessageSendEvent_SendChannelRangeQuery,
2483 * Request routing gossip messages from a peer for a list of channels identified by
2484 * their short_channel_ids.
2486 LDKMessageSendEvent_SendShortIdsQuery,
2488 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
2489 * emitted during processing of the query.
2491 LDKMessageSendEvent_SendReplyChannelRange,
2493 * Must be last for serialization purposes
2495 LDKMessageSendEvent_Sentinel,
2496 } LDKMessageSendEvent_Tag;
2498 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
2500 * The node_id of the node which should receive this message
2502 struct LDKPublicKey node_id;
2504 * The message which should be sent.
2506 struct LDKAcceptChannel msg;
2507 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
2509 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
2511 * The node_id of the node which should receive this message
2513 struct LDKPublicKey node_id;
2515 * The message which should be sent.
2517 struct LDKOpenChannel msg;
2518 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
2520 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
2522 * The node_id of the node which should receive this message
2524 struct LDKPublicKey node_id;
2526 * The message which should be sent.
2528 struct LDKFundingCreated msg;
2529 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
2531 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
2533 * The node_id of the node which should receive this message
2535 struct LDKPublicKey node_id;
2537 * The message which should be sent.
2539 struct LDKFundingSigned msg;
2540 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
2542 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
2544 * The node_id of the node which should receive these message(s)
2546 struct LDKPublicKey node_id;
2548 * The funding_locked message which should be sent.
2550 struct LDKFundingLocked msg;
2551 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
2553 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
2555 * The node_id of the node which should receive these message(s)
2557 struct LDKPublicKey node_id;
2559 * The announcement_signatures message which should be sent.
2561 struct LDKAnnouncementSignatures msg;
2562 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
2564 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
2566 * The node_id of the node which should receive these message(s)
2568 struct LDKPublicKey node_id;
2570 * The update messages which should be sent. ALL messages in the struct should be sent!
2572 struct LDKCommitmentUpdate updates;
2573 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
2575 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
2577 * The node_id of the node which should receive this message
2579 struct LDKPublicKey node_id;
2581 * The message which should be sent.
2583 struct LDKRevokeAndACK msg;
2584 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
2586 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
2588 * The node_id of the node which should receive this message
2590 struct LDKPublicKey node_id;
2592 * The message which should be sent.
2594 struct LDKClosingSigned msg;
2595 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
2597 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
2599 * The node_id of the node which should receive this message
2601 struct LDKPublicKey node_id;
2603 * The message which should be sent.
2605 struct LDKShutdown msg;
2606 } LDKMessageSendEvent_LDKSendShutdown_Body;
2608 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
2610 * The node_id of the node which should receive this message
2612 struct LDKPublicKey node_id;
2614 * The message which should be sent.
2616 struct LDKChannelReestablish msg;
2617 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
2619 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
2621 * The channel_announcement which should be sent.
2623 struct LDKChannelAnnouncement msg;
2625 * The followup channel_update which should be sent.
2627 struct LDKChannelUpdate update_msg;
2628 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
2630 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
2632 * The node_announcement which should be sent.
2634 struct LDKNodeAnnouncement msg;
2635 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
2637 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
2639 * The channel_update which should be sent.
2641 struct LDKChannelUpdate msg;
2642 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
2644 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
2646 * The node_id of the node which should receive this message
2648 struct LDKPublicKey node_id;
2650 * The channel_update which should be sent.
2652 struct LDKChannelUpdate msg;
2653 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
2655 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
2657 * The node_id of the node which should receive this message
2659 struct LDKPublicKey node_id;
2661 * The action which should be taken.
2663 struct LDKErrorAction action;
2664 } LDKMessageSendEvent_LDKHandleError_Body;
2666 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
2668 * The channel/node update which should be sent to NetGraphMsgHandler
2670 struct LDKHTLCFailChannelUpdate update;
2671 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
2673 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
2675 * The node_id of this message recipient
2677 struct LDKPublicKey node_id;
2679 * The query_channel_range which should be sent.
2681 struct LDKQueryChannelRange msg;
2682 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
2684 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
2686 * The node_id of this message recipient
2688 struct LDKPublicKey node_id;
2690 * The query_short_channel_ids which should be sent.
2692 struct LDKQueryShortChannelIds msg;
2693 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
2695 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
2697 * The node_id of this message recipient
2699 struct LDKPublicKey node_id;
2701 * The reply_channel_range which should be sent.
2703 struct LDKReplyChannelRange msg;
2704 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
2706 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
2707 LDKMessageSendEvent_Tag tag;
2709 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
2710 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
2711 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
2712 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
2713 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
2714 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
2715 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
2716 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
2717 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
2718 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
2719 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
2720 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
2721 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
2722 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
2723 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
2724 LDKMessageSendEvent_LDKHandleError_Body handle_error;
2725 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
2726 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
2727 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
2728 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
2730 } LDKMessageSendEvent;
2733 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
2734 * This corresponds to std::vector in C++
2736 typedef struct LDKCVec_MessageSendEventZ {
2738 * The elements in the array.
2739 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2741 struct LDKMessageSendEvent *data;
2743 * The number of elements pointed to by `data`.
2746 } LDKCVec_MessageSendEventZ;
2751 * Features used within an `init` message.
2753 typedef struct MUST_USE_STRUCT LDKInitFeatures {
2755 * A pointer to the opaque Rust object.
2756 * Nearly everywhere, inner must be non-null, however in places where
2757 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2759 LDKnativeInitFeatures *inner;
2761 * Indicates that this is the only struct which contains the same pointer.
2762 * Rust functions which take ownership of an object provided via an argument require
2763 * this to be true and invalidate the object pointed to by inner.
2769 * The contents of CResult_InitFeaturesDecodeErrorZ
2771 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
2773 * A pointer to the contents in the success state.
2774 * Reading from this pointer when `result_ok` is not set is undefined.
2776 struct LDKInitFeatures *result;
2778 * A pointer to the contents in the error state.
2779 * Reading from this pointer when `result_ok` is set is undefined.
2781 struct LDKDecodeError *err;
2782 } LDKCResult_InitFeaturesDecodeErrorZPtr;
2785 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
2786 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
2787 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2789 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
2791 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
2792 * `err` or `result` depending on the state of `result_ok`.
2794 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
2796 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
2799 } LDKCResult_InitFeaturesDecodeErrorZ;
2804 * Features used within a `node_announcement` message.
2806 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
2808 * A pointer to the opaque Rust object.
2809 * Nearly everywhere, inner must be non-null, however in places where
2810 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2812 LDKnativeNodeFeatures *inner;
2814 * Indicates that this is the only struct which contains the same pointer.
2815 * Rust functions which take ownership of an object provided via an argument require
2816 * this to be true and invalidate the object pointed to by inner.
2822 * The contents of CResult_NodeFeaturesDecodeErrorZ
2824 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
2826 * A pointer to the contents in the success state.
2827 * Reading from this pointer when `result_ok` is not set is undefined.
2829 struct LDKNodeFeatures *result;
2831 * A pointer to the contents in the error state.
2832 * Reading from this pointer when `result_ok` is set is undefined.
2834 struct LDKDecodeError *err;
2835 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
2838 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
2839 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
2840 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2842 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
2844 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
2845 * `err` or `result` depending on the state of `result_ok`.
2847 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
2849 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
2852 } LDKCResult_NodeFeaturesDecodeErrorZ;
2857 * Features used within a `channel_announcement` message.
2859 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
2861 * A pointer to the opaque Rust object.
2862 * Nearly everywhere, inner must be non-null, however in places where
2863 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2865 LDKnativeChannelFeatures *inner;
2867 * Indicates that this is the only struct which contains the same pointer.
2868 * Rust functions which take ownership of an object provided via an argument require
2869 * this to be true and invalidate the object pointed to by inner.
2872 } LDKChannelFeatures;
2875 * The contents of CResult_ChannelFeaturesDecodeErrorZ
2877 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
2879 * A pointer to the contents in the success state.
2880 * Reading from this pointer when `result_ok` is not set is undefined.
2882 struct LDKChannelFeatures *result;
2884 * A pointer to the contents in the error state.
2885 * Reading from this pointer when `result_ok` is set is undefined.
2887 struct LDKDecodeError *err;
2888 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
2891 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
2892 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
2893 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2895 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
2897 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
2898 * `err` or `result` depending on the state of `result_ok`.
2900 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
2902 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
2905 } LDKCResult_ChannelFeaturesDecodeErrorZ;
2910 * Features used within an invoice.
2912 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
2914 * A pointer to the opaque Rust object.
2915 * Nearly everywhere, inner must be non-null, however in places where
2916 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2918 LDKnativeInvoiceFeatures *inner;
2920 * Indicates that this is the only struct which contains the same pointer.
2921 * Rust functions which take ownership of an object provided via an argument require
2922 * this to be true and invalidate the object pointed to by inner.
2925 } LDKInvoiceFeatures;
2928 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
2930 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
2932 * A pointer to the contents in the success state.
2933 * Reading from this pointer when `result_ok` is not set is undefined.
2935 struct LDKInvoiceFeatures *result;
2937 * A pointer to the contents in the error state.
2938 * Reading from this pointer when `result_ok` is set is undefined.
2940 struct LDKDecodeError *err;
2941 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
2944 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
2945 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
2946 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2948 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
2950 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
2951 * `err` or `result` depending on the state of `result_ok`.
2953 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
2955 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
2958 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
2961 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
2963 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
2965 * A pointer to the contents in the success state.
2966 * Reading from this pointer when `result_ok` is not set is undefined.
2968 struct LDKDelayedPaymentOutputDescriptor *result;
2970 * A pointer to the contents in the error state.
2971 * Reading from this pointer when `result_ok` is set is undefined.
2973 struct LDKDecodeError *err;
2974 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
2977 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2978 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2979 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2981 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
2983 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
2984 * `err` or `result` depending on the state of `result_ok`.
2986 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
2988 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
2991 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
2994 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
2996 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
2998 * A pointer to the contents in the success state.
2999 * Reading from this pointer when `result_ok` is not set is undefined.
3001 struct LDKStaticPaymentOutputDescriptor *result;
3003 * A pointer to the contents in the error state.
3004 * Reading from this pointer when `result_ok` is set is undefined.
3006 struct LDKDecodeError *err;
3007 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
3010 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
3011 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
3012 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3014 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
3016 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
3017 * `err` or `result` depending on the state of `result_ok`.
3019 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
3021 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
3024 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
3027 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
3029 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
3031 * A pointer to the contents in the success state.
3032 * Reading from this pointer when `result_ok` is not set is undefined.
3034 struct LDKSpendableOutputDescriptor *result;
3036 * A pointer to the contents in the error state.
3037 * Reading from this pointer when `result_ok` is set is undefined.
3039 struct LDKDecodeError *err;
3040 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
3043 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
3044 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
3045 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3047 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
3049 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
3050 * `err` or `result` depending on the state of `result_ok`.
3052 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
3054 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
3057 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
3060 * A tuple of 2 elements. See the individual fields for the types contained.
3062 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
3064 * The element at position 0
3066 struct LDKSignature a;
3068 * The element at position 1
3070 struct LDKCVec_SignatureZ b;
3071 } LDKC2Tuple_SignatureCVec_SignatureZZ;
3074 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
3076 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3078 * A pointer to the contents in the success state.
3079 * Reading from this pointer when `result_ok` is not set is undefined.
3081 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
3083 * Note that this value is always NULL, as there are no contents in the Err variant
3086 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
3089 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
3090 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
3091 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3093 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3095 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
3096 * `err` or `result` depending on the state of `result_ok`.
3098 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
3100 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
3103 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
3106 * The contents of CResult_SignatureNoneZ
3108 typedef union LDKCResult_SignatureNoneZPtr {
3110 * A pointer to the contents in the success state.
3111 * Reading from this pointer when `result_ok` is not set is undefined.
3113 struct LDKSignature *result;
3115 * Note that this value is always NULL, as there are no contents in the Err variant
3118 } LDKCResult_SignatureNoneZPtr;
3121 * A CResult_SignatureNoneZ represents the result of a fallible operation,
3122 * containing a crate::c_types::Signature on success and a () on failure.
3123 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3125 typedef struct LDKCResult_SignatureNoneZ {
3127 * The contents of this CResult_SignatureNoneZ, accessible via either
3128 * `err` or `result` depending on the state of `result_ok`.
3130 union LDKCResult_SignatureNoneZPtr contents;
3132 * Whether this CResult_SignatureNoneZ represents a success state.
3135 } LDKCResult_SignatureNoneZ;
3140 * The unsigned part of a channel_announcement
3142 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
3144 * A pointer to the opaque Rust object.
3145 * Nearly everywhere, inner must be non-null, however in places where
3146 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3148 LDKnativeUnsignedChannelAnnouncement *inner;
3150 * Indicates that this is the only struct which contains the same pointer.
3151 * Rust functions which take ownership of an object provided via an argument require
3152 * this to be true and invalidate the object pointed to by inner.
3155 } LDKUnsignedChannelAnnouncement;
3158 * A trait to sign lightning channel transactions as described in BOLT 3.
3160 * Signing services could be implemented on a hardware wallet. In this case,
3161 * the current Sign would be a front-end on top of a communication
3162 * channel connected to your secure device and lightning key material wouldn't
3163 * reside on a hot server. Nevertheless, a this deployment would still need
3164 * to trust the ChannelManager to avoid loss of funds as this latest component
3165 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
3167 * A more secure iteration would be to use hashlock (or payment points) to pair
3168 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
3169 * at the price of more state and computation on the hardware wallet side. In the future,
3170 * we are looking forward to design such interface.
3172 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
3173 * to act, as liveness and breach reply correctness are always going to be hard requirements
3174 * of LN security model, orthogonal of key management issues.
3176 typedef struct LDKBaseSign {
3178 * An opaque pointer which is passed to your function implementations as an argument.
3179 * This has no meaning in the LDK, and can be NULL or any other value.
3183 * Gets the per-commitment point for a specific commitment number
3185 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
3187 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
3189 * Gets the commitment secret for a specific commitment number as part of the revocation process
3191 * An external signer implementation should error here if the commitment was already signed
3192 * and should refuse to sign it in the future.
3194 * May be called more than once for the same index.
3196 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
3198 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
3200 * Gets the holder's channel public keys and basepoints
3202 struct LDKChannelPublicKeys pubkeys;
3204 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
3205 * Note that this takes a pointer to this object, not the this_ptr like other methods do
3206 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
3208 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
3210 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
3211 * some SpendableOutputDescriptor types. This should be sufficient to identify this
3212 * Sign object uniquely and lookup or re-derive its keys.
3214 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
3216 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
3218 * Note that if signing fails or is rejected, the channel will be force-closed.
3220 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
3222 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
3223 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
3224 * latest commitment_tx when we initiate a force-close.
3225 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
3226 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
3228 * This may be called multiple times for the same transaction.
3230 * An external signer implementation should check that the commitment has not been revoked.
3232 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
3234 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
3236 * Create a signature for the given input in a transaction spending an HTLC transaction output
3237 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
3239 * A justice transaction may claim multiple outputs at the same time if timelocks are
3240 * similar, but only a signature for the input at index `input` should be signed for here.
3241 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3242 * to an upcoming timelock expiration.
3244 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3246 * per_commitment_key is revocation secret which was provided by our counterparty when they
3247 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3248 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3251 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]);
3253 * Create a signature for the given input in a transaction spending a commitment transaction
3254 * HTLC output when our counterparty broadcasts an old state.
3256 * A justice transaction may claim multiple outputs at the same time if timelocks are
3257 * similar, but only a signature for the input at index `input` should be signed for here.
3258 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3259 * to an upcoming timelock expiration.
3261 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3263 * per_commitment_key is revocation secret which was provided by our counterparty when they
3264 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3265 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3268 * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
3269 * (which is committed to in the BIP 143 signatures).
3271 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);
3273 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
3274 * transaction, either offered or received.
3276 * Such a transaction may claim multiples offered outputs at same time if we know the
3277 * preimage for each when we create it, but only the input at index `input` should be
3278 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
3279 * needed with regards to an upcoming timelock expiration.
3281 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
3284 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3286 * Per_commitment_point is the dynamic point corresponding to the channel state
3287 * detected onchain. It has been generated by our counterparty and is used to derive
3288 * channel state keys, which are then included in the witness script and committed to in the
3289 * BIP 143 signature.
3291 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);
3293 * Create a signature for a (proposed) closing transaction.
3295 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
3296 * chosen to forgo their output as dust.
3298 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
3300 * Signs a channel announcement message with our funding key, proving it comes from one
3301 * of the channel participants.
3303 * Note that if this fails or is rejected, the channel will not be publicly announced and
3304 * our counterparty may (though likely will not) close the channel on us for violating the
3307 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
3309 * Set the counterparty static channel data, including basepoints,
3310 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
3311 * This is done as soon as the funding outpoint is known. Since these are static channel data,
3312 * they MUST NOT be allowed to change to different values once set.
3314 * channel_parameters.is_populated() MUST be true.
3316 * We bind holder_selected_contest_delay late here for API convenience.
3318 * Will be called before any signatures are applied.
3320 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
3322 * Frees any resources associated with this object given its this_arg pointer.
3323 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3325 void (*free)(void *this_arg);
3329 * A cloneable signer.
3331 * Although we require signers to be cloneable, it may be useful for developers to be able to use
3332 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
3333 * which implies Sized, into this derived trait.
3335 typedef struct LDKSign {
3337 * An opaque pointer which is passed to your function implementations as an argument.
3338 * This has no meaning in the LDK, and can be NULL or any other value.
3342 * Implementation of BaseSign for this object.
3344 struct LDKBaseSign BaseSign;
3346 * Serialize the object into a byte array
3348 struct LDKCVec_u8Z (*write)(const void *this_arg);
3350 * Called, if set, after this Sign has been cloned into a duplicate object.
3351 * The new Sign is provided, and should be mutated as needed to perform a
3352 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
3354 void (*cloned)(struct LDKSign *NONNULL_PTR new_Sign);
3356 * Frees any resources associated with this object given its this_arg pointer.
3357 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3359 void (*free)(void *this_arg);
3363 * The contents of CResult_SignDecodeErrorZ
3365 typedef union LDKCResult_SignDecodeErrorZPtr {
3367 * A pointer to the contents in the success state.
3368 * Reading from this pointer when `result_ok` is not set is undefined.
3370 struct LDKSign *result;
3372 * A pointer to the contents in the error state.
3373 * Reading from this pointer when `result_ok` is set is undefined.
3375 struct LDKDecodeError *err;
3376 } LDKCResult_SignDecodeErrorZPtr;
3379 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
3380 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
3381 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3383 typedef struct LDKCResult_SignDecodeErrorZ {
3385 * The contents of this CResult_SignDecodeErrorZ, accessible via either
3386 * `err` or `result` depending on the state of `result_ok`.
3388 union LDKCResult_SignDecodeErrorZPtr contents;
3390 * Whether this CResult_SignDecodeErrorZ represents a success state.
3393 } LDKCResult_SignDecodeErrorZ;
3396 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
3397 * allows recovering the exact public key which created the signature given the message.
3399 typedef struct LDKRecoverableSignature {
3401 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
3404 uint8_t serialized_form[68];
3405 } LDKRecoverableSignature;
3408 * The contents of CResult_RecoverableSignatureNoneZ
3410 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
3412 * A pointer to the contents in the success state.
3413 * Reading from this pointer when `result_ok` is not set is undefined.
3415 struct LDKRecoverableSignature *result;
3417 * Note that this value is always NULL, as there are no contents in the Err variant
3420 } LDKCResult_RecoverableSignatureNoneZPtr;
3423 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
3424 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
3425 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3427 typedef struct LDKCResult_RecoverableSignatureNoneZ {
3429 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
3430 * `err` or `result` depending on the state of `result_ok`.
3432 union LDKCResult_RecoverableSignatureNoneZPtr contents;
3434 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
3437 } LDKCResult_RecoverableSignatureNoneZ;
3440 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
3441 * This corresponds to std::vector in C++
3443 typedef struct LDKCVec_CVec_u8ZZ {
3445 * The elements in the array.
3446 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3448 struct LDKCVec_u8Z *data;
3450 * The number of elements pointed to by `data`.
3453 } LDKCVec_CVec_u8ZZ;
3456 * The contents of CResult_CVec_CVec_u8ZZNoneZ
3458 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
3460 * A pointer to the contents in the success state.
3461 * Reading from this pointer when `result_ok` is not set is undefined.
3463 struct LDKCVec_CVec_u8ZZ *result;
3465 * Note that this value is always NULL, as there are no contents in the Err variant
3468 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
3471 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
3472 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
3473 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3475 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
3477 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
3478 * `err` or `result` depending on the state of `result_ok`.
3480 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
3482 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
3485 } LDKCResult_CVec_CVec_u8ZZNoneZ;
3490 * A simple implementation of Sign that just keeps the private keys in memory.
3492 * This implementation performs no policy checks and is insufficient by itself as
3493 * a secure external signer.
3495 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3497 * A pointer to the opaque Rust object.
3498 * Nearly everywhere, inner must be non-null, however in places where
3499 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3501 LDKnativeInMemorySigner *inner;
3503 * Indicates that this is the only struct which contains the same pointer.
3504 * Rust functions which take ownership of an object provided via an argument require
3505 * this to be true and invalidate the object pointed to by inner.
3508 } LDKInMemorySigner;
3511 * The contents of CResult_InMemorySignerDecodeErrorZ
3513 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3515 * A pointer to the contents in the success state.
3516 * Reading from this pointer when `result_ok` is not set is undefined.
3518 struct LDKInMemorySigner *result;
3520 * A pointer to the contents in the error state.
3521 * Reading from this pointer when `result_ok` is set is undefined.
3523 struct LDKDecodeError *err;
3524 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3527 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
3528 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3529 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3531 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3533 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
3534 * `err` or `result` depending on the state of `result_ok`.
3536 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3538 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
3541 } LDKCResult_InMemorySignerDecodeErrorZ;
3544 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
3545 * This corresponds to std::vector in C++
3547 typedef struct LDKCVec_TxOutZ {
3549 * The elements in the array.
3550 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3552 struct LDKTxOut *data;
3554 * The number of elements pointed to by `data`.
3560 * The contents of CResult_TransactionNoneZ
3562 typedef union LDKCResult_TransactionNoneZPtr {
3564 * A pointer to the contents in the success state.
3565 * Reading from this pointer when `result_ok` is not set is undefined.
3567 struct LDKTransaction *result;
3569 * Note that this value is always NULL, as there are no contents in the Err variant
3572 } LDKCResult_TransactionNoneZPtr;
3575 * A CResult_TransactionNoneZ represents the result of a fallible operation,
3576 * containing a crate::c_types::Transaction on success and a () on failure.
3577 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3579 typedef struct LDKCResult_TransactionNoneZ {
3581 * The contents of this CResult_TransactionNoneZ, accessible via either
3582 * `err` or `result` depending on the state of `result_ok`.
3584 union LDKCResult_TransactionNoneZPtr contents;
3586 * Whether this CResult_TransactionNoneZ represents a success state.
3589 } LDKCResult_TransactionNoneZ;
3594 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
3595 * on-chain transactions to ensure no loss of funds occurs.
3597 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
3598 * information and are actively monitoring the chain.
3600 * Pending Events or updated HTLCs which have not yet been read out by
3601 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
3602 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
3603 * gotten are fully handled before re-serializing the new state.
3605 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
3606 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
3607 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
3608 * returned block hash and the the current chain and then reconnecting blocks to get to the
3609 * best chain) upon deserializing the object!
3611 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
3613 * A pointer to the opaque Rust object.
3614 * Nearly everywhere, inner must be non-null, however in places where
3615 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3617 LDKnativeChannelMonitor *inner;
3619 * Indicates that this is the only struct which contains the same pointer.
3620 * Rust functions which take ownership of an object provided via an argument require
3621 * this to be true and invalidate the object pointed to by inner.
3624 } LDKChannelMonitor;
3627 * A tuple of 2 elements. See the individual fields for the types contained.
3629 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
3631 * The element at position 0
3633 struct LDKThirtyTwoBytes a;
3635 * The element at position 1
3637 struct LDKChannelMonitor b;
3638 } LDKC2Tuple_BlockHashChannelMonitorZ;
3641 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
3642 * This corresponds to std::vector in C++
3644 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
3646 * The elements in the array.
3647 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3649 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
3651 * The number of elements pointed to by `data`.
3654 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
3657 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
3659 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
3661 * A pointer to the contents in the success state.
3662 * Reading from this pointer when `result_ok` is not set is undefined.
3664 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
3666 * A pointer to the contents in the error state.
3667 * Reading from this pointer when `result_ok` is set is undefined.
3669 enum LDKIOError *err;
3670 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
3673 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
3674 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
3675 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3677 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
3679 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
3680 * `err` or `result` depending on the state of `result_ok`.
3682 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
3684 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
3687 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
3690 * An enum which can either contain a u16 or not
3692 typedef enum LDKCOption_u16Z_Tag {
3694 * When we're in this state, this COption_u16Z contains a u16
3696 LDKCOption_u16Z_Some,
3698 * When we're in this state, this COption_u16Z contains nothing
3700 LDKCOption_u16Z_None,
3702 * Must be last for serialization purposes
3704 LDKCOption_u16Z_Sentinel,
3705 } LDKCOption_u16Z_Tag;
3707 typedef struct LDKCOption_u16Z {
3708 LDKCOption_u16Z_Tag tag;
3717 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
3720 typedef enum LDKAPIError_Tag {
3722 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
3723 * are documented, but generally indicates some precondition of a function was violated.
3725 LDKAPIError_APIMisuseError,
3727 * Due to a high feerate, we were unable to complete the request.
3728 * For example, this may be returned if the feerate implies we cannot open a channel at the
3729 * requested value, but opening a larger channel would succeed.
3731 LDKAPIError_FeeRateTooHigh,
3733 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
3734 * too-many-hops, etc).
3736 LDKAPIError_RouteError,
3738 * We were unable to complete the request as the Channel required to do so is unable to
3739 * complete the request (or was not found). This can take many forms, including disconnected
3740 * peer, channel at capacity, channel shutting down, etc.
3742 LDKAPIError_ChannelUnavailable,
3744 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
3745 * attempted action to fail.
3747 LDKAPIError_MonitorUpdateFailed,
3749 * Must be last for serialization purposes
3751 LDKAPIError_Sentinel,
3754 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
3756 * A human-readable error message
3759 } LDKAPIError_LDKAPIMisuseError_Body;
3761 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
3763 * A human-readable error message
3767 * The feerate which was too high.
3770 } LDKAPIError_LDKFeeRateTooHigh_Body;
3772 typedef struct LDKAPIError_LDKRouteError_Body {
3774 * A human-readable error message
3777 } LDKAPIError_LDKRouteError_Body;
3779 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
3781 * A human-readable error message
3784 } LDKAPIError_LDKChannelUnavailable_Body;
3786 typedef struct MUST_USE_STRUCT LDKAPIError {
3787 LDKAPIError_Tag tag;
3789 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
3790 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
3791 LDKAPIError_LDKRouteError_Body route_error;
3792 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
3797 * The contents of CResult_NoneAPIErrorZ
3799 typedef union LDKCResult_NoneAPIErrorZPtr {
3801 * Note that this value is always NULL, as there are no contents in the OK variant
3805 * A pointer to the contents in the error state.
3806 * Reading from this pointer when `result_ok` is set is undefined.
3808 struct LDKAPIError *err;
3809 } LDKCResult_NoneAPIErrorZPtr;
3812 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
3813 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
3814 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3816 typedef struct LDKCResult_NoneAPIErrorZ {
3818 * The contents of this CResult_NoneAPIErrorZ, accessible via either
3819 * `err` or `result` depending on the state of `result_ok`.
3821 union LDKCResult_NoneAPIErrorZPtr contents;
3823 * Whether this CResult_NoneAPIErrorZ represents a success state.
3826 } LDKCResult_NoneAPIErrorZ;
3829 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
3830 * This corresponds to std::vector in C++
3832 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
3834 * The elements in the array.
3835 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3837 struct LDKCResult_NoneAPIErrorZ *data;
3839 * The number of elements pointed to by `data`.
3842 } LDKCVec_CResult_NoneAPIErrorZZ;
3845 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
3846 * This corresponds to std::vector in C++
3848 typedef struct LDKCVec_APIErrorZ {
3850 * The elements in the array.
3851 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3853 struct LDKAPIError *data;
3855 * The number of elements pointed to by `data`.
3858 } LDKCVec_APIErrorZ;
3861 * If a payment fails to send, it can be in one of several states. This enum is returned as the
3862 * Err() type describing which state the payment is in, see the description of individual enum
3865 typedef enum LDKPaymentSendFailure_Tag {
3867 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
3868 * send the payment at all. No channel state has been changed or messages sent to peers, and
3869 * once you've changed the parameter at error, you can freely retry the payment in full.
3871 LDKPaymentSendFailure_ParameterError,
3873 * A parameter in a single path which was passed to send_payment was invalid, preventing us
3874 * from attempting to send the payment at all. No channel state has been changed or messages
3875 * sent to peers, and once you've changed the parameter at error, you can freely retry the
3878 * The results here are ordered the same as the paths in the route object which was passed to
3881 LDKPaymentSendFailure_PathParameterError,
3883 * All paths which were attempted failed to send, with no channel state change taking place.
3884 * You can freely retry the payment in full (though you probably want to do so over different
3885 * paths than the ones selected).
3887 LDKPaymentSendFailure_AllFailedRetrySafe,
3889 * Some paths which were attempted failed to send, though possibly not all. At least some
3890 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
3891 * in over-/re-payment.
3893 * The results here are ordered the same as the paths in the route object which was passed to
3894 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
3895 * retried (though there is currently no API with which to do so).
3897 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
3898 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
3899 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
3900 * with the latest update_id.
3902 LDKPaymentSendFailure_PartialFailure,
3904 * Must be last for serialization purposes
3906 LDKPaymentSendFailure_Sentinel,
3907 } LDKPaymentSendFailure_Tag;
3909 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
3910 LDKPaymentSendFailure_Tag tag;
3913 struct LDKAPIError parameter_error;
3916 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
3919 struct LDKCVec_APIErrorZ all_failed_retry_safe;
3922 struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
3925 } LDKPaymentSendFailure;
3928 * The contents of CResult_NonePaymentSendFailureZ
3930 typedef union LDKCResult_NonePaymentSendFailureZPtr {
3932 * Note that this value is always NULL, as there are no contents in the OK variant
3936 * A pointer to the contents in the error state.
3937 * Reading from this pointer when `result_ok` is set is undefined.
3939 struct LDKPaymentSendFailure *err;
3940 } LDKCResult_NonePaymentSendFailureZPtr;
3943 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
3944 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
3945 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3947 typedef struct LDKCResult_NonePaymentSendFailureZ {
3949 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
3950 * `err` or `result` depending on the state of `result_ok`.
3952 union LDKCResult_NonePaymentSendFailureZPtr contents;
3954 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
3957 } LDKCResult_NonePaymentSendFailureZ;
3960 * A 4-byte byte array.
3962 typedef struct LDKFourBytes {
3970 * A 16-byte byte array.
3972 typedef struct LDKSixteenBytes {
3980 * A 10-byte byte array.
3982 typedef struct LDKTenBytes {
3990 * An address which can be used to connect to a remote peer
3992 typedef enum LDKNetAddress_Tag {
3994 * An IPv4 address/port on which the peer is listening.
3998 * An IPv6 address/port on which the peer is listening.
4002 * An old-style Tor onion address/port on which the peer is listening.
4004 LDKNetAddress_OnionV2,
4006 * A new-style Tor onion address/port on which the peer is listening.
4007 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
4008 * wrap as base32 and append \".onion\".
4010 LDKNetAddress_OnionV3,
4012 * Must be last for serialization purposes
4014 LDKNetAddress_Sentinel,
4015 } LDKNetAddress_Tag;
4017 typedef struct LDKNetAddress_LDKIPv4_Body {
4019 * The 4-byte IPv4 address
4021 struct LDKFourBytes addr;
4023 * The port on which the node is listening
4026 } LDKNetAddress_LDKIPv4_Body;
4028 typedef struct LDKNetAddress_LDKIPv6_Body {
4030 * The 16-byte IPv6 address
4032 struct LDKSixteenBytes addr;
4034 * The port on which the node is listening
4037 } LDKNetAddress_LDKIPv6_Body;
4039 typedef struct LDKNetAddress_LDKOnionV2_Body {
4041 * The bytes (usually encoded in base32 with \".onion\" appended)
4043 struct LDKTenBytes addr;
4045 * The port on which the node is listening
4048 } LDKNetAddress_LDKOnionV2_Body;
4050 typedef struct LDKNetAddress_LDKOnionV3_Body {
4052 * The ed25519 long-term public key of the peer
4054 struct LDKThirtyTwoBytes ed25519_pubkey;
4056 * The checksum of the pubkey and version, as included in the onion address
4060 * The version byte, as defined by the Tor Onion v3 spec.
4064 * The port on which the node is listening
4067 } LDKNetAddress_LDKOnionV3_Body;
4069 typedef struct MUST_USE_STRUCT LDKNetAddress {
4070 LDKNetAddress_Tag tag;
4072 LDKNetAddress_LDKIPv4_Body i_pv4;
4073 LDKNetAddress_LDKIPv6_Body i_pv6;
4074 LDKNetAddress_LDKOnionV2_Body onion_v2;
4075 LDKNetAddress_LDKOnionV3_Body onion_v3;
4080 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
4081 * This corresponds to std::vector in C++
4083 typedef struct LDKCVec_NetAddressZ {
4085 * The elements in the array.
4086 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4088 struct LDKNetAddress *data;
4090 * The number of elements pointed to by `data`.
4093 } LDKCVec_NetAddressZ;
4096 * A tuple of 2 elements. See the individual fields for the types contained.
4098 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
4100 * The element at position 0
4102 struct LDKThirtyTwoBytes a;
4104 * The element at position 1
4106 struct LDKThirtyTwoBytes b;
4107 } LDKC2Tuple_PaymentHashPaymentSecretZ;
4110 * The contents of CResult_PaymentSecretAPIErrorZ
4112 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
4114 * A pointer to the contents in the success state.
4115 * Reading from this pointer when `result_ok` is not set is undefined.
4117 struct LDKThirtyTwoBytes *result;
4119 * A pointer to the contents in the error state.
4120 * Reading from this pointer when `result_ok` is set is undefined.
4122 struct LDKAPIError *err;
4123 } LDKCResult_PaymentSecretAPIErrorZPtr;
4126 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
4127 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
4128 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4130 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
4132 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
4133 * `err` or `result` depending on the state of `result_ok`.
4135 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
4137 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
4140 } LDKCResult_PaymentSecretAPIErrorZ;
4143 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
4144 * This corresponds to std::vector in C++
4146 typedef struct LDKCVec_ChannelMonitorZ {
4148 * The elements in the array.
4149 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4151 struct LDKChannelMonitor *data;
4153 * The number of elements pointed to by `data`.
4156 } LDKCVec_ChannelMonitorZ;
4161 * An update generated by the underlying Channel itself which contains some new information the
4162 * ChannelMonitor should be made aware of.
4164 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
4166 * A pointer to the opaque Rust object.
4167 * Nearly everywhere, inner must be non-null, however in places where
4168 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4170 LDKnativeChannelMonitorUpdate *inner;
4172 * Indicates that this is the only struct which contains the same pointer.
4173 * Rust functions which take ownership of an object provided via an argument require
4174 * this to be true and invalidate the object pointed to by inner.
4177 } LDKChannelMonitorUpdate;
4180 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
4181 * blocks are connected and disconnected.
4183 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
4184 * responsible for maintaining a set of monitors such that they can be updated accordingly as
4185 * channel state changes and HTLCs are resolved. See method documentation for specific
4188 * Implementations **must** ensure that updates are successfully applied and persisted upon method
4189 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
4190 * without taking any further action such as persisting the current state.
4192 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
4193 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
4194 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
4195 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
4196 * multiple instances.
4198 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
4199 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
4200 * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
4202 typedef struct LDKWatch {
4204 * An opaque pointer which is passed to your function implementations as an argument.
4205 * This has no meaning in the LDK, and can be NULL or any other value.
4209 * Watches a channel identified by `funding_txo` using `monitor`.
4211 * Implementations are responsible for watching the chain for the funding transaction along
4212 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
4213 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
4215 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
4216 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
4217 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
4219 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
4221 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
4223 * Implementations must call [`update_monitor`] with the given update. See
4224 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
4226 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
4227 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
4229 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
4231 * Returns any monitor events since the last call. Subsequent calls must only return new
4234 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
4236 * Frees any resources associated with this object given its this_arg pointer.
4237 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4239 void (*free)(void *this_arg);
4243 * An interface to send a transaction to the Bitcoin network.
4245 typedef struct LDKBroadcasterInterface {
4247 * An opaque pointer which is passed to your function implementations as an argument.
4248 * This has no meaning in the LDK, and can be NULL or any other value.
4252 * Sends a transaction out to (hopefully) be mined.
4254 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
4256 * Frees any resources associated with this object given its this_arg pointer.
4257 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4259 void (*free)(void *this_arg);
4260 } LDKBroadcasterInterface;
4263 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
4264 * own the memory pointed to by data.
4266 typedef struct LDKu8slice {
4268 * A pointer to the byte buffer
4270 const uint8_t *data;
4272 * The number of bytes pointed to by `data`.
4278 * A trait to describe an object which can get user secrets and key material.
4280 typedef struct LDKKeysInterface {
4282 * An opaque pointer which is passed to your function implementations as an argument.
4283 * This has no meaning in the LDK, and can be NULL or any other value.
4287 * Get node secret key (aka node_id or network_key).
4289 * This method must return the same value each time it is called.
4291 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
4293 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
4295 * This method should return a different value each time it is called, to avoid linking
4296 * on-chain funds across channels as controlled to the same user.
4298 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
4300 * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
4303 * This method should return a different value each time it is called, to avoid linking
4304 * on-chain funds across channels as controlled to the same user.
4306 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
4308 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
4309 * restarted with some stale data!
4311 * This method must return a different value each time it is called.
4313 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
4315 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
4316 * onion packets and for temporary channel IDs. There is no requirement that these be
4317 * persisted anywhere, though they must be unique across restarts.
4319 * This method must return a different value each time it is called.
4321 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
4323 * Reads a `Signer` for this `KeysInterface` from the given input stream.
4324 * This is only called during deserialization of other objects which contain
4325 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
4326 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
4327 * contain no versioning scheme. You may wish to include your own version prefix and ensure
4328 * you've read all of the provided bytes to ensure no corruption occurred.
4330 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
4332 * Sign an invoice's preimage (note that this is the preimage of the invoice, not the HTLC's
4333 * preimage). By parameterizing by the preimage instead of the hash, we allow implementors of
4334 * this trait to parse the invoice and make sure they're signing what they expect, rather than
4335 * blindly signing the hash.
4337 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKCVec_u8Z invoice_preimage);
4339 * Frees any resources associated with this object given its this_arg pointer.
4340 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4342 void (*free)(void *this_arg);
4346 * A trait which should be implemented to provide feerate information on a number of time
4349 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
4350 * called from inside the library in response to chain events, P2P events, or timer events).
4352 typedef struct LDKFeeEstimator {
4354 * An opaque pointer which is passed to your function implementations as an argument.
4355 * This has no meaning in the LDK, and can be NULL or any other value.
4359 * Gets estimated satoshis of fee required per 1000 Weight-Units.
4361 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
4362 * don't put us below 1 satoshi-per-byte).
4364 * This translates to:
4365 * * satoshis-per-byte * 250
4366 * * ceil(satoshis-per-kbyte / 4)
4368 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
4370 * Frees any resources associated with this object given its this_arg pointer.
4371 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4373 void (*free)(void *this_arg);
4377 * A trait encapsulating the operations required of a logger
4379 typedef struct LDKLogger {
4381 * An opaque pointer which is passed to your function implementations as an argument.
4382 * This has no meaning in the LDK, and can be NULL or any other value.
4388 void (*log)(const void *this_arg, const char *record);
4390 * Frees any resources associated with this object given its this_arg pointer.
4391 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4393 void (*free)(void *this_arg);
4399 * Manager which keeps track of a number of channels and sends messages to the appropriate
4400 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
4402 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
4403 * to individual Channels.
4405 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
4406 * all peers during write/read (though does not modify this instance, only the instance being
4407 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
4408 * called funding_transaction_generated for outbound channels).
4410 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
4411 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
4412 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
4413 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
4414 * the serialization process). If the deserialized version is out-of-date compared to the
4415 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
4416 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
4418 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
4419 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
4420 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
4421 * block_connected() to step towards your best block) upon deserialization before using the
4424 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
4425 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
4426 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
4427 * offline for a full minute. In order to track this, you must call
4428 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
4430 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
4431 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
4432 * essentially you should default to using a SimpleRefChannelManager, and use a
4433 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
4434 * you're using lightning-net-tokio.
4436 typedef struct MUST_USE_STRUCT LDKChannelManager {
4438 * A pointer to the opaque Rust object.
4439 * Nearly everywhere, inner must be non-null, however in places where
4440 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4442 LDKnativeChannelManager *inner;
4444 * Indicates that this is the only struct which contains the same pointer.
4445 * Rust functions which take ownership of an object provided via an argument require
4446 * this to be true and invalidate the object pointed to by inner.
4449 } LDKChannelManager;
4452 * A tuple of 2 elements. See the individual fields for the types contained.
4454 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
4456 * The element at position 0
4458 struct LDKThirtyTwoBytes a;
4460 * The element at position 1
4462 struct LDKChannelManager b;
4463 } LDKC2Tuple_BlockHashChannelManagerZ;
4466 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
4468 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
4470 * A pointer to the contents in the success state.
4471 * Reading from this pointer when `result_ok` is not set is undefined.
4473 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
4475 * A pointer to the contents in the error state.
4476 * Reading from this pointer when `result_ok` is set is undefined.
4478 struct LDKDecodeError *err;
4479 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
4482 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
4483 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
4484 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4486 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
4488 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
4489 * `err` or `result` depending on the state of `result_ok`.
4491 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
4493 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
4496 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
4501 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
4502 * with our counterparty.
4504 typedef struct MUST_USE_STRUCT LDKChannelConfig {
4506 * A pointer to the opaque Rust object.
4507 * Nearly everywhere, inner must be non-null, however in places where
4508 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4510 LDKnativeChannelConfig *inner;
4512 * Indicates that this is the only struct which contains the same pointer.
4513 * Rust functions which take ownership of an object provided via an argument require
4514 * this to be true and invalidate the object pointed to by inner.
4520 * The contents of CResult_ChannelConfigDecodeErrorZ
4522 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
4524 * A pointer to the contents in the success state.
4525 * Reading from this pointer when `result_ok` is not set is undefined.
4527 struct LDKChannelConfig *result;
4529 * A pointer to the contents in the error state.
4530 * Reading from this pointer when `result_ok` is set is undefined.
4532 struct LDKDecodeError *err;
4533 } LDKCResult_ChannelConfigDecodeErrorZPtr;
4536 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
4537 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
4538 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4540 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
4542 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
4543 * `err` or `result` depending on the state of `result_ok`.
4545 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
4547 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
4550 } LDKCResult_ChannelConfigDecodeErrorZ;
4553 * The contents of CResult_OutPointDecodeErrorZ
4555 typedef union LDKCResult_OutPointDecodeErrorZPtr {
4557 * A pointer to the contents in the success state.
4558 * Reading from this pointer when `result_ok` is not set is undefined.
4560 struct LDKOutPoint *result;
4562 * A pointer to the contents in the error state.
4563 * Reading from this pointer when `result_ok` is set is undefined.
4565 struct LDKDecodeError *err;
4566 } LDKCResult_OutPointDecodeErrorZPtr;
4569 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
4570 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
4571 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4573 typedef struct LDKCResult_OutPointDecodeErrorZ {
4575 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
4576 * `err` or `result` depending on the state of `result_ok`.
4578 union LDKCResult_OutPointDecodeErrorZPtr contents;
4580 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
4583 } LDKCResult_OutPointDecodeErrorZ;
4586 * The contents of CResult_SiPrefixNoneZ
4588 typedef union LDKCResult_SiPrefixNoneZPtr {
4590 * A pointer to the contents in the success state.
4591 * Reading from this pointer when `result_ok` is not set is undefined.
4593 enum LDKSiPrefix *result;
4595 * Note that this value is always NULL, as there are no contents in the Err variant
4598 } LDKCResult_SiPrefixNoneZPtr;
4601 * A CResult_SiPrefixNoneZ represents the result of a fallible operation,
4602 * containing a crate::lightning_invoice::SiPrefix on success and a () on failure.
4603 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4605 typedef struct LDKCResult_SiPrefixNoneZ {
4607 * The contents of this CResult_SiPrefixNoneZ, accessible via either
4608 * `err` or `result` depending on the state of `result_ok`.
4610 union LDKCResult_SiPrefixNoneZPtr contents;
4612 * Whether this CResult_SiPrefixNoneZ represents a success state.
4615 } LDKCResult_SiPrefixNoneZ;
4620 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
4622 * There are three ways to construct an `Invoice`:
4623 * 1. using `InvoiceBuilder`
4624 * 2. using `Invoice::from_signed(SignedRawInvoice)`
4625 * 3. using `str::parse::<Invoice>(&str)`
4627 typedef struct MUST_USE_STRUCT LDKInvoice {
4629 * A pointer to the opaque Rust object.
4630 * Nearly everywhere, inner must be non-null, however in places where
4631 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4633 LDKnativeInvoice *inner;
4635 * Indicates that this is the only struct which contains the same pointer.
4636 * Rust functions which take ownership of an object provided via an argument require
4637 * this to be true and invalidate the object pointed to by inner.
4643 * The contents of CResult_InvoiceNoneZ
4645 typedef union LDKCResult_InvoiceNoneZPtr {
4647 * A pointer to the contents in the success state.
4648 * Reading from this pointer when `result_ok` is not set is undefined.
4650 struct LDKInvoice *result;
4652 * Note that this value is always NULL, as there are no contents in the Err variant
4655 } LDKCResult_InvoiceNoneZPtr;
4658 * A CResult_InvoiceNoneZ represents the result of a fallible operation,
4659 * containing a crate::lightning_invoice::Invoice on success and a () on failure.
4660 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4662 typedef struct LDKCResult_InvoiceNoneZ {
4664 * The contents of this CResult_InvoiceNoneZ, accessible via either
4665 * `err` or `result` depending on the state of `result_ok`.
4667 union LDKCResult_InvoiceNoneZPtr contents;
4669 * Whether this CResult_InvoiceNoneZ represents a success state.
4672 } LDKCResult_InvoiceNoneZ;
4677 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
4681 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
4683 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
4685 * A pointer to the opaque Rust object.
4686 * Nearly everywhere, inner must be non-null, however in places where
4687 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4689 LDKnativeSignedRawInvoice *inner;
4691 * Indicates that this is the only struct which contains the same pointer.
4692 * Rust functions which take ownership of an object provided via an argument require
4693 * this to be true and invalidate the object pointed to by inner.
4696 } LDKSignedRawInvoice;
4699 * The contents of CResult_SignedRawInvoiceNoneZ
4701 typedef union LDKCResult_SignedRawInvoiceNoneZPtr {
4703 * A pointer to the contents in the success state.
4704 * Reading from this pointer when `result_ok` is not set is undefined.
4706 struct LDKSignedRawInvoice *result;
4708 * Note that this value is always NULL, as there are no contents in the Err variant
4711 } LDKCResult_SignedRawInvoiceNoneZPtr;
4714 * A CResult_SignedRawInvoiceNoneZ represents the result of a fallible operation,
4715 * containing a crate::lightning_invoice::SignedRawInvoice on success and a () on failure.
4716 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4718 typedef struct LDKCResult_SignedRawInvoiceNoneZ {
4720 * The contents of this CResult_SignedRawInvoiceNoneZ, accessible via either
4721 * `err` or `result` depending on the state of `result_ok`.
4723 union LDKCResult_SignedRawInvoiceNoneZPtr contents;
4725 * Whether this CResult_SignedRawInvoiceNoneZ represents a success state.
4728 } LDKCResult_SignedRawInvoiceNoneZ;
4733 * Represents an syntactically correct Invoice for a payment on the lightning network,
4734 * but without the signature information.
4735 * De- and encoding should not lead to information loss but may lead to different hashes.
4737 * For methods without docs see the corresponding methods in `Invoice`.
4739 typedef struct MUST_USE_STRUCT LDKRawInvoice {
4741 * A pointer to the opaque Rust object.
4742 * Nearly everywhere, inner must be non-null, however in places where
4743 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4745 LDKnativeRawInvoice *inner;
4747 * Indicates that this is the only struct which contains the same pointer.
4748 * Rust functions which take ownership of an object provided via an argument require
4749 * this to be true and invalidate the object pointed to by inner.
4757 * Recoverable signature
4759 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
4761 * A pointer to the opaque Rust object.
4762 * Nearly everywhere, inner must be non-null, however in places where
4763 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4765 LDKnativeInvoiceSignature *inner;
4767 * Indicates that this is the only struct which contains the same pointer.
4768 * Rust functions which take ownership of an object provided via an argument require
4769 * this to be true and invalidate the object pointed to by inner.
4772 } LDKInvoiceSignature;
4775 * A tuple of 3 elements. See the individual fields for the types contained.
4777 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
4779 * The element at position 0
4781 struct LDKRawInvoice a;
4783 * The element at position 1
4785 struct LDKThirtyTwoBytes b;
4787 * The element at position 2
4789 struct LDKInvoiceSignature c;
4790 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
4797 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
4799 * A pointer to the opaque Rust object.
4800 * Nearly everywhere, inner must be non-null, however in places where
4801 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4803 LDKnativePayeePubKey *inner;
4805 * Indicates that this is the only struct which contains the same pointer.
4806 * Rust functions which take ownership of an object provided via an argument require
4807 * this to be true and invalidate the object pointed to by inner.
4813 * The contents of CResult_PayeePubKeyErrorZ
4815 typedef union LDKCResult_PayeePubKeyErrorZPtr {
4817 * A pointer to the contents in the success state.
4818 * Reading from this pointer when `result_ok` is not set is undefined.
4820 struct LDKPayeePubKey *result;
4822 * A pointer to the contents in the error state.
4823 * Reading from this pointer when `result_ok` is set is undefined.
4825 enum LDKSecp256k1Error *err;
4826 } LDKCResult_PayeePubKeyErrorZPtr;
4829 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
4830 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
4831 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4833 typedef struct LDKCResult_PayeePubKeyErrorZ {
4835 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
4836 * `err` or `result` depending on the state of `result_ok`.
4838 union LDKCResult_PayeePubKeyErrorZPtr contents;
4840 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
4843 } LDKCResult_PayeePubKeyErrorZ;
4848 * Private routing information
4851 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
4854 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
4856 * A pointer to the opaque Rust object.
4857 * Nearly everywhere, inner must be non-null, however in places where
4858 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4860 LDKnativePrivateRoute *inner;
4862 * Indicates that this is the only struct which contains the same pointer.
4863 * Rust functions which take ownership of an object provided via an argument require
4864 * this to be true and invalidate the object pointed to by inner.
4870 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
4871 * This corresponds to std::vector in C++
4873 typedef struct LDKCVec_PrivateRouteZ {
4875 * The elements in the array.
4876 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4878 struct LDKPrivateRoute *data;
4880 * The number of elements pointed to by `data`.
4883 } LDKCVec_PrivateRouteZ;
4888 * A timestamp that refers to a date after 1 January 1970 which means its representation as UNIX
4889 * timestamp is positive.
4892 * The UNIX timestamp representing the stored time has to be positive and small enough so that
4893 * a `EpiryTime` can be added to it without an overflow.
4895 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
4897 * A pointer to the opaque Rust object.
4898 * Nearly everywhere, inner must be non-null, however in places where
4899 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4901 LDKnativePositiveTimestamp *inner;
4903 * Indicates that this is the only struct which contains the same pointer.
4904 * Rust functions which take ownership of an object provided via an argument require
4905 * this to be true and invalidate the object pointed to by inner.
4908 } LDKPositiveTimestamp;
4911 * The contents of CResult_PositiveTimestampCreationErrorZ
4913 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
4915 * A pointer to the contents in the success state.
4916 * Reading from this pointer when `result_ok` is not set is undefined.
4918 struct LDKPositiveTimestamp *result;
4920 * A pointer to the contents in the error state.
4921 * Reading from this pointer when `result_ok` is set is undefined.
4923 enum LDKCreationError *err;
4924 } LDKCResult_PositiveTimestampCreationErrorZPtr;
4927 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
4928 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
4929 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4931 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
4933 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
4934 * `err` or `result` depending on the state of `result_ok`.
4936 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
4938 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
4941 } LDKCResult_PositiveTimestampCreationErrorZ;
4944 * The contents of CResult_NoneSemanticErrorZ
4946 typedef union LDKCResult_NoneSemanticErrorZPtr {
4948 * Note that this value is always NULL, as there are no contents in the OK variant
4952 * A pointer to the contents in the error state.
4953 * Reading from this pointer when `result_ok` is set is undefined.
4955 enum LDKSemanticError *err;
4956 } LDKCResult_NoneSemanticErrorZPtr;
4959 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
4960 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
4961 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4963 typedef struct LDKCResult_NoneSemanticErrorZ {
4965 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
4966 * `err` or `result` depending on the state of `result_ok`.
4968 union LDKCResult_NoneSemanticErrorZPtr contents;
4970 * Whether this CResult_NoneSemanticErrorZ represents a success state.
4973 } LDKCResult_NoneSemanticErrorZ;
4976 * The contents of CResult_InvoiceSemanticErrorZ
4978 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
4980 * A pointer to the contents in the success state.
4981 * Reading from this pointer when `result_ok` is not set is undefined.
4983 struct LDKInvoice *result;
4985 * A pointer to the contents in the error state.
4986 * Reading from this pointer when `result_ok` is set is undefined.
4988 enum LDKSemanticError *err;
4989 } LDKCResult_InvoiceSemanticErrorZPtr;
4992 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
4993 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
4994 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4996 typedef struct LDKCResult_InvoiceSemanticErrorZ {
4998 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
4999 * `err` or `result` depending on the state of `result_ok`.
5001 union LDKCResult_InvoiceSemanticErrorZPtr contents;
5003 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
5006 } LDKCResult_InvoiceSemanticErrorZ;
5011 * Description string
5014 * The description can be at most 639 __bytes__ long
5016 typedef struct MUST_USE_STRUCT LDKDescription {
5018 * A pointer to the opaque Rust object.
5019 * Nearly everywhere, inner must be non-null, however in places where
5020 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5022 LDKnativeDescription *inner;
5024 * Indicates that this is the only struct which contains the same pointer.
5025 * Rust functions which take ownership of an object provided via an argument require
5026 * this to be true and invalidate the object pointed to by inner.
5032 * The contents of CResult_DescriptionCreationErrorZ
5034 typedef union LDKCResult_DescriptionCreationErrorZPtr {
5036 * A pointer to the contents in the success state.
5037 * Reading from this pointer when `result_ok` is not set is undefined.
5039 struct LDKDescription *result;
5041 * A pointer to the contents in the error state.
5042 * Reading from this pointer when `result_ok` is set is undefined.
5044 enum LDKCreationError *err;
5045 } LDKCResult_DescriptionCreationErrorZPtr;
5048 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
5049 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
5050 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5052 typedef struct LDKCResult_DescriptionCreationErrorZ {
5054 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
5055 * `err` or `result` depending on the state of `result_ok`.
5057 union LDKCResult_DescriptionCreationErrorZPtr contents;
5059 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
5062 } LDKCResult_DescriptionCreationErrorZ;
5067 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
5071 * The number of seconds this expiry time represents has to be in the range
5072 * `0...(SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME)` to avoid overflows when adding it to a
5075 typedef struct MUST_USE_STRUCT LDKExpiryTime {
5077 * A pointer to the opaque Rust object.
5078 * Nearly everywhere, inner must be non-null, however in places where
5079 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5081 LDKnativeExpiryTime *inner;
5083 * Indicates that this is the only struct which contains the same pointer.
5084 * Rust functions which take ownership of an object provided via an argument require
5085 * this to be true and invalidate the object pointed to by inner.
5091 * The contents of CResult_ExpiryTimeCreationErrorZ
5093 typedef union LDKCResult_ExpiryTimeCreationErrorZPtr {
5095 * A pointer to the contents in the success state.
5096 * Reading from this pointer when `result_ok` is not set is undefined.
5098 struct LDKExpiryTime *result;
5100 * A pointer to the contents in the error state.
5101 * Reading from this pointer when `result_ok` is set is undefined.
5103 enum LDKCreationError *err;
5104 } LDKCResult_ExpiryTimeCreationErrorZPtr;
5107 * A CResult_ExpiryTimeCreationErrorZ represents the result of a fallible operation,
5108 * containing a crate::lightning_invoice::ExpiryTime on success and a crate::lightning_invoice::CreationError on failure.
5109 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5111 typedef struct LDKCResult_ExpiryTimeCreationErrorZ {
5113 * The contents of this CResult_ExpiryTimeCreationErrorZ, accessible via either
5114 * `err` or `result` depending on the state of `result_ok`.
5116 union LDKCResult_ExpiryTimeCreationErrorZPtr contents;
5118 * Whether this CResult_ExpiryTimeCreationErrorZ represents a success state.
5121 } LDKCResult_ExpiryTimeCreationErrorZ;
5124 * The contents of CResult_PrivateRouteCreationErrorZ
5126 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
5128 * A pointer to the contents in the success state.
5129 * Reading from this pointer when `result_ok` is not set is undefined.
5131 struct LDKPrivateRoute *result;
5133 * A pointer to the contents in the error state.
5134 * Reading from this pointer when `result_ok` is set is undefined.
5136 enum LDKCreationError *err;
5137 } LDKCResult_PrivateRouteCreationErrorZPtr;
5140 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
5141 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
5142 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5144 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
5146 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
5147 * `err` or `result` depending on the state of `result_ok`.
5149 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
5151 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
5154 } LDKCResult_PrivateRouteCreationErrorZ;
5157 * The contents of CResult_StringErrorZ
5159 typedef union LDKCResult_StringErrorZPtr {
5161 * A pointer to the contents in the success state.
5162 * Reading from this pointer when `result_ok` is not set is undefined.
5164 struct LDKStr *result;
5166 * A pointer to the contents in the error state.
5167 * Reading from this pointer when `result_ok` is set is undefined.
5169 enum LDKSecp256k1Error *err;
5170 } LDKCResult_StringErrorZPtr;
5173 * A CResult_StringErrorZ represents the result of a fallible operation,
5174 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
5175 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5177 typedef struct LDKCResult_StringErrorZ {
5179 * The contents of this CResult_StringErrorZ, accessible via either
5180 * `err` or `result` depending on the state of `result_ok`.
5182 union LDKCResult_StringErrorZPtr contents;
5184 * Whether this CResult_StringErrorZ represents a success state.
5187 } LDKCResult_StringErrorZ;
5190 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
5192 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
5194 * A pointer to the contents in the success state.
5195 * Reading from this pointer when `result_ok` is not set is undefined.
5197 struct LDKChannelMonitorUpdate *result;
5199 * A pointer to the contents in the error state.
5200 * Reading from this pointer when `result_ok` is set is undefined.
5202 struct LDKDecodeError *err;
5203 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
5206 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
5207 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5208 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5210 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
5212 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
5213 * `err` or `result` depending on the state of `result_ok`.
5215 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
5217 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
5220 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
5223 * The contents of CResult_HTLCUpdateDecodeErrorZ
5225 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
5227 * A pointer to the contents in the success state.
5228 * Reading from this pointer when `result_ok` is not set is undefined.
5230 struct LDKHTLCUpdate *result;
5232 * A pointer to the contents in the error state.
5233 * Reading from this pointer when `result_ok` is set is undefined.
5235 struct LDKDecodeError *err;
5236 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
5239 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
5240 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5241 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5243 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
5245 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
5246 * `err` or `result` depending on the state of `result_ok`.
5248 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
5250 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
5253 } LDKCResult_HTLCUpdateDecodeErrorZ;
5258 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
5259 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
5260 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
5262 * Contains a developer-readable error message.
5264 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
5266 * A pointer to the opaque Rust object.
5267 * Nearly everywhere, inner must be non-null, however in places where
5268 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5270 LDKnativeMonitorUpdateError *inner;
5272 * Indicates that this is the only struct which contains the same pointer.
5273 * Rust functions which take ownership of an object provided via an argument require
5274 * this to be true and invalidate the object pointed to by inner.
5277 } LDKMonitorUpdateError;
5280 * The contents of CResult_NoneMonitorUpdateErrorZ
5282 typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
5284 * Note that this value is always NULL, as there are no contents in the OK variant
5288 * A pointer to the contents in the error state.
5289 * Reading from this pointer when `result_ok` is set is undefined.
5291 struct LDKMonitorUpdateError *err;
5292 } LDKCResult_NoneMonitorUpdateErrorZPtr;
5295 * A CResult_NoneMonitorUpdateErrorZ represents the result of a fallible operation,
5296 * containing a () on success and a crate::lightning::chain::channelmonitor::MonitorUpdateError on failure.
5297 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5299 typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
5301 * The contents of this CResult_NoneMonitorUpdateErrorZ, accessible via either
5302 * `err` or `result` depending on the state of `result_ok`.
5304 union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
5306 * Whether this CResult_NoneMonitorUpdateErrorZ represents a success state.
5309 } LDKCResult_NoneMonitorUpdateErrorZ;
5312 * A tuple of 2 elements. See the individual fields for the types contained.
5314 typedef struct LDKC2Tuple_OutPointScriptZ {
5316 * The element at position 0
5318 struct LDKOutPoint a;
5320 * The element at position 1
5322 struct LDKCVec_u8Z b;
5323 } LDKC2Tuple_OutPointScriptZ;
5326 * A tuple of 2 elements. See the individual fields for the types contained.
5328 typedef struct LDKC2Tuple_u32ScriptZ {
5330 * The element at position 0
5334 * The element at position 1
5336 struct LDKCVec_u8Z b;
5337 } LDKC2Tuple_u32ScriptZ;
5340 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
5341 * This corresponds to std::vector in C++
5343 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
5345 * The elements in the array.
5346 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5348 struct LDKC2Tuple_u32ScriptZ *data;
5350 * The number of elements pointed to by `data`.
5353 } LDKCVec_C2Tuple_u32ScriptZZ;
5356 * A tuple of 2 elements. See the individual fields for the types contained.
5358 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
5360 * The element at position 0
5362 struct LDKThirtyTwoBytes a;
5364 * The element at position 1
5366 struct LDKCVec_C2Tuple_u32ScriptZZ b;
5367 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
5370 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
5371 * This corresponds to std::vector in C++
5373 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
5375 * The elements in the array.
5376 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5378 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
5380 * The number of elements pointed to by `data`.
5383 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
5386 * An Event which you should probably take some action in response to.
5388 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
5389 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
5390 * written as it makes no sense to respond to it after reconnecting to peers).
5392 typedef enum LDKEvent_Tag {
5394 * Used to indicate that the client should generate a funding transaction with the given
5395 * parameters and then call ChannelManager::funding_transaction_generated.
5396 * Generated in ChannelManager message handling.
5397 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
5398 * counterparty can steal your funds!
5400 LDKEvent_FundingGenerationReady,
5402 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
5403 * ChannelManager::claim_funds to get it....
5404 * Note that if the preimage is not known or the amount paid is incorrect, you should call
5405 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
5406 * network congestion.
5407 * The amount paid should be considered 'incorrect' when it is less than or more than twice
5408 * the amount expected.
5409 * If you fail to call either ChannelManager::claim_funds or
5410 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
5411 * automatically failed.
5413 LDKEvent_PaymentReceived,
5415 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
5416 * and we got back the payment preimage for it).
5418 LDKEvent_PaymentSent,
5420 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
5421 * something. You may wish to retry with a different route.
5423 LDKEvent_PaymentFailed,
5425 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
5426 * time in the future.
5428 LDKEvent_PendingHTLCsForwardable,
5430 * Used to indicate that an output which you should know how to spend was confirmed on chain
5431 * and is now spendable.
5432 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
5433 * counterparty spending them due to some kind of timeout. Thus, you need to store them
5434 * somewhere and spend them when you create on-chain transactions.
5436 LDKEvent_SpendableOutputs,
5438 * Must be last for serialization purposes
5443 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
5445 * The random channel_id we picked which you'll need to pass into
5446 * ChannelManager::funding_transaction_generated.
5448 struct LDKThirtyTwoBytes temporary_channel_id;
5450 * The value, in satoshis, that the output should have.
5452 uint64_t channel_value_satoshis;
5454 * The script which should be used in the transaction output.
5456 struct LDKCVec_u8Z output_script;
5458 * The value passed in to ChannelManager::create_channel
5460 uint64_t user_channel_id;
5461 } LDKEvent_LDKFundingGenerationReady_Body;
5463 typedef struct LDKEvent_LDKPaymentReceived_Body {
5465 * The hash for which the preimage should be handed to the ChannelManager.
5467 struct LDKThirtyTwoBytes payment_hash;
5469 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
5470 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
5471 * [`ChannelManager::claim_funds`].
5473 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
5474 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
5476 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5478 struct LDKThirtyTwoBytes payment_preimage;
5480 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
5481 * number of deanonymization attacks during the routing process.
5482 * It is provided here for your reference, however its accuracy is enforced directly by
5483 * [`ChannelManager`] using the values you previously provided to
5484 * [`ChannelManager::create_inbound_payment`] or
5485 * [`ChannelManager::create_inbound_payment_for_hash`].
5487 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
5488 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
5489 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
5491 struct LDKThirtyTwoBytes payment_secret;
5493 * The value, in thousandths of a satoshi, that this payment is for. Note that you must
5494 * compare this to the expected value before accepting the payment (as otherwise you are
5495 * providing proof-of-payment for less than the value you expected!).
5499 * This is the `user_payment_id` which was provided to
5500 * [`ChannelManager::create_inbound_payment_for_hash`] or
5501 * [`ChannelManager::create_inbound_payment`]. It has no meaning inside of LDK and is
5502 * simply copied here. It may be used to correlate PaymentReceived events with invoice
5503 * metadata stored elsewhere.
5505 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
5506 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
5508 uint64_t user_payment_id;
5509 } LDKEvent_LDKPaymentReceived_Body;
5511 typedef struct LDKEvent_LDKPaymentSent_Body {
5513 * The preimage to the hash given to ChannelManager::send_payment.
5514 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
5517 struct LDKThirtyTwoBytes payment_preimage;
5518 } LDKEvent_LDKPaymentSent_Body;
5520 typedef struct LDKEvent_LDKPaymentFailed_Body {
5522 * The hash which was given to ChannelManager::send_payment.
5524 struct LDKThirtyTwoBytes payment_hash;
5526 * Indicates the payment was rejected for some reason by the recipient. This implies that
5527 * the payment has failed, not just the route in question. If this is not set, you may
5528 * retry the payment via a different route.
5530 bool rejected_by_dest;
5531 } LDKEvent_LDKPaymentFailed_Body;
5533 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
5535 * The minimum amount of time that should be waited prior to calling
5536 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
5537 * you should wait a random amount of time in roughly the range (now + time_forwardable,
5538 * now + 5*time_forwardable).
5540 uint64_t time_forwardable;
5541 } LDKEvent_LDKPendingHTLCsForwardable_Body;
5543 typedef struct LDKEvent_LDKSpendableOutputs_Body {
5545 * The outputs which you should store as spendable by you.
5547 struct LDKCVec_SpendableOutputDescriptorZ outputs;
5548 } LDKEvent_LDKSpendableOutputs_Body;
5550 typedef struct MUST_USE_STRUCT LDKEvent {
5553 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
5554 LDKEvent_LDKPaymentReceived_Body payment_received;
5555 LDKEvent_LDKPaymentSent_Body payment_sent;
5556 LDKEvent_LDKPaymentFailed_Body payment_failed;
5557 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
5558 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
5563 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
5564 * This corresponds to std::vector in C++
5566 typedef struct LDKCVec_EventZ {
5568 * The elements in the array.
5569 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5571 struct LDKEvent *data;
5573 * The number of elements pointed to by `data`.
5579 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
5580 * This corresponds to std::vector in C++
5582 typedef struct LDKCVec_TransactionZ {
5584 * The elements in the array.
5585 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5587 struct LDKTransaction *data;
5589 * The number of elements pointed to by `data`.
5592 } LDKCVec_TransactionZ;
5595 * A tuple of 2 elements. See the individual fields for the types contained.
5597 typedef struct LDKC2Tuple_u32TxOutZ {
5599 * The element at position 0
5603 * The element at position 1
5606 } LDKC2Tuple_u32TxOutZ;
5609 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
5610 * This corresponds to std::vector in C++
5612 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
5614 * The elements in the array.
5615 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5617 struct LDKC2Tuple_u32TxOutZ *data;
5619 * The number of elements pointed to by `data`.
5622 } LDKCVec_C2Tuple_u32TxOutZZ;
5625 * A tuple of 2 elements. See the individual fields for the types contained.
5627 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
5629 * The element at position 0
5631 struct LDKThirtyTwoBytes a;
5633 * The element at position 1
5635 struct LDKCVec_C2Tuple_u32TxOutZZ b;
5636 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
5639 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
5640 * This corresponds to std::vector in C++
5642 typedef struct LDKCVec_TransactionOutputsZ {
5644 * The elements in the array.
5645 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5647 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
5649 * The number of elements pointed to by `data`.
5652 } LDKCVec_TransactionOutputsZ;
5655 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
5657 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
5659 * A pointer to the contents in the success state.
5660 * Reading from this pointer when `result_ok` is not set is undefined.
5662 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
5664 * A pointer to the contents in the error state.
5665 * Reading from this pointer when `result_ok` is set is undefined.
5667 struct LDKDecodeError *err;
5668 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
5671 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
5672 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5673 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5675 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
5677 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
5678 * `err` or `result` depending on the state of `result_ok`.
5680 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
5682 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
5685 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
5688 * The contents of CResult_boolLightningErrorZ
5690 typedef union LDKCResult_boolLightningErrorZPtr {
5692 * A pointer to the contents in the success state.
5693 * Reading from this pointer when `result_ok` is not set is undefined.
5697 * A pointer to the contents in the error state.
5698 * Reading from this pointer when `result_ok` is set is undefined.
5700 struct LDKLightningError *err;
5701 } LDKCResult_boolLightningErrorZPtr;
5704 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5705 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5706 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5708 typedef struct LDKCResult_boolLightningErrorZ {
5710 * The contents of this CResult_boolLightningErrorZ, accessible via either
5711 * `err` or `result` depending on the state of `result_ok`.
5713 union LDKCResult_boolLightningErrorZPtr contents;
5715 * Whether this CResult_boolLightningErrorZ represents a success state.
5718 } LDKCResult_boolLightningErrorZ;
5721 * A tuple of 3 elements. See the individual fields for the types contained.
5723 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5725 * The element at position 0
5727 struct LDKChannelAnnouncement a;
5729 * The element at position 1
5731 struct LDKChannelUpdate b;
5733 * The element at position 2
5735 struct LDKChannelUpdate c;
5736 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5739 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
5740 * This corresponds to std::vector in C++
5742 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5744 * The elements in the array.
5745 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5747 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
5749 * The number of elements pointed to by `data`.
5752 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5755 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
5756 * This corresponds to std::vector in C++
5758 typedef struct LDKCVec_NodeAnnouncementZ {
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 LDKNodeAnnouncement *data;
5765 * The number of elements pointed to by `data`.
5768 } LDKCVec_NodeAnnouncementZ;
5771 * The contents of CResult_NoneLightningErrorZ
5773 typedef union LDKCResult_NoneLightningErrorZPtr {
5775 * Note that this value is always NULL, as there are no contents in the OK variant
5779 * A pointer to the contents in the error state.
5780 * Reading from this pointer when `result_ok` is set is undefined.
5782 struct LDKLightningError *err;
5783 } LDKCResult_NoneLightningErrorZPtr;
5786 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5787 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5788 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5790 typedef struct LDKCResult_NoneLightningErrorZ {
5792 * The contents of this CResult_NoneLightningErrorZ, accessible via either
5793 * `err` or `result` depending on the state of `result_ok`.
5795 union LDKCResult_NoneLightningErrorZPtr contents;
5797 * Whether this CResult_NoneLightningErrorZ represents a success state.
5800 } LDKCResult_NoneLightningErrorZ;
5803 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
5804 * This corresponds to std::vector in C++
5806 typedef struct LDKCVec_PublicKeyZ {
5808 * The elements in the array.
5809 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5811 struct LDKPublicKey *data;
5813 * The number of elements pointed to by `data`.
5816 } LDKCVec_PublicKeyZ;
5821 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
5822 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
5825 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
5827 * A pointer to the opaque Rust object.
5828 * Nearly everywhere, inner must be non-null, however in places where
5829 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5831 LDKnativePeerHandleError *inner;
5833 * Indicates that this is the only struct which contains the same pointer.
5834 * Rust functions which take ownership of an object provided via an argument require
5835 * this to be true and invalidate the object pointed to by inner.
5838 } LDKPeerHandleError;
5841 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
5843 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
5845 * A pointer to the contents in the success state.
5846 * Reading from this pointer when `result_ok` is not set is undefined.
5848 struct LDKCVec_u8Z *result;
5850 * A pointer to the contents in the error state.
5851 * Reading from this pointer when `result_ok` is set is undefined.
5853 struct LDKPeerHandleError *err;
5854 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
5857 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
5858 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
5859 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5861 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
5863 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
5864 * `err` or `result` depending on the state of `result_ok`.
5866 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
5868 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
5871 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
5874 * The contents of CResult_NonePeerHandleErrorZ
5876 typedef union LDKCResult_NonePeerHandleErrorZPtr {
5878 * Note that this value is always NULL, as there are no contents in the OK variant
5882 * A pointer to the contents in the error state.
5883 * Reading from this pointer when `result_ok` is set is undefined.
5885 struct LDKPeerHandleError *err;
5886 } LDKCResult_NonePeerHandleErrorZPtr;
5889 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
5890 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
5891 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5893 typedef struct LDKCResult_NonePeerHandleErrorZ {
5895 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
5896 * `err` or `result` depending on the state of `result_ok`.
5898 union LDKCResult_NonePeerHandleErrorZPtr contents;
5900 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
5903 } LDKCResult_NonePeerHandleErrorZ;
5906 * The contents of CResult_boolPeerHandleErrorZ
5908 typedef union LDKCResult_boolPeerHandleErrorZPtr {
5910 * A pointer to the contents in the success state.
5911 * Reading from this pointer when `result_ok` is not set is undefined.
5915 * A pointer to the contents in the error state.
5916 * Reading from this pointer when `result_ok` is set is undefined.
5918 struct LDKPeerHandleError *err;
5919 } LDKCResult_boolPeerHandleErrorZPtr;
5922 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
5923 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
5924 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5926 typedef struct LDKCResult_boolPeerHandleErrorZ {
5928 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
5929 * `err` or `result` depending on the state of `result_ok`.
5931 union LDKCResult_boolPeerHandleErrorZPtr contents;
5933 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
5936 } LDKCResult_boolPeerHandleErrorZ;
5941 * Details about one direction of a channel. Received
5942 * within a channel update.
5944 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
5946 * A pointer to the opaque Rust object.
5947 * Nearly everywhere, inner must be non-null, however in places where
5948 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5950 LDKnativeDirectionalChannelInfo *inner;
5952 * Indicates that this is the only struct which contains the same pointer.
5953 * Rust functions which take ownership of an object provided via an argument require
5954 * this to be true and invalidate the object pointed to by inner.
5957 } LDKDirectionalChannelInfo;
5960 * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
5962 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
5964 * A pointer to the contents in the success state.
5965 * Reading from this pointer when `result_ok` is not set is undefined.
5967 struct LDKDirectionalChannelInfo *result;
5969 * A pointer to the contents in the error state.
5970 * Reading from this pointer when `result_ok` is set is undefined.
5972 struct LDKDecodeError *err;
5973 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
5976 * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
5977 * containing a crate::lightning::routing::network_graph::DirectionalChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5978 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5980 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
5982 * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
5983 * `err` or `result` depending on the state of `result_ok`.
5985 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
5987 * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
5990 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
5995 * Details about a channel (both directions).
5996 * Received within a channel announcement.
5998 typedef struct MUST_USE_STRUCT LDKChannelInfo {
6000 * A pointer to the opaque Rust object.
6001 * Nearly everywhere, inner must be non-null, however in places where
6002 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6004 LDKnativeChannelInfo *inner;
6006 * Indicates that this is the only struct which contains the same pointer.
6007 * Rust functions which take ownership of an object provided via an argument require
6008 * this to be true and invalidate the object pointed to by inner.
6014 * The contents of CResult_ChannelInfoDecodeErrorZ
6016 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
6018 * A pointer to the contents in the success state.
6019 * Reading from this pointer when `result_ok` is not set is undefined.
6021 struct LDKChannelInfo *result;
6023 * A pointer to the contents in the error state.
6024 * Reading from this pointer when `result_ok` is set is undefined.
6026 struct LDKDecodeError *err;
6027 } LDKCResult_ChannelInfoDecodeErrorZPtr;
6030 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
6031 * containing a crate::lightning::routing::network_graph::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6032 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6034 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
6036 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
6037 * `err` or `result` depending on the state of `result_ok`.
6039 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
6041 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
6044 } LDKCResult_ChannelInfoDecodeErrorZ;
6049 * Fees for routing via a given channel or a node
6051 typedef struct MUST_USE_STRUCT LDKRoutingFees {
6053 * A pointer to the opaque Rust object.
6054 * Nearly everywhere, inner must be non-null, however in places where
6055 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6057 LDKnativeRoutingFees *inner;
6059 * Indicates that this is the only struct which contains the same pointer.
6060 * Rust functions which take ownership of an object provided via an argument require
6061 * this to be true and invalidate the object pointed to by inner.
6067 * The contents of CResult_RoutingFeesDecodeErrorZ
6069 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
6071 * A pointer to the contents in the success state.
6072 * Reading from this pointer when `result_ok` is not set is undefined.
6074 struct LDKRoutingFees *result;
6076 * A pointer to the contents in the error state.
6077 * Reading from this pointer when `result_ok` is set is undefined.
6079 struct LDKDecodeError *err;
6080 } LDKCResult_RoutingFeesDecodeErrorZPtr;
6083 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
6084 * containing a crate::lightning::routing::network_graph::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
6085 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6087 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
6089 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
6090 * `err` or `result` depending on the state of `result_ok`.
6092 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
6094 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
6097 } LDKCResult_RoutingFeesDecodeErrorZ;
6102 * Information received in the latest node_announcement from this node.
6104 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
6106 * A pointer to the opaque Rust object.
6107 * Nearly everywhere, inner must be non-null, however in places where
6108 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6110 LDKnativeNodeAnnouncementInfo *inner;
6112 * Indicates that this is the only struct which contains the same pointer.
6113 * Rust functions which take ownership of an object provided via an argument require
6114 * this to be true and invalidate the object pointed to by inner.
6117 } LDKNodeAnnouncementInfo;
6120 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
6122 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
6124 * A pointer to the contents in the success state.
6125 * Reading from this pointer when `result_ok` is not set is undefined.
6127 struct LDKNodeAnnouncementInfo *result;
6129 * A pointer to the contents in the error state.
6130 * Reading from this pointer when `result_ok` is set is undefined.
6132 struct LDKDecodeError *err;
6133 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
6136 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
6137 * containing a crate::lightning::routing::network_graph::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6138 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6140 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
6142 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
6143 * `err` or `result` depending on the state of `result_ok`.
6145 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
6147 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
6150 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
6153 * A dynamically-allocated array of u64s of arbitrary size.
6154 * This corresponds to std::vector in C++
6156 typedef struct LDKCVec_u64Z {
6158 * The elements in the array.
6159 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6163 * The number of elements pointed to by `data`.
6171 * Details about a node in the network, known from the network announcement.
6173 typedef struct MUST_USE_STRUCT LDKNodeInfo {
6175 * A pointer to the opaque Rust object.
6176 * Nearly everywhere, inner must be non-null, however in places where
6177 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6179 LDKnativeNodeInfo *inner;
6181 * Indicates that this is the only struct which contains the same pointer.
6182 * Rust functions which take ownership of an object provided via an argument require
6183 * this to be true and invalidate the object pointed to by inner.
6189 * The contents of CResult_NodeInfoDecodeErrorZ
6191 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
6193 * A pointer to the contents in the success state.
6194 * Reading from this pointer when `result_ok` is not set is undefined.
6196 struct LDKNodeInfo *result;
6198 * A pointer to the contents in the error state.
6199 * Reading from this pointer when `result_ok` is set is undefined.
6201 struct LDKDecodeError *err;
6202 } LDKCResult_NodeInfoDecodeErrorZPtr;
6205 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
6206 * containing a crate::lightning::routing::network_graph::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6207 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6209 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
6211 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
6212 * `err` or `result` depending on the state of `result_ok`.
6214 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
6216 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
6219 } LDKCResult_NodeInfoDecodeErrorZ;
6224 * Represents the network as nodes and channels between them
6226 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
6228 * A pointer to the opaque Rust object.
6229 * Nearly everywhere, inner must be non-null, however in places where
6230 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6232 LDKnativeNetworkGraph *inner;
6234 * Indicates that this is the only struct which contains the same pointer.
6235 * Rust functions which take ownership of an object provided via an argument require
6236 * this to be true and invalidate the object pointed to by inner.
6242 * The contents of CResult_NetworkGraphDecodeErrorZ
6244 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
6246 * A pointer to the contents in the success state.
6247 * Reading from this pointer when `result_ok` is not set is undefined.
6249 struct LDKNetworkGraph *result;
6251 * A pointer to the contents in the error state.
6252 * Reading from this pointer when `result_ok` is set is undefined.
6254 struct LDKDecodeError *err;
6255 } LDKCResult_NetworkGraphDecodeErrorZPtr;
6258 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
6259 * containing a crate::lightning::routing::network_graph::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
6260 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6262 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
6264 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
6265 * `err` or `result` depending on the state of `result_ok`.
6267 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
6269 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
6272 } LDKCResult_NetworkGraphDecodeErrorZ;
6275 * The contents of CResult_NetAddressu8Z
6277 typedef union LDKCResult_NetAddressu8ZPtr {
6279 * A pointer to the contents in the success state.
6280 * Reading from this pointer when `result_ok` is not set is undefined.
6282 struct LDKNetAddress *result;
6284 * A pointer to the contents in the error state.
6285 * Reading from this pointer when `result_ok` is set is undefined.
6288 } LDKCResult_NetAddressu8ZPtr;
6291 * A CResult_NetAddressu8Z represents the result of a fallible operation,
6292 * containing a crate::lightning::ln::msgs::NetAddress on success and a u8 on failure.
6293 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6295 typedef struct LDKCResult_NetAddressu8Z {
6297 * The contents of this CResult_NetAddressu8Z, accessible via either
6298 * `err` or `result` depending on the state of `result_ok`.
6300 union LDKCResult_NetAddressu8ZPtr contents;
6302 * Whether this CResult_NetAddressu8Z represents a success state.
6305 } LDKCResult_NetAddressu8Z;
6308 * The contents of CResult_CResult_NetAddressu8ZDecodeErrorZ
6310 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
6312 * A pointer to the contents in the success state.
6313 * Reading from this pointer when `result_ok` is not set is undefined.
6315 struct LDKCResult_NetAddressu8Z *result;
6317 * A pointer to the contents in the error state.
6318 * Reading from this pointer when `result_ok` is set is undefined.
6320 struct LDKDecodeError *err;
6321 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
6324 * A CResult_CResult_NetAddressu8ZDecodeErrorZ represents the result of a fallible operation,
6325 * containing a crate::c_types::derived::CResult_NetAddressu8Z on success and a crate::lightning::ln::msgs::DecodeError on failure.
6326 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6328 typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
6330 * The contents of this CResult_CResult_NetAddressu8ZDecodeErrorZ, accessible via either
6331 * `err` or `result` depending on the state of `result_ok`.
6333 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
6335 * Whether this CResult_CResult_NetAddressu8ZDecodeErrorZ represents a success state.
6338 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
6341 * The contents of CResult_NetAddressDecodeErrorZ
6343 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
6345 * A pointer to the contents in the success state.
6346 * Reading from this pointer when `result_ok` is not set is undefined.
6348 struct LDKNetAddress *result;
6350 * A pointer to the contents in the error state.
6351 * Reading from this pointer when `result_ok` is set is undefined.
6353 struct LDKDecodeError *err;
6354 } LDKCResult_NetAddressDecodeErrorZPtr;
6357 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
6358 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
6359 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6361 typedef struct LDKCResult_NetAddressDecodeErrorZ {
6363 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
6364 * `err` or `result` depending on the state of `result_ok`.
6366 union LDKCResult_NetAddressDecodeErrorZPtr contents;
6368 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
6371 } LDKCResult_NetAddressDecodeErrorZ;
6376 * An update_add_htlc message to be sent or received from a peer
6378 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
6380 * A pointer to the opaque Rust object.
6381 * Nearly everywhere, inner must be non-null, however in places where
6382 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6384 LDKnativeUpdateAddHTLC *inner;
6386 * Indicates that this is the only struct which contains the same pointer.
6387 * Rust functions which take ownership of an object provided via an argument require
6388 * this to be true and invalidate the object pointed to by inner.
6394 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
6395 * This corresponds to std::vector in C++
6397 typedef struct LDKCVec_UpdateAddHTLCZ {
6399 * The elements in the array.
6400 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6402 struct LDKUpdateAddHTLC *data;
6404 * The number of elements pointed to by `data`.
6407 } LDKCVec_UpdateAddHTLCZ;
6412 * An update_fulfill_htlc message to be sent or received from a peer
6414 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
6416 * A pointer to the opaque Rust object.
6417 * Nearly everywhere, inner must be non-null, however in places where
6418 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6420 LDKnativeUpdateFulfillHTLC *inner;
6422 * Indicates that this is the only struct which contains the same pointer.
6423 * Rust functions which take ownership of an object provided via an argument require
6424 * this to be true and invalidate the object pointed to by inner.
6427 } LDKUpdateFulfillHTLC;
6430 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
6431 * This corresponds to std::vector in C++
6433 typedef struct LDKCVec_UpdateFulfillHTLCZ {
6435 * The elements in the array.
6436 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6438 struct LDKUpdateFulfillHTLC *data;
6440 * The number of elements pointed to by `data`.
6443 } LDKCVec_UpdateFulfillHTLCZ;
6448 * An update_fail_htlc message to be sent or received from a peer
6450 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
6452 * A pointer to the opaque Rust object.
6453 * Nearly everywhere, inner must be non-null, however in places where
6454 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6456 LDKnativeUpdateFailHTLC *inner;
6458 * Indicates that this is the only struct which contains the same pointer.
6459 * Rust functions which take ownership of an object provided via an argument require
6460 * this to be true and invalidate the object pointed to by inner.
6463 } LDKUpdateFailHTLC;
6466 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
6467 * This corresponds to std::vector in C++
6469 typedef struct LDKCVec_UpdateFailHTLCZ {
6471 * The elements in the array.
6472 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6474 struct LDKUpdateFailHTLC *data;
6476 * The number of elements pointed to by `data`.
6479 } LDKCVec_UpdateFailHTLCZ;
6484 * An update_fail_malformed_htlc message to be sent or received from a peer
6486 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
6488 * A pointer to the opaque Rust object.
6489 * Nearly everywhere, inner must be non-null, however in places where
6490 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6492 LDKnativeUpdateFailMalformedHTLC *inner;
6494 * Indicates that this is the only struct which contains the same pointer.
6495 * Rust functions which take ownership of an object provided via an argument require
6496 * this to be true and invalidate the object pointed to by inner.
6499 } LDKUpdateFailMalformedHTLC;
6502 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
6503 * This corresponds to std::vector in C++
6505 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
6507 * The elements in the array.
6508 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6510 struct LDKUpdateFailMalformedHTLC *data;
6512 * The number of elements pointed to by `data`.
6515 } LDKCVec_UpdateFailMalformedHTLCZ;
6518 * The contents of CResult_AcceptChannelDecodeErrorZ
6520 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
6522 * A pointer to the contents in the success state.
6523 * Reading from this pointer when `result_ok` is not set is undefined.
6525 struct LDKAcceptChannel *result;
6527 * A pointer to the contents in the error state.
6528 * Reading from this pointer when `result_ok` is set is undefined.
6530 struct LDKDecodeError *err;
6531 } LDKCResult_AcceptChannelDecodeErrorZPtr;
6534 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
6535 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
6536 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6538 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
6540 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
6541 * `err` or `result` depending on the state of `result_ok`.
6543 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
6545 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
6548 } LDKCResult_AcceptChannelDecodeErrorZ;
6551 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
6553 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
6555 * A pointer to the contents in the success state.
6556 * Reading from this pointer when `result_ok` is not set is undefined.
6558 struct LDKAnnouncementSignatures *result;
6560 * A pointer to the contents in the error state.
6561 * Reading from this pointer when `result_ok` is set is undefined.
6563 struct LDKDecodeError *err;
6564 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
6567 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
6568 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6569 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6571 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
6573 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
6574 * `err` or `result` depending on the state of `result_ok`.
6576 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
6578 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
6581 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
6584 * The contents of CResult_ChannelReestablishDecodeErrorZ
6586 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
6588 * A pointer to the contents in the success state.
6589 * Reading from this pointer when `result_ok` is not set is undefined.
6591 struct LDKChannelReestablish *result;
6593 * A pointer to the contents in the error state.
6594 * Reading from this pointer when `result_ok` is set is undefined.
6596 struct LDKDecodeError *err;
6597 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
6600 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
6601 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
6602 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6604 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
6606 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
6607 * `err` or `result` depending on the state of `result_ok`.
6609 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
6611 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
6614 } LDKCResult_ChannelReestablishDecodeErrorZ;
6617 * The contents of CResult_ClosingSignedDecodeErrorZ
6619 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
6621 * A pointer to the contents in the success state.
6622 * Reading from this pointer when `result_ok` is not set is undefined.
6624 struct LDKClosingSigned *result;
6626 * A pointer to the contents in the error state.
6627 * Reading from this pointer when `result_ok` is set is undefined.
6629 struct LDKDecodeError *err;
6630 } LDKCResult_ClosingSignedDecodeErrorZPtr;
6633 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
6634 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
6635 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6637 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
6639 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
6640 * `err` or `result` depending on the state of `result_ok`.
6642 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
6644 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
6647 } LDKCResult_ClosingSignedDecodeErrorZ;
6652 * A commitment_signed message to be sent or received from a peer
6654 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
6656 * A pointer to the opaque Rust object.
6657 * Nearly everywhere, inner must be non-null, however in places where
6658 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6660 LDKnativeCommitmentSigned *inner;
6662 * Indicates that this is the only struct which contains the same pointer.
6663 * Rust functions which take ownership of an object provided via an argument require
6664 * this to be true and invalidate the object pointed to by inner.
6667 } LDKCommitmentSigned;
6670 * The contents of CResult_CommitmentSignedDecodeErrorZ
6672 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
6674 * A pointer to the contents in the success state.
6675 * Reading from this pointer when `result_ok` is not set is undefined.
6677 struct LDKCommitmentSigned *result;
6679 * A pointer to the contents in the error state.
6680 * Reading from this pointer when `result_ok` is set is undefined.
6682 struct LDKDecodeError *err;
6683 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
6686 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
6687 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
6688 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6690 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
6692 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
6693 * `err` or `result` depending on the state of `result_ok`.
6695 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
6697 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
6700 } LDKCResult_CommitmentSignedDecodeErrorZ;
6703 * The contents of CResult_FundingCreatedDecodeErrorZ
6705 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
6707 * A pointer to the contents in the success state.
6708 * Reading from this pointer when `result_ok` is not set is undefined.
6710 struct LDKFundingCreated *result;
6712 * A pointer to the contents in the error state.
6713 * Reading from this pointer when `result_ok` is set is undefined.
6715 struct LDKDecodeError *err;
6716 } LDKCResult_FundingCreatedDecodeErrorZPtr;
6719 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
6720 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
6721 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6723 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
6725 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
6726 * `err` or `result` depending on the state of `result_ok`.
6728 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
6730 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
6733 } LDKCResult_FundingCreatedDecodeErrorZ;
6736 * The contents of CResult_FundingSignedDecodeErrorZ
6738 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
6740 * A pointer to the contents in the success state.
6741 * Reading from this pointer when `result_ok` is not set is undefined.
6743 struct LDKFundingSigned *result;
6745 * A pointer to the contents in the error state.
6746 * Reading from this pointer when `result_ok` is set is undefined.
6748 struct LDKDecodeError *err;
6749 } LDKCResult_FundingSignedDecodeErrorZPtr;
6752 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
6753 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
6754 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6756 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
6758 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
6759 * `err` or `result` depending on the state of `result_ok`.
6761 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
6763 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
6766 } LDKCResult_FundingSignedDecodeErrorZ;
6769 * The contents of CResult_FundingLockedDecodeErrorZ
6771 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
6773 * A pointer to the contents in the success state.
6774 * Reading from this pointer when `result_ok` is not set is undefined.
6776 struct LDKFundingLocked *result;
6778 * A pointer to the contents in the error state.
6779 * Reading from this pointer when `result_ok` is set is undefined.
6781 struct LDKDecodeError *err;
6782 } LDKCResult_FundingLockedDecodeErrorZPtr;
6785 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
6786 * containing a crate::lightning::ln::msgs::FundingLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
6787 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6789 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
6791 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
6792 * `err` or `result` depending on the state of `result_ok`.
6794 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
6796 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
6799 } LDKCResult_FundingLockedDecodeErrorZ;
6804 * An init message to be sent or received from a peer
6806 typedef struct MUST_USE_STRUCT LDKInit {
6808 * A pointer to the opaque Rust object.
6809 * Nearly everywhere, inner must be non-null, however in places where
6810 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6812 LDKnativeInit *inner;
6814 * Indicates that this is the only struct which contains the same pointer.
6815 * Rust functions which take ownership of an object provided via an argument require
6816 * this to be true and invalidate the object pointed to by inner.
6822 * The contents of CResult_InitDecodeErrorZ
6824 typedef union LDKCResult_InitDecodeErrorZPtr {
6826 * A pointer to the contents in the success state.
6827 * Reading from this pointer when `result_ok` is not set is undefined.
6829 struct LDKInit *result;
6831 * A pointer to the contents in the error state.
6832 * Reading from this pointer when `result_ok` is set is undefined.
6834 struct LDKDecodeError *err;
6835 } LDKCResult_InitDecodeErrorZPtr;
6838 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
6839 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
6840 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6842 typedef struct LDKCResult_InitDecodeErrorZ {
6844 * The contents of this CResult_InitDecodeErrorZ, accessible via either
6845 * `err` or `result` depending on the state of `result_ok`.
6847 union LDKCResult_InitDecodeErrorZPtr contents;
6849 * Whether this CResult_InitDecodeErrorZ represents a success state.
6852 } LDKCResult_InitDecodeErrorZ;
6855 * The contents of CResult_OpenChannelDecodeErrorZ
6857 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
6859 * A pointer to the contents in the success state.
6860 * Reading from this pointer when `result_ok` is not set is undefined.
6862 struct LDKOpenChannel *result;
6864 * A pointer to the contents in the error state.
6865 * Reading from this pointer when `result_ok` is set is undefined.
6867 struct LDKDecodeError *err;
6868 } LDKCResult_OpenChannelDecodeErrorZPtr;
6871 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
6872 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
6873 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6875 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
6877 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
6878 * `err` or `result` depending on the state of `result_ok`.
6880 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
6882 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
6885 } LDKCResult_OpenChannelDecodeErrorZ;
6888 * The contents of CResult_RevokeAndACKDecodeErrorZ
6890 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
6892 * A pointer to the contents in the success state.
6893 * Reading from this pointer when `result_ok` is not set is undefined.
6895 struct LDKRevokeAndACK *result;
6897 * A pointer to the contents in the error state.
6898 * Reading from this pointer when `result_ok` is set is undefined.
6900 struct LDKDecodeError *err;
6901 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
6904 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
6905 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
6906 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6908 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
6910 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
6911 * `err` or `result` depending on the state of `result_ok`.
6913 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
6915 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
6918 } LDKCResult_RevokeAndACKDecodeErrorZ;
6921 * The contents of CResult_ShutdownDecodeErrorZ
6923 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
6925 * A pointer to the contents in the success state.
6926 * Reading from this pointer when `result_ok` is not set is undefined.
6928 struct LDKShutdown *result;
6930 * A pointer to the contents in the error state.
6931 * Reading from this pointer when `result_ok` is set is undefined.
6933 struct LDKDecodeError *err;
6934 } LDKCResult_ShutdownDecodeErrorZPtr;
6937 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
6938 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
6939 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6941 typedef struct LDKCResult_ShutdownDecodeErrorZ {
6943 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
6944 * `err` or `result` depending on the state of `result_ok`.
6946 union LDKCResult_ShutdownDecodeErrorZPtr contents;
6948 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
6951 } LDKCResult_ShutdownDecodeErrorZ;
6954 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
6956 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
6958 * A pointer to the contents in the success state.
6959 * Reading from this pointer when `result_ok` is not set is undefined.
6961 struct LDKUpdateFailHTLC *result;
6963 * A pointer to the contents in the error state.
6964 * Reading from this pointer when `result_ok` is set is undefined.
6966 struct LDKDecodeError *err;
6967 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
6970 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
6971 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
6972 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6974 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
6976 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
6977 * `err` or `result` depending on the state of `result_ok`.
6979 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
6981 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
6984 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
6987 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
6989 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
6991 * A pointer to the contents in the success state.
6992 * Reading from this pointer when `result_ok` is not set is undefined.
6994 struct LDKUpdateFailMalformedHTLC *result;
6996 * A pointer to the contents in the error state.
6997 * Reading from this pointer when `result_ok` is set is undefined.
6999 struct LDKDecodeError *err;
7000 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
7003 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
7004 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
7005 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7007 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
7009 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
7010 * `err` or `result` depending on the state of `result_ok`.
7012 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
7014 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
7017 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
7022 * An update_fee message to be sent or received from a peer
7024 typedef struct MUST_USE_STRUCT LDKUpdateFee {
7026 * A pointer to the opaque Rust object.
7027 * Nearly everywhere, inner must be non-null, however in places where
7028 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7030 LDKnativeUpdateFee *inner;
7032 * Indicates that this is the only struct which contains the same pointer.
7033 * Rust functions which take ownership of an object provided via an argument require
7034 * this to be true and invalidate the object pointed to by inner.
7040 * The contents of CResult_UpdateFeeDecodeErrorZ
7042 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
7044 * A pointer to the contents in the success state.
7045 * Reading from this pointer when `result_ok` is not set is undefined.
7047 struct LDKUpdateFee *result;
7049 * A pointer to the contents in the error state.
7050 * Reading from this pointer when `result_ok` is set is undefined.
7052 struct LDKDecodeError *err;
7053 } LDKCResult_UpdateFeeDecodeErrorZPtr;
7056 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
7057 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
7058 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7060 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
7062 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
7063 * `err` or `result` depending on the state of `result_ok`.
7065 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
7067 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
7070 } LDKCResult_UpdateFeeDecodeErrorZ;
7073 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
7075 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
7077 * A pointer to the contents in the success state.
7078 * Reading from this pointer when `result_ok` is not set is undefined.
7080 struct LDKUpdateFulfillHTLC *result;
7082 * A pointer to the contents in the error state.
7083 * Reading from this pointer when `result_ok` is set is undefined.
7085 struct LDKDecodeError *err;
7086 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
7089 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
7090 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
7091 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7093 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
7095 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
7096 * `err` or `result` depending on the state of `result_ok`.
7098 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
7100 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
7103 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
7106 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
7108 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
7110 * A pointer to the contents in the success state.
7111 * Reading from this pointer when `result_ok` is not set is undefined.
7113 struct LDKUpdateAddHTLC *result;
7115 * A pointer to the contents in the error state.
7116 * Reading from this pointer when `result_ok` is set is undefined.
7118 struct LDKDecodeError *err;
7119 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
7122 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
7123 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
7124 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7126 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
7128 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
7129 * `err` or `result` depending on the state of `result_ok`.
7131 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
7133 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
7136 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
7141 * A ping message to be sent or received from a peer
7143 typedef struct MUST_USE_STRUCT LDKPing {
7145 * A pointer to the opaque Rust object.
7146 * Nearly everywhere, inner must be non-null, however in places where
7147 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7149 LDKnativePing *inner;
7151 * Indicates that this is the only struct which contains the same pointer.
7152 * Rust functions which take ownership of an object provided via an argument require
7153 * this to be true and invalidate the object pointed to by inner.
7159 * The contents of CResult_PingDecodeErrorZ
7161 typedef union LDKCResult_PingDecodeErrorZPtr {
7163 * A pointer to the contents in the success state.
7164 * Reading from this pointer when `result_ok` is not set is undefined.
7166 struct LDKPing *result;
7168 * A pointer to the contents in the error state.
7169 * Reading from this pointer when `result_ok` is set is undefined.
7171 struct LDKDecodeError *err;
7172 } LDKCResult_PingDecodeErrorZPtr;
7175 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
7176 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
7177 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7179 typedef struct LDKCResult_PingDecodeErrorZ {
7181 * The contents of this CResult_PingDecodeErrorZ, accessible via either
7182 * `err` or `result` depending on the state of `result_ok`.
7184 union LDKCResult_PingDecodeErrorZPtr contents;
7186 * Whether this CResult_PingDecodeErrorZ represents a success state.
7189 } LDKCResult_PingDecodeErrorZ;
7194 * A pong message to be sent or received from a peer
7196 typedef struct MUST_USE_STRUCT LDKPong {
7198 * A pointer to the opaque Rust object.
7199 * Nearly everywhere, inner must be non-null, however in places where
7200 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7202 LDKnativePong *inner;
7204 * Indicates that this is the only struct which contains the same pointer.
7205 * Rust functions which take ownership of an object provided via an argument require
7206 * this to be true and invalidate the object pointed to by inner.
7212 * The contents of CResult_PongDecodeErrorZ
7214 typedef union LDKCResult_PongDecodeErrorZPtr {
7216 * A pointer to the contents in the success state.
7217 * Reading from this pointer when `result_ok` is not set is undefined.
7219 struct LDKPong *result;
7221 * A pointer to the contents in the error state.
7222 * Reading from this pointer when `result_ok` is set is undefined.
7224 struct LDKDecodeError *err;
7225 } LDKCResult_PongDecodeErrorZPtr;
7228 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
7229 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
7230 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7232 typedef struct LDKCResult_PongDecodeErrorZ {
7234 * The contents of this CResult_PongDecodeErrorZ, accessible via either
7235 * `err` or `result` depending on the state of `result_ok`.
7237 union LDKCResult_PongDecodeErrorZPtr contents;
7239 * Whether this CResult_PongDecodeErrorZ represents a success state.
7242 } LDKCResult_PongDecodeErrorZ;
7245 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
7247 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
7249 * A pointer to the contents in the success state.
7250 * Reading from this pointer when `result_ok` is not set is undefined.
7252 struct LDKUnsignedChannelAnnouncement *result;
7254 * A pointer to the contents in the error state.
7255 * Reading from this pointer when `result_ok` is set is undefined.
7257 struct LDKDecodeError *err;
7258 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
7261 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
7262 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7263 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7265 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
7267 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
7268 * `err` or `result` depending on the state of `result_ok`.
7270 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
7272 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
7275 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
7278 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
7280 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
7282 * A pointer to the contents in the success state.
7283 * Reading from this pointer when `result_ok` is not set is undefined.
7285 struct LDKChannelAnnouncement *result;
7287 * A pointer to the contents in the error state.
7288 * Reading from this pointer when `result_ok` is set is undefined.
7290 struct LDKDecodeError *err;
7291 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
7294 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
7295 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7296 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7298 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
7300 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
7301 * `err` or `result` depending on the state of `result_ok`.
7303 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
7305 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
7308 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
7313 * The unsigned part of a channel_update
7315 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
7317 * A pointer to the opaque Rust object.
7318 * Nearly everywhere, inner must be non-null, however in places where
7319 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7321 LDKnativeUnsignedChannelUpdate *inner;
7323 * Indicates that this is the only struct which contains the same pointer.
7324 * Rust functions which take ownership of an object provided via an argument require
7325 * this to be true and invalidate the object pointed to by inner.
7328 } LDKUnsignedChannelUpdate;
7331 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
7333 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
7335 * A pointer to the contents in the success state.
7336 * Reading from this pointer when `result_ok` is not set is undefined.
7338 struct LDKUnsignedChannelUpdate *result;
7340 * A pointer to the contents in the error state.
7341 * Reading from this pointer when `result_ok` is set is undefined.
7343 struct LDKDecodeError *err;
7344 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
7347 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
7348 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
7349 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7351 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
7353 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
7354 * `err` or `result` depending on the state of `result_ok`.
7356 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
7358 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
7361 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
7364 * The contents of CResult_ChannelUpdateDecodeErrorZ
7366 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
7368 * A pointer to the contents in the success state.
7369 * Reading from this pointer when `result_ok` is not set is undefined.
7371 struct LDKChannelUpdate *result;
7373 * A pointer to the contents in the error state.
7374 * Reading from this pointer when `result_ok` is set is undefined.
7376 struct LDKDecodeError *err;
7377 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
7380 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
7381 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
7382 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7384 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
7386 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
7387 * `err` or `result` depending on the state of `result_ok`.
7389 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
7391 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
7394 } LDKCResult_ChannelUpdateDecodeErrorZ;
7397 * The contents of CResult_ErrorMessageDecodeErrorZ
7399 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
7401 * A pointer to the contents in the success state.
7402 * Reading from this pointer when `result_ok` is not set is undefined.
7404 struct LDKErrorMessage *result;
7406 * A pointer to the contents in the error state.
7407 * Reading from this pointer when `result_ok` is set is undefined.
7409 struct LDKDecodeError *err;
7410 } LDKCResult_ErrorMessageDecodeErrorZPtr;
7413 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
7414 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
7415 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7417 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
7419 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
7420 * `err` or `result` depending on the state of `result_ok`.
7422 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
7424 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
7427 } LDKCResult_ErrorMessageDecodeErrorZ;
7432 * The unsigned part of a node_announcement
7434 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
7436 * A pointer to the opaque Rust object.
7437 * Nearly everywhere, inner must be non-null, however in places where
7438 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7440 LDKnativeUnsignedNodeAnnouncement *inner;
7442 * Indicates that this is the only struct which contains the same pointer.
7443 * Rust functions which take ownership of an object provided via an argument require
7444 * this to be true and invalidate the object pointed to by inner.
7447 } LDKUnsignedNodeAnnouncement;
7450 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
7452 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
7454 * A pointer to the contents in the success state.
7455 * Reading from this pointer when `result_ok` is not set is undefined.
7457 struct LDKUnsignedNodeAnnouncement *result;
7459 * A pointer to the contents in the error state.
7460 * Reading from this pointer when `result_ok` is set is undefined.
7462 struct LDKDecodeError *err;
7463 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
7466 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
7467 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7468 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7470 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
7472 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
7473 * `err` or `result` depending on the state of `result_ok`.
7475 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
7477 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
7480 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
7483 * The contents of CResult_NodeAnnouncementDecodeErrorZ
7485 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
7487 * A pointer to the contents in the success state.
7488 * Reading from this pointer when `result_ok` is not set is undefined.
7490 struct LDKNodeAnnouncement *result;
7492 * A pointer to the contents in the error state.
7493 * Reading from this pointer when `result_ok` is set is undefined.
7495 struct LDKDecodeError *err;
7496 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
7499 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
7500 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7501 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7503 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
7505 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
7506 * `err` or `result` depending on the state of `result_ok`.
7508 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
7510 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
7513 } LDKCResult_NodeAnnouncementDecodeErrorZ;
7516 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
7518 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
7520 * A pointer to the contents in the success state.
7521 * Reading from this pointer when `result_ok` is not set is undefined.
7523 struct LDKQueryShortChannelIds *result;
7525 * A pointer to the contents in the error state.
7526 * Reading from this pointer when `result_ok` is set is undefined.
7528 struct LDKDecodeError *err;
7529 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
7532 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
7533 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
7534 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7536 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
7538 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
7539 * `err` or `result` depending on the state of `result_ok`.
7541 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
7543 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
7546 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
7551 * A reply_short_channel_ids_end message is sent as a reply to a
7552 * query_short_channel_ids message. The query recipient makes a best
7553 * effort to respond based on their local network view which may not be
7554 * a perfect view of the network.
7556 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
7558 * A pointer to the opaque Rust object.
7559 * Nearly everywhere, inner must be non-null, however in places where
7560 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7562 LDKnativeReplyShortChannelIdsEnd *inner;
7564 * Indicates that this is the only struct which contains the same pointer.
7565 * Rust functions which take ownership of an object provided via an argument require
7566 * this to be true and invalidate the object pointed to by inner.
7569 } LDKReplyShortChannelIdsEnd;
7572 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
7574 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
7576 * A pointer to the contents in the success state.
7577 * Reading from this pointer when `result_ok` is not set is undefined.
7579 struct LDKReplyShortChannelIdsEnd *result;
7581 * A pointer to the contents in the error state.
7582 * Reading from this pointer when `result_ok` is set is undefined.
7584 struct LDKDecodeError *err;
7585 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
7588 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
7589 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
7590 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7592 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
7594 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
7595 * `err` or `result` depending on the state of `result_ok`.
7597 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
7599 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
7602 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
7605 * The contents of CResult_QueryChannelRangeDecodeErrorZ
7607 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
7609 * A pointer to the contents in the success state.
7610 * Reading from this pointer when `result_ok` is not set is undefined.
7612 struct LDKQueryChannelRange *result;
7614 * A pointer to the contents in the error state.
7615 * Reading from this pointer when `result_ok` is set is undefined.
7617 struct LDKDecodeError *err;
7618 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
7621 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
7622 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
7623 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7625 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
7627 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
7628 * `err` or `result` depending on the state of `result_ok`.
7630 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
7632 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
7635 } LDKCResult_QueryChannelRangeDecodeErrorZ;
7638 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
7640 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
7642 * A pointer to the contents in the success state.
7643 * Reading from this pointer when `result_ok` is not set is undefined.
7645 struct LDKReplyChannelRange *result;
7647 * A pointer to the contents in the error state.
7648 * Reading from this pointer when `result_ok` is set is undefined.
7650 struct LDKDecodeError *err;
7651 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
7654 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
7655 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
7656 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7658 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
7660 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
7661 * `err` or `result` depending on the state of `result_ok`.
7663 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
7665 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
7668 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
7673 * A gossip_timestamp_filter message is used by a node to request
7674 * gossip relay for messages in the requested time range when the
7675 * gossip_queries feature has been negotiated.
7677 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
7679 * A pointer to the opaque Rust object.
7680 * Nearly everywhere, inner must be non-null, however in places where
7681 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7683 LDKnativeGossipTimestampFilter *inner;
7685 * Indicates that this is the only struct which contains the same pointer.
7686 * Rust functions which take ownership of an object provided via an argument require
7687 * this to be true and invalidate the object pointed to by inner.
7690 } LDKGossipTimestampFilter;
7693 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
7695 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
7697 * A pointer to the contents in the success state.
7698 * Reading from this pointer when `result_ok` is not set is undefined.
7700 struct LDKGossipTimestampFilter *result;
7702 * A pointer to the contents in the error state.
7703 * Reading from this pointer when `result_ok` is set is undefined.
7705 struct LDKDecodeError *err;
7706 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
7709 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
7710 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
7711 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7713 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
7715 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
7716 * `err` or `result` depending on the state of `result_ok`.
7718 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
7720 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
7723 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
7726 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
7729 typedef enum LDKSignOrCreationError_Tag {
7731 * An error occurred during signing
7733 LDKSignOrCreationError_SignError,
7735 * An error occurred while building the transaction
7737 LDKSignOrCreationError_CreationError,
7739 * Must be last for serialization purposes
7741 LDKSignOrCreationError_Sentinel,
7742 } LDKSignOrCreationError_Tag;
7744 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
7745 LDKSignOrCreationError_Tag tag;
7748 enum LDKCreationError creation_error;
7751 } LDKSignOrCreationError;
7754 * The contents of CResult_InvoiceSignOrCreationErrorZ
7756 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
7758 * A pointer to the contents in the success state.
7759 * Reading from this pointer when `result_ok` is not set is undefined.
7761 struct LDKInvoice *result;
7763 * A pointer to the contents in the error state.
7764 * Reading from this pointer when `result_ok` is set is undefined.
7766 struct LDKSignOrCreationError *err;
7767 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
7770 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
7771 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
7772 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7774 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
7776 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
7777 * `err` or `result` depending on the state of `result_ok`.
7779 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
7781 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
7784 } LDKCResult_InvoiceSignOrCreationErrorZ;
7787 * A trait indicating an object may generate message send events
7789 typedef struct LDKMessageSendEventsProvider {
7791 * An opaque pointer which is passed to your function implementations as an argument.
7792 * This has no meaning in the LDK, and can be NULL or any other value.
7796 * Gets the list of pending events which were generated by previous actions, clearing the list
7799 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
7801 * Frees any resources associated with this object given its this_arg pointer.
7802 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7804 void (*free)(void *this_arg);
7805 } LDKMessageSendEventsProvider;
7808 * A trait implemented for objects handling events from [`EventsProvider`].
7810 typedef struct LDKEventHandler {
7812 * An opaque pointer which is passed to your function implementations as an argument.
7813 * This has no meaning in the LDK, and can be NULL or any other value.
7817 * Handles the given [`Event`].
7819 * See [`EventsProvider`] for details that must be considered when implementing this method.
7821 void (*handle_event)(const void *this_arg, struct LDKEvent event);
7823 * Frees any resources associated with this object given its this_arg pointer.
7824 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7826 void (*free)(void *this_arg);
7830 * A trait indicating an object may generate events.
7832 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
7836 * See [`process_pending_events`] for requirements around event processing.
7838 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
7839 * event since the last invocation. The handler must either act upon the event immediately
7840 * or preserve it for later handling.
7842 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
7843 * consult the provider's documentation on the implication of processing events and how a handler
7844 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
7845 * [`ChainMonitor::process_pending_events`]).
7847 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
7850 * [`process_pending_events`]: Self::process_pending_events
7851 * [`handle_event`]: EventHandler::handle_event
7852 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
7853 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
7855 typedef struct LDKEventsProvider {
7857 * An opaque pointer which is passed to your function implementations as an argument.
7858 * This has no meaning in the LDK, and can be NULL or any other value.
7862 * Processes any events generated since the last call using the given event handler.
7864 * Subsequent calls must only process new events. However, handlers must be capable of handling
7865 * duplicate events across process restarts. This may occur if the provider was recovered from
7866 * an old state (i.e., it hadn't been successfully persisted after processing pending events).
7868 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
7870 * Frees any resources associated with this object given its this_arg pointer.
7871 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7873 void (*free)(void *this_arg);
7874 } LDKEventsProvider;
7879 * Configuration we set when applicable.
7881 * Default::default() provides sane defaults.
7883 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
7885 * A pointer to the opaque Rust object.
7886 * Nearly everywhere, inner must be non-null, however in places where
7887 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7889 LDKnativeChannelHandshakeConfig *inner;
7891 * Indicates that this is the only struct which contains the same pointer.
7892 * Rust functions which take ownership of an object provided via an argument require
7893 * this to be true and invalidate the object pointed to by inner.
7896 } LDKChannelHandshakeConfig;
7901 * Optional channel limits which are applied during channel creation.
7903 * These limits are only applied to our counterparty's limits, not our own.
7905 * Use 0/<type>::max_value() as appropriate to skip checking.
7907 * Provides sane defaults for most configurations.
7909 * Most additional limits are disabled except those with which specify a default in individual
7910 * field documentation. Note that this may result in barely-usable channels, but since they
7911 * are applied mostly only to incoming channels that's not much of a problem.
7913 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
7915 * A pointer to the opaque Rust object.
7916 * Nearly everywhere, inner must be non-null, however in places where
7917 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7919 LDKnativeChannelHandshakeLimits *inner;
7921 * Indicates that this is the only struct which contains the same pointer.
7922 * Rust functions which take ownership of an object provided via an argument require
7923 * this to be true and invalidate the object pointed to by inner.
7926 } LDKChannelHandshakeLimits;
7931 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
7933 * Default::default() provides sane defaults for most configurations
7934 * (but currently with 0 relay fees!)
7936 typedef struct MUST_USE_STRUCT LDKUserConfig {
7938 * A pointer to the opaque Rust object.
7939 * Nearly everywhere, inner must be non-null, however in places where
7940 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7942 LDKnativeUserConfig *inner;
7944 * Indicates that this is the only struct which contains the same pointer.
7945 * Rust functions which take ownership of an object provided via an argument require
7946 * this to be true and invalidate the object pointed to by inner.
7954 * The best known block as identified by its hash and height.
7956 typedef struct MUST_USE_STRUCT LDKBestBlock {
7958 * A pointer to the opaque Rust object.
7959 * Nearly everywhere, inner must be non-null, however in places where
7960 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7962 LDKnativeBestBlock *inner;
7964 * Indicates that this is the only struct which contains the same pointer.
7965 * Rust functions which take ownership of an object provided via an argument require
7966 * this to be true and invalidate the object pointed to by inner.
7972 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
7975 typedef struct LDKAccess {
7977 * An opaque pointer which is passed to your function implementations as an argument.
7978 * This has no meaning in the LDK, and can be NULL or any other value.
7982 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
7983 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
7986 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
7988 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
7990 * Frees any resources associated with this object given its this_arg pointer.
7991 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7993 void (*free)(void *this_arg);
7997 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
8000 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
8001 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
8002 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
8005 typedef struct LDKListen {
8007 * An opaque pointer which is passed to your function implementations as an argument.
8008 * This has no meaning in the LDK, and can be NULL or any other value.
8012 * Notifies the listener that a block was added at the given height.
8014 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
8016 * Notifies the listener that a block was removed at the given height.
8018 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
8020 * Frees any resources associated with this object given its this_arg pointer.
8021 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8023 void (*free)(void *this_arg);
8027 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
8028 * unconfirmed during a chain reorganization.
8030 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
8031 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
8032 * related to registered transactions and outputs. Upon notification, it would pass along the
8033 * matching transactions using this interface.
8037 * The intended use is as follows:
8038 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
8039 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
8040 * that has been reorganized out of the chain.
8041 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
8045 * Clients must call these methods in chain order. Specifically:
8046 * - Transactions confirmed in a block must be given before transactions confirmed in a later
8048 * - Dependent transactions within the same block must be given in topological order, possibly in
8050 * - Unconfirmed transactions must be given after the original confirmations and before any
8053 * See individual method documentation for further details.
8055 * [`transactions_confirmed`]: Self::transactions_confirmed
8056 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
8057 * [`best_block_updated`]: Self::best_block_updated
8058 * [`get_relevant_txids`]: Self::get_relevant_txids
8060 typedef struct LDKConfirm {
8062 * An opaque pointer which is passed to your function implementations as an argument.
8063 * This has no meaning in the LDK, and can be NULL or any other value.
8067 * Processes transactions confirmed in a block with a given header and height.
8069 * Should be called for any transactions registered by [`Filter::register_tx`] or any
8070 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
8071 * appearing in the same block do not need to be included in the same call; instead, multiple
8072 * calls with additional transactions may be made so long as they are made in [chain order].
8074 * May be called before or after [`best_block_updated`] for the corresponding block. However,
8075 * in the event of a chain reorganization, it must not be called with a `header` that is no
8076 * longer in the chain as of the last call to [`best_block_updated`].
8078 * [chain order]: Confirm#Order
8079 * [`best_block_updated`]: Self::best_block_updated
8081 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
8083 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
8085 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
8086 * reorganized out of the best chain. Once called, the given transaction should not be returned
8087 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
8089 * [`get_relevant_txids`]: Self::get_relevant_txids
8090 * [`transactions_confirmed`]: Self::transactions_confirmed
8092 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
8094 * Processes an update to the best header connected at the given height.
8096 * Should be called when a new header is available but may be skipped for intermediary blocks
8097 * if they become available at the same time.
8099 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
8101 * Returns transactions that should be monitored for reorganization out of the chain.
8103 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
8104 * confirmations to be safe from a chain reorganization. Should not include any transactions
8105 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
8107 * May be called to determine the subset of transactions that must still be monitored for
8108 * reorganization. Will be idempotent between calls but may change as a result of calls to the
8109 * other interface methods. Thus, this is useful to determine which transactions may need to be
8110 * given to [`transaction_unconfirmed`].
8112 * [`transactions_confirmed`]: Self::transactions_confirmed
8113 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
8115 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
8117 * Frees any resources associated with this object given its this_arg pointer.
8118 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8120 void (*free)(void *this_arg);
8126 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
8128 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
8129 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
8130 * the return value of [`Filter::register_output`].
8132 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
8133 * may have been spent there. See [`Filter::register_output`] for details.
8135 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
8136 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
8138 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
8140 * A pointer to the opaque Rust object.
8141 * Nearly everywhere, inner must be non-null, however in places where
8142 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8144 LDKnativeWatchedOutput *inner;
8146 * Indicates that this is the only struct which contains the same pointer.
8147 * Rust functions which take ownership of an object provided via an argument require
8148 * this to be true and invalidate the object pointed to by inner.
8154 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
8157 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
8158 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
8159 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
8160 * receiving full blocks from a chain source, any further filtering is unnecessary.
8162 * After an output has been registered, subsequent block retrievals from the chain source must not
8163 * exclude any transactions matching the new criteria nor any in-block descendants of such
8166 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
8167 * should not block on I/O. Implementations should instead queue the newly monitored data to be
8168 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
8169 * invocation that has called the `Filter` must return [`TemporaryFailure`].
8171 * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
8172 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
8173 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
8175 typedef struct LDKFilter {
8177 * An opaque pointer which is passed to your function implementations as an argument.
8178 * This has no meaning in the LDK, and can be NULL or any other value.
8182 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
8183 * a spending condition.
8185 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
8187 * Registers interest in spends of a transaction output.
8189 * Optionally, when `output.block_hash` is set, should return any transaction spending the
8190 * output that is found in the corresponding block along with its index.
8192 * This return value is useful for Electrum clients in order to supply in-block descendant
8193 * transactions which otherwise were not included. This is not necessary for other clients if
8194 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
8197 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
8199 * Frees any resources associated with this object given its this_arg pointer.
8200 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8202 void (*free)(void *this_arg);
8206 * `Persist` defines behavior for persisting channel monitors: this could mean
8207 * writing once to disk, and/or uploading to one or more backup services.
8209 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
8210 * to disk/backups. And, on every update, you **must** persist either the
8211 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
8212 * of situations such as revoking a transaction, then crashing before this
8213 * revocation can be persisted, then unintentionally broadcasting a revoked
8214 * transaction and losing money. This is a risk because previous channel states
8215 * are toxic, so it's important that whatever channel state is persisted is
8218 typedef struct LDKPersist {
8220 * An opaque pointer which is passed to your function implementations as an argument.
8221 * This has no meaning in the LDK, and can be NULL or any other value.
8225 * Persist a new channel's data. The data can be stored any way you want, but
8226 * the identifier provided by Rust-Lightning is the channel's outpoint (and
8227 * it is up to you to maintain a correct mapping between the outpoint and the
8228 * stored channel data). Note that you **must** persist every new monitor to
8229 * disk. See the `Persist` trait documentation for more details.
8231 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
8232 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
8234 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
8236 * Update one channel's data. The provided `ChannelMonitor` has already
8237 * applied the given update.
8239 * Note that on every update, you **must** persist either the
8240 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
8241 * the `Persist` trait documentation for more details.
8243 * If an implementer chooses to persist the updates only, they need to make
8244 * sure that all the updates are applied to the `ChannelMonitors` *before*
8245 * the set of channel monitors is given to the `ChannelManager`
8246 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
8247 * applying a monitor update to a monitor. If full `ChannelMonitors` are
8248 * persisted, then there is no need to persist individual updates.
8250 * Note that there could be a performance tradeoff between persisting complete
8251 * channel monitors on every update vs. persisting only updates and applying
8252 * them in batches. The size of each monitor grows `O(number of state updates)`
8253 * whereas updates are small and `O(1)`.
8255 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
8256 * [`ChannelMonitorUpdate::write`] for writing out an update, and
8257 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
8259 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);
8261 * Frees any resources associated with this object given its this_arg pointer.
8262 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8264 void (*free)(void *this_arg);
8270 * An implementation of [`chain::Watch`] for monitoring channels.
8272 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
8273 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
8274 * or used independently to monitor channels remotely. See the [module-level documentation] for
8277 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
8278 * [module-level documentation]: crate::chain::chainmonitor
8280 typedef struct MUST_USE_STRUCT LDKChainMonitor {
8282 * A pointer to the opaque Rust object.
8283 * Nearly everywhere, inner must be non-null, however in places where
8284 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8286 LDKnativeChainMonitor *inner;
8288 * Indicates that this is the only struct which contains the same pointer.
8289 * Rust functions which take ownership of an object provided via an argument require
8290 * this to be true and invalidate the object pointed to by inner.
8298 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
8299 * and derives keys from that.
8301 * Your node_id is seed/0'
8302 * ChannelMonitor closes may use seed/1'
8303 * Cooperative closes may use seed/2'
8304 * The two close keys may be needed to claim on-chain funds!
8306 typedef struct MUST_USE_STRUCT LDKKeysManager {
8308 * A pointer to the opaque Rust object.
8309 * Nearly everywhere, inner must be non-null, however in places where
8310 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8312 LDKnativeKeysManager *inner;
8314 * Indicates that this is the only struct which contains the same pointer.
8315 * Rust functions which take ownership of an object provided via an argument require
8316 * this to be true and invalidate the object pointed to by inner.
8324 * Chain-related parameters used to construct a new `ChannelManager`.
8326 * Typically, the block-specific parameters are derived from the best block hash for the network,
8327 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
8328 * are not needed when deserializing a previously constructed `ChannelManager`.
8330 typedef struct MUST_USE_STRUCT LDKChainParameters {
8332 * A pointer to the opaque Rust object.
8333 * Nearly everywhere, inner must be non-null, however in places where
8334 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8336 LDKnativeChainParameters *inner;
8338 * Indicates that this is the only struct which contains the same pointer.
8339 * Rust functions which take ownership of an object provided via an argument require
8340 * this to be true and invalidate the object pointed to by inner.
8343 } LDKChainParameters;
8348 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
8349 * to better separate parameters.
8351 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
8353 * A pointer to the opaque Rust object.
8354 * Nearly everywhere, inner must be non-null, however in places where
8355 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8357 LDKnativeChannelCounterparty *inner;
8359 * Indicates that this is the only struct which contains the same pointer.
8360 * Rust functions which take ownership of an object provided via an argument require
8361 * this to be true and invalidate the object pointed to by inner.
8364 } LDKChannelCounterparty;
8367 * A 3-byte byte array.
8369 typedef struct LDKThreeBytes {
8377 * A trait to describe an object which can receive channel messages.
8379 * Messages MAY be called in parallel when they originate from different their_node_ids, however
8380 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
8382 typedef struct LDKChannelMessageHandler {
8384 * An opaque pointer which is passed to your function implementations as an argument.
8385 * This has no meaning in the LDK, and can be NULL or any other value.
8389 * Handle an incoming open_channel message from the given peer.
8391 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
8393 * Handle an incoming accept_channel message from the given peer.
8395 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
8397 * Handle an incoming funding_created message from the given peer.
8399 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
8401 * Handle an incoming funding_signed message from the given peer.
8403 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
8405 * Handle an incoming funding_locked message from the given peer.
8407 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
8409 * Handle an incoming shutdown message from the given peer.
8411 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);
8413 * Handle an incoming closing_signed message from the given peer.
8415 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
8417 * Handle an incoming update_add_htlc message from the given peer.
8419 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
8421 * Handle an incoming update_fulfill_htlc message from the given peer.
8423 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
8425 * Handle an incoming update_fail_htlc message from the given peer.
8427 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
8429 * Handle an incoming update_fail_malformed_htlc message from the given peer.
8431 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
8433 * Handle an incoming commitment_signed message from the given peer.
8435 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
8437 * Handle an incoming revoke_and_ack message from the given peer.
8439 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
8441 * Handle an incoming update_fee message from the given peer.
8443 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
8445 * Handle an incoming announcement_signatures message from the given peer.
8447 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
8449 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
8450 * is believed to be possible in the future (eg they're sending us messages we don't
8451 * understand or indicate they require unknown feature bits), no_connection_possible is set
8452 * and any outstanding channels should be failed.
8454 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
8456 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
8458 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
8460 * Handle an incoming channel_reestablish message from the given peer.
8462 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
8464 * Handle an incoming channel update from the given peer.
8466 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
8468 * Handle an incoming error message from the given peer.
8470 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
8472 * Implementation of MessageSendEventsProvider for this object.
8474 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8476 * Frees any resources associated with this object given its this_arg pointer.
8477 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8479 void (*free)(void *this_arg);
8480 } LDKChannelMessageHandler;
8485 * Arguments for the creation of a ChannelManager that are not deserialized.
8487 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
8489 * 1) Deserialize all stored ChannelMonitors.
8490 * 2) Deserialize the ChannelManager by filling in this struct and calling:
8491 * <(BlockHash, ChannelManager)>::read(reader, args)
8492 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
8493 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
8494 * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
8495 * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
8496 * ChannelMonitor::get_funding_txo().
8497 * 4) Reconnect blocks on your ChannelMonitors.
8498 * 5) Disconnect/connect blocks on the ChannelManager.
8499 * 6) Move the ChannelMonitors into your local chain::Watch.
8501 * Note that the ordering of #4-6 is not of importance, however all three must occur before you
8502 * call any other methods on the newly-deserialized ChannelManager.
8504 * Note that because some channels may be closed during deserialization, it is critical that you
8505 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
8506 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
8507 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
8508 * not force-close the same channels but consider them live), you may end up revoking a state for
8509 * which you've already broadcasted the transaction.
8511 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
8513 * A pointer to the opaque Rust object.
8514 * Nearly everywhere, inner must be non-null, however in places where
8515 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8517 LDKnativeChannelManagerReadArgs *inner;
8519 * Indicates that this is the only struct which contains the same pointer.
8520 * Rust functions which take ownership of an object provided via an argument require
8521 * this to be true and invalidate the object pointed to by inner.
8524 } LDKChannelManagerReadArgs;
8529 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
8530 * This is used to convince the recipient that the channel is at a certain commitment
8531 * number even if they lost that data due to a local failure. Of course, the peer may lie
8532 * and even later commitments may have been revoked.
8534 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
8536 * A pointer to the opaque Rust object.
8537 * Nearly everywhere, inner must be non-null, however in places where
8538 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8540 LDKnativeDataLossProtect *inner;
8542 * Indicates that this is the only struct which contains the same pointer.
8543 * Rust functions which take ownership of an object provided via an argument require
8544 * this to be true and invalidate the object pointed to by inner.
8547 } LDKDataLossProtect;
8550 * A trait to describe an object which can receive routing messages.
8552 * # Implementor DoS Warnings
8554 * For `gossip_queries` messages there are potential DoS vectors when handling
8555 * inbound queries. Implementors using an on-disk network graph should be aware of
8556 * repeated disk I/O for queries accessing different parts of the network graph.
8558 typedef struct LDKRoutingMessageHandler {
8560 * An opaque pointer which is passed to your function implementations as an argument.
8561 * This has no meaning in the LDK, and can be NULL or any other value.
8565 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
8566 * false or returning an Err otherwise.
8568 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
8570 * Handle a channel_announcement message, returning true if it should be forwarded on, false
8571 * or returning an Err otherwise.
8573 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
8575 * Handle an incoming channel_update message, returning true if it should be forwarded on,
8576 * false or returning an Err otherwise.
8578 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
8580 * Handle some updates to the route graph that we learned due to an outbound failed payment.
8582 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
8584 * Gets a subset of the channel announcements and updates required to dump our routing table
8585 * to a remote node, starting at the short_channel_id indicated by starting_point and
8586 * including the batch_amount entries immediately higher in numerical value than starting_point.
8588 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
8590 * Gets a subset of the node announcements required to dump our routing table to a remote node,
8591 * starting at the node *after* the provided publickey and including batch_amount entries
8592 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
8593 * If None is provided for starting_point, we start at the first node.
8595 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
8597 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
8599 * Called when a connection is established with a peer. This can be used to
8600 * perform routing table synchronization using a strategy defined by the
8603 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
8605 * Handles the reply of a query we initiated to learn about channels
8606 * for a given range of blocks. We can expect to receive one or more
8607 * replies to a single query.
8609 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
8611 * Handles the reply of a query we initiated asking for routing gossip
8612 * messages for a list of channels. We should receive this message when
8613 * a node has completed its best effort to send us the pertaining routing
8616 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
8618 * Handles when a peer asks us to send a list of short_channel_ids
8619 * for the requested range of blocks.
8621 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
8623 * Handles when a peer asks us to send routing gossip messages for a
8624 * list of short_channel_ids.
8626 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
8628 * Implementation of MessageSendEventsProvider for this object.
8630 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8632 * Frees any resources associated with this object given its this_arg pointer.
8633 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8635 void (*free)(void *this_arg);
8636 } LDKRoutingMessageHandler;
8641 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
8642 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
8644 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
8646 * A pointer to the opaque Rust object.
8647 * Nearly everywhere, inner must be non-null, however in places where
8648 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8650 LDKnativeIgnoringMessageHandler *inner;
8652 * Indicates that this is the only struct which contains the same pointer.
8653 * Rust functions which take ownership of an object provided via an argument require
8654 * this to be true and invalidate the object pointed to by inner.
8657 } LDKIgnoringMessageHandler;
8662 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
8663 * You can provide one of these as the route_handler in a MessageHandler.
8665 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
8667 * A pointer to the opaque Rust object.
8668 * Nearly everywhere, inner must be non-null, however in places where
8669 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8671 LDKnativeErroringMessageHandler *inner;
8673 * Indicates that this is the only struct which contains the same pointer.
8674 * Rust functions which take ownership of an object provided via an argument require
8675 * this to be true and invalidate the object pointed to by inner.
8678 } LDKErroringMessageHandler;
8683 * Provides references to trait impls which handle different types of messages.
8685 typedef struct MUST_USE_STRUCT LDKMessageHandler {
8687 * A pointer to the opaque Rust object.
8688 * Nearly everywhere, inner must be non-null, however in places where
8689 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8691 LDKnativeMessageHandler *inner;
8693 * Indicates that this is the only struct which contains the same pointer.
8694 * Rust functions which take ownership of an object provided via an argument require
8695 * this to be true and invalidate the object pointed to by inner.
8698 } LDKMessageHandler;
8701 * Provides an object which can be used to send data to and which uniquely identifies a connection
8702 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
8703 * implement Hash to meet the PeerManager API.
8705 * For efficiency, Clone should be relatively cheap for this type.
8707 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
8708 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
8709 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
8710 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
8711 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
8712 * to simply use another value which is guaranteed to be globally unique instead.
8714 typedef struct LDKSocketDescriptor {
8716 * An opaque pointer which is passed to your function implementations as an argument.
8717 * This has no meaning in the LDK, and can be NULL or any other value.
8721 * Attempts to send some data from the given slice to the peer.
8723 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
8724 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
8725 * called and further write attempts may occur until that time.
8727 * If the returned size is smaller than `data.len()`, a
8728 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
8729 * written. Additionally, until a `send_data` event completes fully, no further
8730 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
8731 * prevent denial-of-service issues, you should not read or buffer any data from the socket
8734 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
8735 * (indicating that read events should be paused to prevent DoS in the send buffer),
8736 * `resume_read` may be set indicating that read events on this descriptor should resume. A
8737 * `resume_read` of false carries no meaning, and should not cause any action.
8739 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
8741 * Disconnect the socket pointed to by this SocketDescriptor.
8743 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
8744 * call (doing so is a noop).
8746 void (*disconnect_socket)(void *this_arg);
8748 * Checks if two objects are equal given this object's this_arg pointer and another object.
8750 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
8752 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
8753 * This is used, for example, for inclusion of this object in a hash map.
8755 uint64_t (*hash)(const void *this_arg);
8757 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
8758 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
8759 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
8761 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
8763 * Frees any resources associated with this object given its this_arg pointer.
8764 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8766 void (*free)(void *this_arg);
8767 } LDKSocketDescriptor;
8772 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
8773 * socket events into messages which it passes on to its [`MessageHandler`].
8775 * Locks are taken internally, so you must never assume that reentrancy from a
8776 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
8778 * Calls to [`read_event`] will decode relevant messages and pass them to the
8779 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
8780 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
8781 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
8782 * calls only after previous ones have returned.
8784 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
8785 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
8786 * essentially you should default to using a SimpleRefPeerManager, and use a
8787 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
8788 * you're using lightning-net-tokio.
8790 * [`read_event`]: PeerManager::read_event
8792 typedef struct MUST_USE_STRUCT LDKPeerManager {
8794 * A pointer to the opaque Rust object.
8795 * Nearly everywhere, inner must be non-null, however in places where
8796 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8798 LDKnativePeerManager *inner;
8800 * Indicates that this is the only struct which contains the same pointer.
8801 * Rust functions which take ownership of an object provided via an argument require
8802 * this to be true and invalidate the object pointed to by inner.
8810 * Static channel fields used to build transactions given per-commitment fields, organized by
8811 * broadcaster/countersignatory.
8813 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
8814 * as_holder_broadcastable and as_counterparty_broadcastable functions.
8816 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
8818 * A pointer to the opaque Rust object.
8819 * Nearly everywhere, inner must be non-null, however in places where
8820 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8822 LDKnativeDirectedChannelTransactionParameters *inner;
8824 * Indicates that this is the only struct which contains the same pointer.
8825 * Rust functions which take ownership of an object provided via an argument require
8826 * this to be true and invalidate the object pointed to by inner.
8829 } LDKDirectedChannelTransactionParameters;
8834 * A channel descriptor for a hop along a payment path.
8836 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
8838 * A pointer to the opaque Rust object.
8839 * Nearly everywhere, inner must be non-null, however in places where
8840 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8842 LDKnativeRouteHintHop *inner;
8844 * Indicates that this is the only struct which contains the same pointer.
8845 * Rust functions which take ownership of an object provided via an argument require
8846 * this to be true and invalidate the object pointed to by inner.
8854 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
8855 * This exists only to make accessing a RwLock<NetworkGraph> possible from
8856 * the C bindings, as it can be done directly in Rust code.
8858 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
8860 * A pointer to the opaque Rust object.
8861 * Nearly everywhere, inner must be non-null, however in places where
8862 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8864 LDKnativeLockedNetworkGraph *inner;
8866 * Indicates that this is the only struct which contains the same pointer.
8867 * Rust functions which take ownership of an object provided via an argument require
8868 * this to be true and invalidate the object pointed to by inner.
8871 } LDKLockedNetworkGraph;
8876 * Receives and validates network updates from peers,
8877 * stores authentic and relevant data as a network graph.
8878 * This network graph is then used for routing payments.
8879 * Provides interface to help with initial routing sync by
8880 * serving historical announcements.
8882 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
8884 * A pointer to the opaque Rust object.
8885 * Nearly everywhere, inner must be non-null, however in places where
8886 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8888 LDKnativeNetGraphMsgHandler *inner;
8890 * Indicates that this is the only struct which contains the same pointer.
8891 * Rust functions which take ownership of an object provided via an argument require
8892 * this to be true and invalidate the object pointed to by inner.
8895 } LDKNetGraphMsgHandler;
8900 * FilesystemPersister persists channel data on disk, where each channel's
8901 * data is stored in a file named after its funding outpoint.
8903 * Warning: this module does the best it can with calls to persist data, but it
8904 * can only guarantee that the data is passed to the drive. It is up to the
8905 * drive manufacturers to do the actual persistence properly, which they often
8906 * don't (especially on consumer-grade hardware). Therefore, it is up to the
8907 * user to validate their entire storage stack, to ensure the writes are
8909 * Corollary: especially when dealing with larger amounts of money, it is best
8910 * practice to have multiple channel data backups and not rely only on one
8911 * FilesystemPersister.
8913 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
8915 * A pointer to the opaque Rust object.
8916 * Nearly everywhere, inner must be non-null, however in places where
8917 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8919 LDKnativeFilesystemPersister *inner;
8921 * Indicates that this is the only struct which contains the same pointer.
8922 * Rust functions which take ownership of an object provided via an argument require
8923 * this to be true and invalidate the object pointed to by inner.
8926 } LDKFilesystemPersister;
8931 * BackgroundProcessor takes care of tasks that (1) need to happen periodically to keep
8932 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
8933 * responsibilities are:
8934 * * Monitoring whether the ChannelManager needs to be re-persisted to disk, and if so,
8935 * writing it to disk/backups by invoking the callback given to it at startup.
8936 * ChannelManager persistence should be done in the background.
8937 * * Calling `ChannelManager::timer_tick_occurred()` and
8938 * `PeerManager::timer_tick_occurred()` every minute (can be done in the
8941 * Note that if ChannelManager persistence fails and the persisted manager becomes out-of-date,
8942 * then there is a risk of channels force-closing on startup when the manager realizes it's
8943 * outdated. However, as long as `ChannelMonitor` backups are sound, no funds besides those used
8944 * for unilateral chain closure fees are at risk.
8946 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
8948 * A pointer to the opaque Rust object.
8949 * Nearly everywhere, inner must be non-null, however in places where
8950 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8952 LDKnativeBackgroundProcessor *inner;
8954 * Indicates that this is the only struct which contains the same pointer.
8955 * Rust functions which take ownership of an object provided via an argument require
8956 * this to be true and invalidate the object pointed to by inner.
8959 } LDKBackgroundProcessor;
8962 * Trait which handles persisting a [`ChannelManager`] to disk.
8964 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
8966 typedef struct LDKChannelManagerPersister {
8968 * An opaque pointer which is passed to your function implementations as an argument.
8969 * This has no meaning in the LDK, and can be NULL or any other value.
8973 * Persist the given [`ChannelManager`] to disk, returning an error if persistence failed
8974 * (which will cause the [`BackgroundProcessor`] which called this method to exit.
8976 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
8978 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
8980 * Frees any resources associated with this object given its this_arg pointer.
8981 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8983 void (*free)(void *this_arg);
8984 } LDKChannelManagerPersister;
8989 * Data of the `RawInvoice` that is encoded in the data part
8991 typedef struct MUST_USE_STRUCT LDKRawDataPart {
8993 * A pointer to the opaque Rust object.
8994 * Nearly everywhere, inner must be non-null, however in places where
8995 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8997 LDKnativeRawDataPart *inner;
8999 * Indicates that this is the only struct which contains the same pointer.
9000 * Rust functions which take ownership of an object provided via an argument require
9001 * this to be true and invalidate the object pointed to by inner.
9011 typedef struct MUST_USE_STRUCT LDKSha256 {
9013 * A pointer to the opaque Rust object.
9014 * Nearly everywhere, inner must be non-null, however in places where
9015 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9017 LDKnativeSha256 *inner;
9019 * Indicates that this is the only struct which contains the same pointer.
9020 * Rust functions which take ownership of an object provided via an argument require
9021 * this to be true and invalidate the object pointed to by inner.
9029 * `min_final_cltv_expiry` to use for the last HTLC in the route
9031 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
9033 * A pointer to the opaque Rust object.
9034 * Nearly everywhere, inner must be non-null, however in places where
9035 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9037 LDKnativeMinFinalCltvExpiry *inner;
9039 * Indicates that this is the only struct which contains the same pointer.
9040 * Rust functions which take ownership of an object provided via an argument require
9041 * this to be true and invalidate the object pointed to by inner.
9044 } LDKMinFinalCltvExpiry;
9047 * Integer in the range `0..32`
9049 typedef struct LDKu5 {
9054 * A 20-byte byte array.
9056 typedef struct LDKTwentyBytes {
9064 * Fallback address in case no LN payment is possible
9066 typedef enum LDKFallback_Tag {
9067 LDKFallback_SegWitProgram,
9068 LDKFallback_PubKeyHash,
9069 LDKFallback_ScriptHash,
9071 * Must be last for serialization purposes
9073 LDKFallback_Sentinel,
9076 typedef struct LDKFallback_LDKSegWitProgram_Body {
9077 struct LDKu5 version;
9078 struct LDKCVec_u8Z program;
9079 } LDKFallback_LDKSegWitProgram_Body;
9081 typedef struct MUST_USE_STRUCT LDKFallback {
9082 LDKFallback_Tag tag;
9084 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
9086 struct LDKTwentyBytes pub_key_hash;
9089 struct LDKTwentyBytes script_hash;
9094 extern const uintptr_t MAX_BUF_SIZE;
9096 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
9098 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
9100 extern const uint32_t ANTI_REORG_DELAY;
9102 extern const uint16_t BREAKDOWN_TIMEOUT;
9104 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
9106 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
9108 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
9110 extern const uint64_t DEFAULT_EXPIRY_TIME;
9112 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY;
9114 extern const uint8_t TAG_PAYMENT_HASH;
9116 extern const uint8_t TAG_DESCRIPTION;
9118 extern const uint8_t TAG_PAYEE_PUB_KEY;
9120 extern const uint8_t TAG_DESCRIPTION_HASH;
9122 extern const uint8_t TAG_EXPIRY_TIME;
9124 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
9126 extern const uint8_t TAG_FALLBACK;
9128 extern const uint8_t TAG_PRIVATE_ROUTE;
9130 extern const uint8_t TAG_PAYMENT_SECRET;
9132 extern const uint8_t TAG_FEATURES;
9134 struct LDKStr _ldk_get_compiled_version(void);
9136 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
9139 * Frees the data buffer, if data_is_owned is set and datalen > 0.
9141 void Transaction_free(struct LDKTransaction _res);
9144 * Convenience function for constructing a new TxOut
9146 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
9149 * Frees the data pointed to by script_pubkey.
9151 void TxOut_free(struct LDKTxOut _res);
9154 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
9156 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
9159 * Frees the data buffer, if chars_is_owned is set and len > 0.
9161 void Str_free(struct LDKStr _res);
9164 * Creates a new CResult_SecretKeyErrorZ in the success state.
9166 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
9169 * Creates a new CResult_SecretKeyErrorZ in the error state.
9171 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
9174 * Frees any resources used by the CResult_SecretKeyErrorZ.
9176 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
9179 * Creates a new CResult_PublicKeyErrorZ in the success state.
9181 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
9184 * Creates a new CResult_PublicKeyErrorZ in the error state.
9186 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
9189 * Frees any resources used by the CResult_PublicKeyErrorZ.
9191 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
9194 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
9195 * but with all dynamically-allocated buffers duplicated in new buffers.
9197 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
9200 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
9202 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
9205 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
9207 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
9210 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
9212 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
9215 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
9216 * but with all dynamically-allocated buffers duplicated in new buffers.
9218 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
9221 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
9223 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
9226 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
9228 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
9231 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
9233 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
9236 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
9237 * but with all dynamically-allocated buffers duplicated in new buffers.
9239 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
9242 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
9244 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
9247 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
9249 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
9252 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
9254 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
9257 * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig`
9258 * but with all dynamically-allocated buffers duplicated in new buffers.
9260 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig);
9263 * Constructs a new COption_u32Z containing a u32
9265 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
9268 * Constructs a new COption_u32Z containing nothing
9270 struct LDKCOption_u32Z COption_u32Z_none(void);
9273 * Frees any resources associated with the u32, if we are in the Some state
9275 void COption_u32Z_free(struct LDKCOption_u32Z _res);
9278 * Creates a new COption_u32Z which has the same data as `orig`
9279 * but with all dynamically-allocated buffers duplicated in new buffers.
9281 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
9284 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
9286 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
9289 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
9291 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
9294 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
9296 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
9299 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
9300 * but with all dynamically-allocated buffers duplicated in new buffers.
9302 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
9305 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
9307 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
9310 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
9312 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
9315 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
9317 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
9320 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
9321 * but with all dynamically-allocated buffers duplicated in new buffers.
9323 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
9326 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
9328 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
9331 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
9333 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
9336 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
9338 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
9341 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
9342 * but with all dynamically-allocated buffers duplicated in new buffers.
9344 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
9347 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9349 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
9352 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
9354 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
9357 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
9359 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9362 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
9364 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
9367 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
9368 * but with all dynamically-allocated buffers duplicated in new buffers.
9370 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9373 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
9375 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
9378 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
9380 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9383 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
9385 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
9388 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
9389 * but with all dynamically-allocated buffers duplicated in new buffers.
9391 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9394 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
9396 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
9399 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
9401 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9404 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
9406 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
9409 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
9410 * but with all dynamically-allocated buffers duplicated in new buffers.
9412 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9415 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
9417 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
9420 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
9422 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
9425 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
9427 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
9430 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
9432 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
9435 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
9437 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
9440 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
9442 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
9445 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
9446 * but with all dynamically-allocated buffers duplicated in new buffers.
9448 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
9451 * Creates a new CResult_NoneErrorZ in the success state.
9453 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
9456 * Creates a new CResult_NoneErrorZ in the error state.
9458 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
9461 * Frees any resources used by the CResult_NoneErrorZ.
9463 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
9466 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
9467 * but with all dynamically-allocated buffers duplicated in new buffers.
9469 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
9472 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
9474 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
9477 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
9479 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
9482 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
9484 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
9487 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
9488 * but with all dynamically-allocated buffers duplicated in new buffers.
9490 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
9493 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9495 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
9498 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9500 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
9503 * Creates a new CResult_RouteDecodeErrorZ in the success state.
9505 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
9508 * Creates a new CResult_RouteDecodeErrorZ in the error state.
9510 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
9513 * Frees any resources used by the CResult_RouteDecodeErrorZ.
9515 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
9518 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
9519 * but with all dynamically-allocated buffers duplicated in new buffers.
9521 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
9524 * Constructs a new COption_u64Z containing a u64
9526 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
9529 * Constructs a new COption_u64Z containing nothing
9531 struct LDKCOption_u64Z COption_u64Z_none(void);
9534 * Frees any resources associated with the u64, if we are in the Some state
9536 void COption_u64Z_free(struct LDKCOption_u64Z _res);
9539 * Creates a new COption_u64Z which has the same data as `orig`
9540 * but with all dynamically-allocated buffers duplicated in new buffers.
9542 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
9545 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9547 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
9550 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9552 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
9555 * Creates a new CResult_RouteLightningErrorZ in the success state.
9557 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
9560 * Creates a new CResult_RouteLightningErrorZ in the error state.
9562 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
9565 * Frees any resources used by the CResult_RouteLightningErrorZ.
9567 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
9570 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
9571 * but with all dynamically-allocated buffers duplicated in new buffers.
9573 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
9576 * Creates a new CResult_TxOutAccessErrorZ in the success state.
9578 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
9581 * Creates a new CResult_TxOutAccessErrorZ in the error state.
9583 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
9586 * Frees any resources used by the CResult_TxOutAccessErrorZ.
9588 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
9591 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
9592 * but with all dynamically-allocated buffers duplicated in new buffers.
9594 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
9597 * Creates a new tuple which has the same data as `orig`
9598 * but with all dynamically-allocated buffers duplicated in new buffers.
9600 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
9603 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
9605 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
9608 * Frees any resources used by the C2Tuple_usizeTransactionZ.
9610 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
9613 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9615 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
9618 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9620 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
9623 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
9625 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
9628 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
9630 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
9633 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
9635 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
9638 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
9639 * but with all dynamically-allocated buffers duplicated in new buffers.
9641 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
9644 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9646 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
9649 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
9651 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
9654 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
9656 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
9659 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
9661 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
9664 * Creates a new COption_C2Tuple_usizeTransactionZZ which has the same data as `orig`
9665 * but with all dynamically-allocated buffers duplicated in new buffers.
9667 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig);
9670 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9672 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
9675 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9677 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
9680 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
9682 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
9685 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
9687 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9690 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
9692 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
9695 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
9697 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
9700 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
9702 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9705 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
9707 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
9710 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
9712 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
9715 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
9717 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9720 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
9722 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
9725 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
9727 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
9730 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
9732 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9735 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
9737 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
9740 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
9742 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
9745 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
9747 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
9750 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
9752 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
9755 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
9756 * but with all dynamically-allocated buffers duplicated in new buffers.
9758 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
9761 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
9763 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
9766 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
9768 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
9771 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
9773 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
9776 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
9777 * but with all dynamically-allocated buffers duplicated in new buffers.
9779 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
9782 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
9784 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
9787 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
9789 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
9792 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
9794 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
9797 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
9798 * but with all dynamically-allocated buffers duplicated in new buffers.
9800 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
9803 * Creates a new tuple which has the same data as `orig`
9804 * but with all dynamically-allocated buffers duplicated in new buffers.
9806 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
9809 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
9811 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
9814 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
9816 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
9819 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
9821 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
9824 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
9826 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
9829 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
9831 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
9834 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
9835 * but with all dynamically-allocated buffers duplicated in new buffers.
9837 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
9840 * Creates a new CResult_SignatureNoneZ in the success state.
9842 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
9845 * Creates a new CResult_SignatureNoneZ in the error state.
9847 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
9850 * Frees any resources used by the CResult_SignatureNoneZ.
9852 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
9855 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
9856 * but with all dynamically-allocated buffers duplicated in new buffers.
9858 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
9861 * Creates a new CResult_SignDecodeErrorZ in the success state.
9863 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
9866 * Creates a new CResult_SignDecodeErrorZ in the error state.
9868 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
9871 * Frees any resources used by the CResult_SignDecodeErrorZ.
9873 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
9876 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
9877 * but with all dynamically-allocated buffers duplicated in new buffers.
9879 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
9882 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9884 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
9887 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
9889 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
9892 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
9894 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
9897 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
9899 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
9902 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
9903 * but with all dynamically-allocated buffers duplicated in new buffers.
9905 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
9908 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9910 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
9913 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
9915 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
9918 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
9920 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
9923 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
9925 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
9928 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
9929 * but with all dynamically-allocated buffers duplicated in new buffers.
9931 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
9934 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
9936 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
9939 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
9941 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
9944 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
9946 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
9949 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
9950 * but with all dynamically-allocated buffers duplicated in new buffers.
9952 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
9955 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9957 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
9960 * Creates a new CResult_TransactionNoneZ in the success state.
9962 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
9965 * Creates a new CResult_TransactionNoneZ in the error state.
9967 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
9970 * Frees any resources used by the CResult_TransactionNoneZ.
9972 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
9975 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
9976 * but with all dynamically-allocated buffers duplicated in new buffers.
9978 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
9981 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
9983 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
9986 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
9988 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
9991 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9993 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
9996 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
9998 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
10001 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
10003 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
10006 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
10008 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
10011 * Constructs a new COption_u16Z containing a u16
10013 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
10016 * Constructs a new COption_u16Z containing nothing
10018 struct LDKCOption_u16Z COption_u16Z_none(void);
10021 * Frees any resources associated with the u16, if we are in the Some state
10023 void COption_u16Z_free(struct LDKCOption_u16Z _res);
10026 * Creates a new COption_u16Z which has the same data as `orig`
10027 * but with all dynamically-allocated buffers duplicated in new buffers.
10029 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
10032 * Creates a new CResult_NoneAPIErrorZ in the success state.
10034 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
10037 * Creates a new CResult_NoneAPIErrorZ in the error state.
10039 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
10042 * Frees any resources used by the CResult_NoneAPIErrorZ.
10044 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
10047 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
10048 * but with all dynamically-allocated buffers duplicated in new buffers.
10050 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
10053 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10055 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
10058 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10060 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
10063 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
10065 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
10068 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
10070 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
10073 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
10075 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
10078 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
10079 * but with all dynamically-allocated buffers duplicated in new buffers.
10081 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
10084 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10086 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
10089 * Creates a new tuple which has the same data as `orig`
10090 * but with all dynamically-allocated buffers duplicated in new buffers.
10092 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
10095 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
10097 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
10100 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
10102 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
10105 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
10107 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
10110 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
10112 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
10115 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
10117 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
10120 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
10121 * but with all dynamically-allocated buffers duplicated in new buffers.
10123 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
10126 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10128 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
10131 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
10133 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
10136 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
10138 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
10141 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
10143 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
10146 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
10148 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
10151 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
10153 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
10156 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
10158 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
10161 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
10163 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
10166 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
10168 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
10171 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
10172 * but with all dynamically-allocated buffers duplicated in new buffers.
10174 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
10177 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
10179 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
10182 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
10184 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
10187 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
10189 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
10192 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
10193 * but with all dynamically-allocated buffers duplicated in new buffers.
10195 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
10198 * Creates a new CResult_SiPrefixNoneZ in the success state.
10200 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_ok(enum LDKSiPrefix o);
10203 * Creates a new CResult_SiPrefixNoneZ in the error state.
10205 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_err(void);
10208 * Frees any resources used by the CResult_SiPrefixNoneZ.
10210 void CResult_SiPrefixNoneZ_free(struct LDKCResult_SiPrefixNoneZ _res);
10213 * Creates a new CResult_SiPrefixNoneZ which has the same data as `orig`
10214 * but with all dynamically-allocated buffers duplicated in new buffers.
10216 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_clone(const struct LDKCResult_SiPrefixNoneZ *NONNULL_PTR orig);
10219 * Creates a new CResult_InvoiceNoneZ in the success state.
10221 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_ok(struct LDKInvoice o);
10224 * Creates a new CResult_InvoiceNoneZ in the error state.
10226 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_err(void);
10229 * Frees any resources used by the CResult_InvoiceNoneZ.
10231 void CResult_InvoiceNoneZ_free(struct LDKCResult_InvoiceNoneZ _res);
10234 * Creates a new CResult_InvoiceNoneZ which has the same data as `orig`
10235 * but with all dynamically-allocated buffers duplicated in new buffers.
10237 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_clone(const struct LDKCResult_InvoiceNoneZ *NONNULL_PTR orig);
10240 * Creates a new CResult_SignedRawInvoiceNoneZ in the success state.
10242 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_ok(struct LDKSignedRawInvoice o);
10245 * Creates a new CResult_SignedRawInvoiceNoneZ in the error state.
10247 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_err(void);
10250 * Frees any resources used by the CResult_SignedRawInvoiceNoneZ.
10252 void CResult_SignedRawInvoiceNoneZ_free(struct LDKCResult_SignedRawInvoiceNoneZ _res);
10255 * Creates a new CResult_SignedRawInvoiceNoneZ which has the same data as `orig`
10256 * but with all dynamically-allocated buffers duplicated in new buffers.
10258 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_clone(const struct LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR orig);
10261 * Creates a new tuple which has the same data as `orig`
10262 * but with all dynamically-allocated buffers duplicated in new buffers.
10264 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
10267 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
10269 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
10272 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
10274 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
10277 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
10279 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
10282 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
10284 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
10287 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
10289 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
10292 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
10293 * but with all dynamically-allocated buffers duplicated in new buffers.
10295 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
10298 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10300 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
10303 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
10305 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
10308 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
10310 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
10313 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
10315 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
10318 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
10319 * but with all dynamically-allocated buffers duplicated in new buffers.
10321 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
10324 * Creates a new CResult_NoneSemanticErrorZ in the success state.
10326 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
10329 * Creates a new CResult_NoneSemanticErrorZ in the error state.
10331 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
10334 * Frees any resources used by the CResult_NoneSemanticErrorZ.
10336 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
10339 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
10340 * but with all dynamically-allocated buffers duplicated in new buffers.
10342 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
10345 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
10347 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
10350 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
10352 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
10355 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
10357 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
10360 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
10361 * but with all dynamically-allocated buffers duplicated in new buffers.
10363 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
10366 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
10368 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
10371 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
10373 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
10376 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
10378 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
10381 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
10382 * but with all dynamically-allocated buffers duplicated in new buffers.
10384 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
10387 * Creates a new CResult_ExpiryTimeCreationErrorZ in the success state.
10389 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_ok(struct LDKExpiryTime o);
10392 * Creates a new CResult_ExpiryTimeCreationErrorZ in the error state.
10394 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_err(enum LDKCreationError e);
10397 * Frees any resources used by the CResult_ExpiryTimeCreationErrorZ.
10399 void CResult_ExpiryTimeCreationErrorZ_free(struct LDKCResult_ExpiryTimeCreationErrorZ _res);
10402 * Creates a new CResult_ExpiryTimeCreationErrorZ which has the same data as `orig`
10403 * but with all dynamically-allocated buffers duplicated in new buffers.
10405 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_clone(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR orig);
10408 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
10410 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
10413 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
10415 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
10418 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
10420 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
10423 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
10424 * but with all dynamically-allocated buffers duplicated in new buffers.
10426 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
10429 * Creates a new CResult_StringErrorZ in the success state.
10431 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
10434 * Creates a new CResult_StringErrorZ in the error state.
10436 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
10439 * Frees any resources used by the CResult_StringErrorZ.
10441 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
10444 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
10446 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
10449 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
10451 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10454 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
10456 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
10459 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
10460 * but with all dynamically-allocated buffers duplicated in new buffers.
10462 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
10465 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
10467 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
10470 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
10472 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10475 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
10477 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
10480 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
10481 * but with all dynamically-allocated buffers duplicated in new buffers.
10483 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
10486 * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
10488 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
10491 * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
10493 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
10496 * Frees any resources used by the CResult_NoneMonitorUpdateErrorZ.
10498 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
10501 * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
10502 * but with all dynamically-allocated buffers duplicated in new buffers.
10504 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
10507 * Creates a new tuple which has the same data as `orig`
10508 * but with all dynamically-allocated buffers duplicated in new buffers.
10510 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
10513 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
10515 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
10518 * Frees any resources used by the C2Tuple_OutPointScriptZ.
10520 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
10523 * Creates a new tuple which has the same data as `orig`
10524 * but with all dynamically-allocated buffers duplicated in new buffers.
10526 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
10529 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
10531 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
10534 * Frees any resources used by the C2Tuple_u32ScriptZ.
10536 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
10539 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10541 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
10544 * Creates a new tuple which has the same data as `orig`
10545 * but with all dynamically-allocated buffers duplicated in new buffers.
10547 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
10550 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
10552 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
10555 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
10557 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
10560 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10562 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
10565 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10567 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
10570 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10572 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
10575 * Creates a new tuple which has the same data as `orig`
10576 * but with all dynamically-allocated buffers duplicated in new buffers.
10578 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
10581 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
10583 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
10586 * Frees any resources used by the C2Tuple_u32TxOutZ.
10588 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
10591 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10593 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
10596 * Creates a new tuple which has the same data as `orig`
10597 * but with all dynamically-allocated buffers duplicated in new buffers.
10599 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
10602 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
10604 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
10607 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
10609 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
10612 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10614 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
10617 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
10619 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
10622 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
10624 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
10627 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
10629 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
10632 * Creates a new CResult_boolLightningErrorZ in the success state.
10634 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
10637 * Creates a new CResult_boolLightningErrorZ in the error state.
10639 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
10642 * Frees any resources used by the CResult_boolLightningErrorZ.
10644 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
10647 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
10648 * but with all dynamically-allocated buffers duplicated in new buffers.
10650 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
10653 * Creates a new tuple which has the same data as `orig`
10654 * but with all dynamically-allocated buffers duplicated in new buffers.
10656 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
10659 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
10661 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
10664 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
10666 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
10669 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10671 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
10674 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10676 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
10679 * Creates a new CResult_NoneLightningErrorZ in the success state.
10681 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
10684 * Creates a new CResult_NoneLightningErrorZ in the error state.
10686 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
10689 * Frees any resources used by the CResult_NoneLightningErrorZ.
10691 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
10694 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
10695 * but with all dynamically-allocated buffers duplicated in new buffers.
10697 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
10700 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10702 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
10705 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
10707 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
10710 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
10712 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
10715 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
10717 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
10720 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
10721 * but with all dynamically-allocated buffers duplicated in new buffers.
10723 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
10726 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
10728 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
10731 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
10733 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
10736 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
10738 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
10741 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
10742 * but with all dynamically-allocated buffers duplicated in new buffers.
10744 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
10747 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
10749 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
10752 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
10754 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
10757 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
10759 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
10762 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
10763 * but with all dynamically-allocated buffers duplicated in new buffers.
10765 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
10768 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
10770 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
10773 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
10775 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
10778 * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
10780 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
10783 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
10784 * but with all dynamically-allocated buffers duplicated in new buffers.
10786 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
10789 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
10791 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
10794 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
10796 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
10799 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
10801 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
10804 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
10805 * but with all dynamically-allocated buffers duplicated in new buffers.
10807 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
10810 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
10812 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
10815 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
10817 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
10820 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
10822 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
10825 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
10826 * but with all dynamically-allocated buffers duplicated in new buffers.
10828 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
10831 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
10833 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
10836 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
10838 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
10841 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
10843 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
10846 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
10847 * but with all dynamically-allocated buffers duplicated in new buffers.
10849 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
10852 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10854 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
10857 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
10859 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
10862 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
10864 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
10867 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
10869 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
10872 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
10873 * but with all dynamically-allocated buffers duplicated in new buffers.
10875 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
10878 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
10880 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
10883 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
10885 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
10888 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
10890 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
10893 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
10894 * but with all dynamically-allocated buffers duplicated in new buffers.
10896 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
10899 * Creates a new CResult_NetAddressu8Z in the success state.
10901 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
10904 * Creates a new CResult_NetAddressu8Z in the error state.
10906 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
10909 * Frees any resources used by the CResult_NetAddressu8Z.
10911 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
10914 * Creates a new CResult_NetAddressu8Z which has the same data as `orig`
10915 * but with all dynamically-allocated buffers duplicated in new buffers.
10917 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
10920 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state.
10922 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
10925 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state.
10927 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
10930 * Frees any resources used by the CResult_CResult_NetAddressu8ZDecodeErrorZ.
10932 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
10935 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig`
10936 * but with all dynamically-allocated buffers duplicated in new buffers.
10938 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
10941 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
10943 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
10946 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
10948 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
10951 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
10953 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
10956 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
10957 * but with all dynamically-allocated buffers duplicated in new buffers.
10959 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
10962 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10964 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
10967 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10969 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
10972 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10974 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
10977 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10979 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
10982 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
10984 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
10987 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
10989 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
10992 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
10994 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
10997 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
10998 * but with all dynamically-allocated buffers duplicated in new buffers.
11000 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
11003 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
11005 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
11008 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
11010 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
11013 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
11015 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
11018 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
11019 * but with all dynamically-allocated buffers duplicated in new buffers.
11021 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
11024 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
11026 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
11029 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
11031 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
11034 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
11036 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
11039 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
11040 * but with all dynamically-allocated buffers duplicated in new buffers.
11042 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
11045 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
11047 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
11050 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
11052 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
11055 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
11057 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
11060 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
11061 * but with all dynamically-allocated buffers duplicated in new buffers.
11063 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
11066 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
11068 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
11071 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
11073 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
11076 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
11078 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
11081 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
11082 * but with all dynamically-allocated buffers duplicated in new buffers.
11084 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
11087 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
11089 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
11092 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
11094 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
11097 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
11099 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
11102 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
11103 * but with all dynamically-allocated buffers duplicated in new buffers.
11105 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
11108 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
11110 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
11113 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
11115 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
11118 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
11120 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
11123 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
11124 * but with all dynamically-allocated buffers duplicated in new buffers.
11126 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
11129 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
11131 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
11134 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
11136 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
11139 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
11141 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
11144 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
11145 * but with all dynamically-allocated buffers duplicated in new buffers.
11147 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
11150 * Creates a new CResult_InitDecodeErrorZ in the success state.
11152 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
11155 * Creates a new CResult_InitDecodeErrorZ in the error state.
11157 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
11160 * Frees any resources used by the CResult_InitDecodeErrorZ.
11162 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
11165 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
11166 * but with all dynamically-allocated buffers duplicated in new buffers.
11168 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
11171 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
11173 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
11176 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
11178 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
11181 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
11183 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
11186 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
11187 * but with all dynamically-allocated buffers duplicated in new buffers.
11189 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
11192 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
11194 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
11197 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
11199 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
11202 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
11204 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
11207 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
11208 * but with all dynamically-allocated buffers duplicated in new buffers.
11210 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
11213 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
11215 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
11218 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
11220 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
11223 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
11225 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
11228 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
11229 * but with all dynamically-allocated buffers duplicated in new buffers.
11231 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
11234 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
11236 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
11239 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
11241 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11244 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
11246 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
11249 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
11250 * but with all dynamically-allocated buffers duplicated in new buffers.
11252 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
11255 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
11257 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
11260 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
11262 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11265 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
11267 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
11270 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
11271 * but with all dynamically-allocated buffers duplicated in new buffers.
11273 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
11276 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
11278 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
11281 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
11283 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
11286 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
11288 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
11291 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
11292 * but with all dynamically-allocated buffers duplicated in new buffers.
11294 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
11297 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
11299 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
11302 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
11304 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11307 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
11309 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
11312 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
11313 * but with all dynamically-allocated buffers duplicated in new buffers.
11315 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
11318 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
11320 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
11323 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
11325 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11328 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
11330 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
11333 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
11334 * but with all dynamically-allocated buffers duplicated in new buffers.
11336 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
11339 * Creates a new CResult_PingDecodeErrorZ in the success state.
11341 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
11344 * Creates a new CResult_PingDecodeErrorZ in the error state.
11346 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
11349 * Frees any resources used by the CResult_PingDecodeErrorZ.
11351 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
11354 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
11355 * but with all dynamically-allocated buffers duplicated in new buffers.
11357 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
11360 * Creates a new CResult_PongDecodeErrorZ in the success state.
11362 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
11365 * Creates a new CResult_PongDecodeErrorZ in the error state.
11367 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
11370 * Frees any resources used by the CResult_PongDecodeErrorZ.
11372 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
11375 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
11376 * but with all dynamically-allocated buffers duplicated in new buffers.
11378 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
11381 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
11383 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
11386 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
11388 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11391 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
11393 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
11396 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
11397 * but with all dynamically-allocated buffers duplicated in new buffers.
11399 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11402 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
11404 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
11407 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
11409 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11412 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
11414 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
11417 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
11418 * but with all dynamically-allocated buffers duplicated in new buffers.
11420 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11423 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
11425 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
11428 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
11430 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
11433 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
11435 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
11438 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
11439 * but with all dynamically-allocated buffers duplicated in new buffers.
11441 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
11444 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
11446 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
11449 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
11451 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
11454 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
11456 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
11459 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
11460 * but with all dynamically-allocated buffers duplicated in new buffers.
11462 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
11465 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
11467 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
11470 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
11472 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
11475 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
11477 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
11480 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
11481 * but with all dynamically-allocated buffers duplicated in new buffers.
11483 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
11486 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
11488 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
11491 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
11493 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11496 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
11498 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
11501 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
11502 * but with all dynamically-allocated buffers duplicated in new buffers.
11504 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11507 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
11509 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
11512 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
11514 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11517 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
11519 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
11522 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
11523 * but with all dynamically-allocated buffers duplicated in new buffers.
11525 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11528 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
11530 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
11533 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
11535 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
11538 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
11540 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
11543 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
11544 * but with all dynamically-allocated buffers duplicated in new buffers.
11546 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
11549 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
11551 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
11554 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
11556 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
11559 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
11561 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
11564 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
11565 * but with all dynamically-allocated buffers duplicated in new buffers.
11567 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
11570 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
11572 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
11575 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
11577 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
11580 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
11582 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
11585 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
11586 * but with all dynamically-allocated buffers duplicated in new buffers.
11588 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
11591 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
11593 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
11596 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
11598 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
11601 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
11603 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
11606 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
11607 * but with all dynamically-allocated buffers duplicated in new buffers.
11609 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
11612 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
11614 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
11617 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
11619 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
11622 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
11624 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
11627 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
11628 * but with all dynamically-allocated buffers duplicated in new buffers.
11630 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
11633 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
11635 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
11638 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
11640 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
11643 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
11645 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
11648 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
11649 * but with all dynamically-allocated buffers duplicated in new buffers.
11651 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
11654 * Frees any resources used by the Event
11656 void Event_free(struct LDKEvent this_ptr);
11659 * Creates a copy of the Event
11661 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
11664 * Utility method to constructs a new FundingGenerationReady-variant Event
11666 struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, uint64_t user_channel_id);
11669 * Utility method to constructs a new PaymentReceived-variant Event
11671 struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t amt, uint64_t user_payment_id);
11674 * Utility method to constructs a new PaymentSent-variant Event
11676 struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_preimage);
11679 * Utility method to constructs a new PaymentFailed-variant Event
11681 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest);
11684 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
11686 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
11689 * Utility method to constructs a new SpendableOutputs-variant Event
11691 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
11694 * Serialize the Event object into a byte array which can be read by Event_read
11696 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
11699 * Frees any resources used by the MessageSendEvent
11701 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
11704 * Creates a copy of the MessageSendEvent
11706 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
11709 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
11711 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
11714 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
11716 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
11719 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
11721 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
11724 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
11726 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
11729 * Utility method to constructs a new SendFundingLocked-variant MessageSendEvent
11731 struct LDKMessageSendEvent MessageSendEvent_send_funding_locked(struct LDKPublicKey node_id, struct LDKFundingLocked msg);
11734 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
11736 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
11739 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
11741 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
11744 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
11746 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
11749 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
11751 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
11754 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
11756 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
11759 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
11761 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
11764 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
11766 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
11769 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
11771 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
11774 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
11776 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
11779 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
11781 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
11784 * Utility method to constructs a new HandleError-variant MessageSendEvent
11786 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
11789 * Utility method to constructs a new PaymentFailureNetworkUpdate-variant MessageSendEvent
11791 struct LDKMessageSendEvent MessageSendEvent_payment_failure_network_update(struct LDKHTLCFailChannelUpdate update);
11794 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
11796 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
11799 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
11801 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
11804 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
11806 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
11809 * Calls the free function if one is set
11811 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
11814 * Calls the free function if one is set
11816 void EventsProvider_free(struct LDKEventsProvider this_ptr);
11819 * Calls the free function if one is set
11821 void EventHandler_free(struct LDKEventHandler this_ptr);
11824 * Frees any resources used by the APIError
11826 void APIError_free(struct LDKAPIError this_ptr);
11829 * Creates a copy of the APIError
11831 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
11834 * Utility method to constructs a new APIMisuseError-variant APIError
11836 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
11839 * Utility method to constructs a new FeeRateTooHigh-variant APIError
11841 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
11844 * Utility method to constructs a new RouteError-variant APIError
11846 struct LDKAPIError APIError_route_error(struct LDKStr err);
11849 * Utility method to constructs a new ChannelUnavailable-variant APIError
11851 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
11854 * Utility method to constructs a new MonitorUpdateFailed-variant APIError
11856 struct LDKAPIError APIError_monitor_update_failed(void);
11859 * Creates a digital signature of a message given a SecretKey, like the node's secret.
11860 * 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.
11861 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
11863 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
11866 * Recovers the PublicKey of the signer of the message given the message and the signature.
11868 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
11871 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
11872 * and the PublicKey.
11874 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
11877 * Creates a copy of the Level
11879 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
11882 * Utility method to constructs a new Trace-variant Level
11884 enum LDKLevel Level_trace(void);
11887 * Utility method to constructs a new Debug-variant Level
11889 enum LDKLevel Level_debug(void);
11892 * Utility method to constructs a new Info-variant Level
11894 enum LDKLevel Level_info(void);
11897 * Utility method to constructs a new Warn-variant Level
11899 enum LDKLevel Level_warn(void);
11902 * Utility method to constructs a new Error-variant Level
11904 enum LDKLevel Level_error(void);
11907 * Checks if two Levels contain equal inner contents.
11908 * This ignores pointers and is_owned flags and looks at the values in fields.
11910 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
11913 * Checks if two Levels contain equal inner contents.
11915 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
11918 * Returns the most verbose logging level.
11920 MUST_USE_RES enum LDKLevel Level_max(void);
11923 * Calls the free function if one is set
11925 void Logger_free(struct LDKLogger this_ptr);
11928 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
11930 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
11933 * Confirmations we will wait for before considering the channel locked in.
11934 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
11935 * equivalent limit applied to outbound channels).
11937 * Default value: 6.
11939 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11942 * Confirmations we will wait for before considering the channel locked in.
11943 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
11944 * equivalent limit applied to outbound channels).
11946 * Default value: 6.
11948 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
11951 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
11952 * the number of blocks we have to punish our counterparty if they broadcast a revoked
11955 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
11956 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
11957 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
11958 * possibly with time in between to RBF the spending transaction).
11960 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
11961 * case of an honest unilateral channel close, which implicitly decrease the economic value of
11964 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
11965 * can tweak config to ask for more security, not less.
11967 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11970 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
11971 * the number of blocks we have to punish our counterparty if they broadcast a revoked
11974 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
11975 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
11976 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
11977 * possibly with time in between to RBF the spending transaction).
11979 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
11980 * case of an honest unilateral channel close, which implicitly decrease the economic value of
11983 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
11984 * can tweak config to ask for more security, not less.
11986 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
11989 * Set to the smallest value HTLC we will accept to process.
11991 * This value is sent to our counterparty on channel-open and we close the channel any time
11992 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
11994 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
11997 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
12000 * Set to the smallest value HTLC we will accept to process.
12002 * This value is sent to our counterparty on channel-open and we close the channel any time
12003 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
12005 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
12008 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
12011 * Constructs a new ChannelHandshakeConfig given each field
12013 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);
12016 * Creates a copy of the ChannelHandshakeConfig
12018 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
12021 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
12023 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
12026 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
12028 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
12031 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
12032 * only applies to inbound channels.
12034 * Default value: 0.
12036 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12039 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
12040 * only applies to inbound channels.
12042 * Default value: 0.
12044 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
12047 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
12048 * you to limit the maximum minimum-size they can require.
12050 * Default value: u64::max_value.
12052 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12055 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
12056 * you to limit the maximum minimum-size they can require.
12058 * Default value: u64::max_value.
12060 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
12063 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
12064 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
12066 * Default value: 0.
12068 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12071 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
12072 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
12074 * Default value: 0.
12076 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
12079 * The remote node will require we keep a certain amount in direct payment to ourselves at all
12080 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
12081 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
12083 * Default value: u64::max_value.
12085 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12088 * The remote node will require we keep a certain amount in direct payment to ourselves at all
12089 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
12090 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
12092 * Default value: u64::max_value.
12094 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
12097 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
12098 * time. This allows you to set a minimum such value.
12100 * Default value: 0.
12102 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12105 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
12106 * time. This allows you to set a minimum such value.
12108 * Default value: 0.
12110 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
12113 * Before a channel is usable the funding transaction will need to be confirmed by at least a
12114 * certain number of blocks, specified by the node which is not the funder (as the funder can
12115 * assume they aren't going to double-spend themselves).
12116 * This config allows you to set a limit on the maximum amount of time to wait.
12118 * Default value: 144, or roughly one day and only applies to outbound channels.
12120 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12123 * Before a channel is usable the funding transaction will need to be confirmed by at least a
12124 * certain number of blocks, specified by the node which is not the funder (as the funder can
12125 * assume they aren't going to double-spend themselves).
12126 * This config allows you to set a limit on the maximum amount of time to wait.
12128 * Default value: 144, or roughly one day and only applies to outbound channels.
12130 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
12133 * Set to force an incoming channel to match our announced channel preference in
12134 * [`ChannelConfig::announced_channel`].
12136 * For a node which is not online reliably, this should be set to true and
12137 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
12138 * channels will ever be opened.
12140 * Default value: true.
12142 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12145 * Set to force an incoming channel to match our announced channel preference in
12146 * [`ChannelConfig::announced_channel`].
12148 * For a node which is not online reliably, this should be set to true and
12149 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
12150 * channels will ever be opened.
12152 * Default value: true.
12154 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
12157 * Set to the amount of time we're willing to wait to claim money back to us.
12159 * Not checking this value would be a security issue, as our peer would be able to set it to
12160 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
12162 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
12163 * reduce the loss of having useless locked funds (if your peer accepts)
12165 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12168 * Set to the amount of time we're willing to wait to claim money back to us.
12170 * Not checking this value would be a security issue, as our peer would be able to set it to
12171 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
12173 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
12174 * reduce the loss of having useless locked funds (if your peer accepts)
12176 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
12179 * Constructs a new ChannelHandshakeLimits given each field
12181 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);
12184 * Creates a copy of the ChannelHandshakeLimits
12186 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
12189 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
12191 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
12194 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
12196 void ChannelConfig_free(struct LDKChannelConfig this_obj);
12199 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
12200 * over the channel.
12201 * This may be allowed to change at runtime in a later update, however doing so must result in
12202 * update messages sent to notify all nodes of our updated relay fee.
12204 * Default value: 0.
12206 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12209 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
12210 * over the channel.
12211 * This may be allowed to change at runtime in a later update, however doing so must result in
12212 * update messages sent to notify all nodes of our updated relay fee.
12214 * Default value: 0.
12216 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
12219 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
12220 * excess of [`forwarding_fee_proportional_millionths`].
12221 * This may be allowed to change at runtime in a later update, however doing so must result in
12222 * update messages sent to notify all nodes of our updated relay fee.
12224 * The default value of a single satoshi roughly matches the market rate on many routing nodes
12225 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
12228 * Default value: 1000.
12230 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
12232 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12235 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
12236 * excess of [`forwarding_fee_proportional_millionths`].
12237 * This may be allowed to change at runtime in a later update, however doing so must result in
12238 * update messages sent to notify all nodes of our updated relay fee.
12240 * The default value of a single satoshi roughly matches the market rate on many routing nodes
12241 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
12244 * Default value: 1000.
12246 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
12248 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
12251 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
12252 * the channel this config applies to.
12254 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
12255 * HTLC balance when a channel appears on-chain whereas
12256 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
12257 * (non-HTLC-encumbered) balance.
12259 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
12260 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
12261 * commitment transaction at least once per this many blocks (minus some margin to allow us
12262 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
12263 * the spending transaction).
12265 * Default value: 72 (12 hours at an average of 6 blocks/hour).
12266 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
12267 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
12269 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
12271 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12274 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
12275 * the channel this config applies to.
12277 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
12278 * HTLC balance when a channel appears on-chain whereas
12279 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
12280 * (non-HTLC-encumbered) balance.
12282 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
12283 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
12284 * commitment transaction at least once per this many blocks (minus some margin to allow us
12285 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
12286 * the spending transaction).
12288 * Default value: 72 (12 hours at an average of 6 blocks/hour).
12289 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
12290 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
12292 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
12294 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
12297 * Set to announce the channel publicly and notify all nodes that they can route via this
12300 * This should only be set to true for nodes which expect to be online reliably.
12302 * As the node which funds a channel picks this value this will only apply for new outbound
12303 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
12305 * This cannot be changed after the initial channel handshake.
12307 * Default value: false.
12309 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12312 * Set to announce the channel publicly and notify all nodes that they can route via this
12315 * This should only be set to true for nodes which expect to be online reliably.
12317 * As the node which funds a channel picks this value this will only apply for new outbound
12318 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
12320 * This cannot be changed after the initial channel handshake.
12322 * Default value: false.
12324 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
12327 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
12328 * supports it, they will then enforce the mutual-close output to us matches what we provided
12329 * at intialization, preventing us from closing to an alternate pubkey.
12331 * This is set to true by default to provide a slight increase in security, though ultimately
12332 * any attacker who is able to take control of a channel can just as easily send the funds via
12333 * lightning payments, so we never require that our counterparties support this option.
12335 * This cannot be changed after a channel has been initialized.
12337 * Default value: true.
12339 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12342 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
12343 * supports it, they will then enforce the mutual-close output to us matches what we provided
12344 * at intialization, preventing us from closing to an alternate pubkey.
12346 * This is set to true by default to provide a slight increase in security, though ultimately
12347 * any attacker who is able to take control of a channel can just as easily send the funds via
12348 * lightning payments, so we never require that our counterparties support this option.
12350 * This cannot be changed after a channel has been initialized.
12352 * Default value: true.
12354 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
12357 * Constructs a new ChannelConfig given each field
12359 MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t forwarding_fee_proportional_millionths_arg, uint32_t forwarding_fee_base_msat_arg, uint16_t cltv_expiry_delta_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
12362 * Creates a copy of the ChannelConfig
12364 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
12367 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
12369 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
12372 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
12374 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
12377 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
12379 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
12382 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
12384 void UserConfig_free(struct LDKUserConfig this_obj);
12387 * Channel config that we propose to our counterparty.
12389 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
12392 * Channel config that we propose to our counterparty.
12394 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
12397 * Limits applied to our counterparty's proposed channel config settings.
12399 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
12402 * Limits applied to our counterparty's proposed channel config settings.
12404 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
12407 * Channel config which affects behavior during channel lifetime.
12409 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
12412 * Channel config which affects behavior during channel lifetime.
12414 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
12417 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
12418 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
12419 * node which is not online reliably.
12421 * For nodes which are not online reliably, you should set all channels to *not* be announced
12422 * (using [`ChannelConfig::announced_channel`] and
12423 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
12424 * ensure you are not exposed to any forwarding risk.
12426 * Note that because you cannot change a channel's announced state after creation, there is no
12427 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
12428 * from a publicly-announced forwarding node to a private non-forwarding node you must close
12429 * all your channels and open new ones. For privacy, you should also change your node_id
12430 * (swapping all private and public key material for new ones) at that time.
12432 * Default value: false.
12434 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
12437 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
12438 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
12439 * node which is not online reliably.
12441 * For nodes which are not online reliably, you should set all channels to *not* be announced
12442 * (using [`ChannelConfig::announced_channel`] and
12443 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
12444 * ensure you are not exposed to any forwarding risk.
12446 * Note that because you cannot change a channel's announced state after creation, there is no
12447 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
12448 * from a publicly-announced forwarding node to a private non-forwarding node you must close
12449 * all your channels and open new ones. For privacy, you should also change your node_id
12450 * (swapping all private and public key material for new ones) at that time.
12452 * Default value: false.
12454 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
12457 * Constructs a new UserConfig given each field
12459 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, bool accept_forwards_to_priv_channels_arg);
12462 * Creates a copy of the UserConfig
12464 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
12467 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
12469 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
12472 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
12474 void BestBlock_free(struct LDKBestBlock this_obj);
12477 * Creates a copy of the BestBlock
12479 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
12482 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
12485 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
12488 * Returns a `BestBlock` as identified by the given block hash and height.
12490 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
12493 * Returns the best block hash.
12495 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
12498 * Returns the best block height.
12500 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
12503 * Creates a copy of the AccessError
12505 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
12508 * Utility method to constructs a new UnknownChain-variant AccessError
12510 enum LDKAccessError AccessError_unknown_chain(void);
12513 * Utility method to constructs a new UnknownTx-variant AccessError
12515 enum LDKAccessError AccessError_unknown_tx(void);
12518 * Calls the free function if one is set
12520 void Access_free(struct LDKAccess this_ptr);
12523 * Calls the free function if one is set
12525 void Listen_free(struct LDKListen this_ptr);
12528 * Calls the free function if one is set
12530 void Confirm_free(struct LDKConfirm this_ptr);
12533 * Calls the free function if one is set
12535 void Watch_free(struct LDKWatch this_ptr);
12538 * Calls the free function if one is set
12540 void Filter_free(struct LDKFilter this_ptr);
12543 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
12545 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
12548 * First block where the transaction output may have been spent.
12550 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
12552 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
12555 * First block where the transaction output may have been spent.
12557 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
12559 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12562 * Outpoint identifying the transaction output.
12564 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
12567 * Outpoint identifying the transaction output.
12569 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12572 * Spending condition of the transaction output.
12574 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
12577 * Spending condition of the transaction output.
12579 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
12582 * Constructs a new WatchedOutput given each field
12584 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
12587 * Creates a copy of the WatchedOutput
12589 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
12592 * Checks if two WatchedOutputs contain equal inner contents.
12594 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
12597 * Calls the free function if one is set
12599 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
12602 * Creates a copy of the ConfirmationTarget
12604 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
12607 * Utility method to constructs a new Background-variant ConfirmationTarget
12609 enum LDKConfirmationTarget ConfirmationTarget_background(void);
12612 * Utility method to constructs a new Normal-variant ConfirmationTarget
12614 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
12617 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
12619 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
12622 * Calls the free function if one is set
12624 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
12627 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
12629 void ChainMonitor_free(struct LDKChainMonitor this_obj);
12632 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
12634 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
12635 * will call back to it indicating transactions and outputs of interest. This allows clients to
12636 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
12637 * always need to fetch full blocks absent another means for determining which blocks contain
12638 * transactions relevant to the watched channels.
12640 * Note that chain_source (or a relevant inner pointer) may be NULL or all-0s to represent None
12642 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
12645 * Constructs a new Listen which calls the relevant methods on this_arg.
12646 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
12648 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12651 * Constructs a new Confirm which calls the relevant methods on this_arg.
12652 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
12654 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12657 * Constructs a new Watch which calls the relevant methods on this_arg.
12658 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
12660 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12663 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
12664 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
12666 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12669 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
12671 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
12674 * The sequence number of this update. Updates *must* be replayed in-order according to this
12675 * sequence number (and updates may panic if they are not). The update_id values are strictly
12676 * increasing and increase by one for each new update, with one exception specified below.
12678 * This sequence number is also used to track up to which points updates which returned
12679 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
12680 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
12682 * The only instance where update_id values are not strictly increasing is the case where we
12683 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
12684 * its docs for more details.
12686 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
12689 * The sequence number of this update. Updates *must* be replayed in-order according to this
12690 * sequence number (and updates may panic if they are not). The update_id values are strictly
12691 * increasing and increase by one for each new update, with one exception specified below.
12693 * This sequence number is also used to track up to which points updates which returned
12694 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
12695 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
12697 * The only instance where update_id values are not strictly increasing is the case where we
12698 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
12699 * its docs for more details.
12701 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
12704 * Creates a copy of the ChannelMonitorUpdate
12706 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
12709 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
12711 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
12714 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
12716 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
12719 * Creates a copy of the ChannelMonitorUpdateErr
12721 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
12724 * Utility method to constructs a new TemporaryFailure-variant ChannelMonitorUpdateErr
12726 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void);
12729 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateErr
12731 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void);
12734 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
12736 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
12739 * Creates a copy of the MonitorUpdateError
12741 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
12744 * Frees any resources used by the MonitorEvent
12746 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
12749 * Creates a copy of the MonitorEvent
12751 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
12754 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
12756 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
12759 * Utility method to constructs a new CommitmentTxBroadcasted-variant MonitorEvent
12761 struct LDKMonitorEvent MonitorEvent_commitment_tx_broadcasted(struct LDKOutPoint a);
12764 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
12766 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
12769 * Creates a copy of the HTLCUpdate
12771 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
12774 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
12776 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
12779 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
12781 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
12784 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
12786 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
12789 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
12791 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
12794 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
12797 * panics if the given update is not the next update by update_id.
12799 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);
12802 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
12805 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12808 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
12810 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12813 * Gets a list of txids, with their output scripts (in the order they appear in the
12814 * transaction), which we must learn about spends of via block_connected().
12816 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12819 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
12820 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
12821 * have been registered.
12823 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
12826 * Get the list of HTLCs who's status has been updated on chain. This should be called by
12827 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
12829 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12832 * Gets the list of pending events which were generated by previous actions, clearing the list
12835 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
12836 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
12837 * no internal locking in ChannelMonitors.
12839 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12842 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
12843 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
12844 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
12845 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
12846 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
12847 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
12848 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
12849 * out-of-band the other node operator to coordinate with him if option is available to you.
12850 * In any-case, choice is up to the user.
12852 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);
12855 * Processes transactions in a newly connected block, which may result in any of the following:
12856 * - update the monitor's state against resolved HTLCs
12857 * - punish the counterparty in the case of seeing a revoked commitment transaction
12858 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
12859 * - detect settled outputs for later spending
12860 * - schedule and bump any in-flight claims
12862 * Returns any new outputs to watch from `txdata`; after called, these are also included in
12863 * [`get_outputs_to_watch`].
12865 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
12867 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);
12870 * Determines if the disconnected block contained any transactions of interest and updates
12873 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);
12876 * Processes transactions confirmed in a block with the given header and height, returning new
12877 * outputs to watch. See [`block_connected`] for details.
12879 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
12880 * blocks. See [`chain::Confirm`] for calling expectations.
12882 * [`block_connected`]: Self::block_connected
12884 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);
12887 * Processes a transaction that was reorganized out of the chain.
12889 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
12890 * than blocks. See [`chain::Confirm`] for calling expectations.
12892 * [`block_disconnected`]: Self::block_disconnected
12894 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);
12897 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
12898 * [`block_connected`] for details.
12900 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
12901 * blocks. See [`chain::Confirm`] for calling expectations.
12903 * [`block_connected`]: Self::block_connected
12905 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);
12908 * Returns the set of txids that should be monitored for re-organization out of the chain.
12910 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12913 * Gets the latest best block which was connected either via the [`chain::Listen`] or
12914 * [`chain::Confirm`] interfaces.
12916 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12919 * Calls the free function if one is set
12921 void Persist_free(struct LDKPersist this_ptr);
12924 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
12926 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
12929 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
12931 void OutPoint_free(struct LDKOutPoint this_obj);
12934 * The referenced transaction's txid.
12936 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
12939 * The referenced transaction's txid.
12941 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12944 * The index of the referenced output in its transaction's vout.
12946 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
12949 * The index of the referenced output in its transaction's vout.
12951 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
12954 * Constructs a new OutPoint given each field
12956 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
12959 * Creates a copy of the OutPoint
12961 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
12964 * Checks if two OutPoints contain equal inner contents.
12965 * This ignores pointers and is_owned flags and looks at the values in fields.
12966 * Two objects with NULL inner values will be considered "equal" here.
12968 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
12971 * Checks if two OutPoints contain equal inner contents.
12973 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
12976 * Convert an `OutPoint` to a lightning channel id.
12978 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
12981 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
12983 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
12986 * Read a OutPoint from a byte array, created by OutPoint_write
12988 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
12991 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
12993 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
12996 * The outpoint which is spendable
12998 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
13001 * The outpoint which is spendable
13003 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
13006 * Per commitment point to derive delayed_payment_key by key holder
13008 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
13011 * Per commitment point to derive delayed_payment_key by key holder
13013 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13016 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
13017 * the witness_script.
13019 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
13022 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
13023 * the witness_script.
13025 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
13028 * The output which is referenced by the given outpoint
13030 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
13033 * The revocation point specific to the commitment transaction which was broadcast. Used to
13034 * derive the witnessScript for this output.
13036 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
13039 * The revocation point specific to the commitment transaction which was broadcast. Used to
13040 * derive the witnessScript for this output.
13042 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13045 * Arbitrary identification information returned by a call to
13046 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
13047 * the channel to spend the output.
13049 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
13052 * Arbitrary identification information returned by a call to
13053 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
13054 * the channel to spend the output.
13056 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13059 * The value of the channel which this output originated from, possibly indirectly.
13061 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
13064 * The value of the channel which this output originated from, possibly indirectly.
13066 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
13069 * Constructs a new DelayedPaymentOutputDescriptor given each field
13071 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);
13074 * Creates a copy of the DelayedPaymentOutputDescriptor
13076 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
13079 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
13081 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
13084 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
13086 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
13089 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
13091 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
13094 * The outpoint which is spendable
13096 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
13099 * The outpoint which is spendable
13101 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
13104 * The output which is referenced by the given outpoint
13106 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
13109 * Arbitrary identification information returned by a call to
13110 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
13111 * the channel to spend the output.
13113 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
13116 * Arbitrary identification information returned by a call to
13117 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
13118 * the channel to spend the output.
13120 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13123 * The value of the channel which this transactions spends.
13125 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
13128 * The value of the channel which this transactions spends.
13130 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
13133 * Constructs a new StaticPaymentOutputDescriptor given each field
13135 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);
13138 * Creates a copy of the StaticPaymentOutputDescriptor
13140 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
13143 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
13145 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
13148 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
13150 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
13153 * Frees any resources used by the SpendableOutputDescriptor
13155 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
13158 * Creates a copy of the SpendableOutputDescriptor
13160 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
13163 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
13165 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
13168 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
13170 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
13173 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
13175 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
13178 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
13180 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
13183 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
13185 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
13188 * Calls the free function if one is set
13190 void BaseSign_free(struct LDKBaseSign this_ptr);
13193 * Creates a copy of a Sign
13195 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
13198 * Calls the free function if one is set
13200 void Sign_free(struct LDKSign this_ptr);
13203 * Calls the free function if one is set
13205 void KeysInterface_free(struct LDKKeysInterface this_ptr);
13208 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
13210 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
13213 * Private key of anchor tx
13215 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
13218 * Private key of anchor tx
13220 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
13223 * Holder secret key for blinded revocation pubkey
13225 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
13228 * Holder secret key for blinded revocation pubkey
13230 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
13233 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
13235 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
13238 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
13240 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
13243 * Holder secret key used in HTLC tx
13245 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
13248 * Holder secret key used in HTLC tx
13250 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
13253 * Holder htlc secret key used in commitment tx htlc outputs
13255 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
13258 * Holder htlc secret key used in commitment tx htlc outputs
13260 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
13265 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
13270 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13273 * Creates a copy of the InMemorySigner
13275 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
13278 * Create a new InMemorySigner
13280 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);
13283 * Counterparty pubkeys.
13284 * Will panic if ready_channel wasn't called.
13286 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13289 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
13290 * transactions, ie the amount of time that we have to wait to recover our funds if we
13291 * broadcast a transaction.
13292 * Will panic if ready_channel wasn't called.
13294 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13297 * The contest_delay value specified by us and applied on transactions broadcastable
13298 * by our counterparty, ie the amount of time that they have to wait to recover their funds
13299 * if they broadcast a transaction.
13300 * Will panic if ready_channel wasn't called.
13302 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13305 * Whether the holder is the initiator
13306 * Will panic if ready_channel wasn't called.
13308 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13312 * Will panic if ready_channel wasn't called.
13314 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13317 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
13318 * building transactions.
13320 * Will panic if ready_channel wasn't called.
13322 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13325 * Sign the single input of spend_tx at index `input_idx` which spends the output
13326 * described by descriptor, returning the witness stack for the input.
13328 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
13329 * or is not spending the outpoint described by `descriptor.outpoint`.
13331 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);
13334 * Sign the single input of spend_tx at index `input_idx` which spends the output
13335 * described by descriptor, returning the witness stack for the input.
13337 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
13338 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
13339 * sequence set to `descriptor.to_self_delay`.
13341 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);
13344 * Constructs a new BaseSign which calls the relevant methods on this_arg.
13345 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
13347 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13350 * Constructs a new Sign which calls the relevant methods on this_arg.
13351 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
13353 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13356 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
13358 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
13361 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
13363 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
13366 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
13368 void KeysManager_free(struct LDKKeysManager this_obj);
13371 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
13372 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
13373 * starting_time isn't strictly required to actually be a time, but it must absolutely,
13374 * without a doubt, be unique to this instance. ie if you start multiple times with the same
13375 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
13376 * simply use the current time (with very high precision).
13378 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
13379 * obviously, starting_time should be unique every time you reload the library - it is only
13380 * used to generate new ephemeral key data (which will be stored by the individual channel if
13383 * Note that the seed is required to recover certain on-chain funds independent of
13384 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
13385 * channel, and some on-chain during-closing funds.
13387 * Note that until the 0.1 release there is no guarantee of backward compatibility between
13388 * versions. Once the library is more fully supported, the docs will be updated to include a
13389 * detailed description of the guarantee.
13391 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
13394 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
13396 * Key derivation parameters are accessible through a per-channel secrets
13397 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
13398 * onchain output detection for which a corresponding delayed_payment_key must be derived.
13400 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]);
13403 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
13404 * output to the given change destination (if sufficient change value remains). The
13405 * transaction will have a feerate, at least, of the given value.
13407 * Returns `Err(())` if the output value is greater than the input value minus required fee or
13408 * if a descriptor was duplicated.
13410 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
13412 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
13413 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
13415 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);
13418 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
13419 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
13421 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
13424 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
13426 void ChannelManager_free(struct LDKChannelManager this_obj);
13429 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
13431 void ChainParameters_free(struct LDKChainParameters this_obj);
13434 * The network for determining the `chain_hash` in Lightning messages.
13436 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
13439 * The network for determining the `chain_hash` in Lightning messages.
13441 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
13444 * The hash and height of the latest block successfully connected.
13446 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
13448 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
13451 * The hash and height of the latest block successfully connected.
13453 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
13455 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
13458 * Constructs a new ChainParameters given each field
13460 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
13463 * Creates a copy of the ChainParameters
13465 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
13468 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
13470 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
13473 * The node_id of our counterparty
13475 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
13478 * The node_id of our counterparty
13480 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13483 * The Features the channel counterparty provided upon last connection.
13484 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
13485 * many routing-relevant features are present in the init context.
13487 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
13490 * The Features the channel counterparty provided upon last connection.
13491 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
13492 * many routing-relevant features are present in the init context.
13494 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
13497 * The value, in satoshis, that must always be held in the channel for our counterparty. This
13498 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
13499 * claiming at least this value on chain.
13501 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
13503 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
13505 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
13508 * The value, in satoshis, that must always be held in the channel for our counterparty. This
13509 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
13510 * claiming at least this value on chain.
13512 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
13514 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
13516 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
13519 * Creates a copy of the ChannelCounterparty
13521 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
13524 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
13526 void ChannelDetails_free(struct LDKChannelDetails this_obj);
13529 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
13530 * thereafter this is the txid of the funding transaction xor the funding transaction output).
13531 * Note that this means this value is *not* persistent - it can change once during the
13532 * lifetime of the channel.
13534 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
13537 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
13538 * thereafter this is the txid of the funding transaction xor the funding transaction output).
13539 * Note that this means this value is *not* persistent - it can change once during the
13540 * lifetime of the channel.
13542 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13545 * Parameters which apply to our counterparty. See individual fields for more information.
13547 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13550 * Parameters which apply to our counterparty. See individual fields for more information.
13552 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
13555 * The Channel's funding transaction output, if we've negotiated the funding transaction with
13556 * our counterparty already.
13558 * Note that, if this has been set, `channel_id` will be equivalent to
13559 * `funding_txo.unwrap().to_channel_id()`.
13561 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
13563 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13566 * The Channel's funding transaction output, if we've negotiated the funding transaction with
13567 * our counterparty already.
13569 * Note that, if this has been set, `channel_id` will be equivalent to
13570 * `funding_txo.unwrap().to_channel_id()`.
13572 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
13574 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
13577 * The position of the funding transaction in the chain. None if the funding transaction has
13578 * not yet been confirmed and the channel fully opened.
13580 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13583 * The position of the funding transaction in the chain. None if the funding transaction has
13584 * not yet been confirmed and the channel fully opened.
13586 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
13589 * The value, in satoshis, of this channel as appears in the funding output
13591 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13594 * The value, in satoshis, of this channel as appears in the funding output
13596 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
13599 * The value, in satoshis, that must always be held in the channel for us. This value ensures
13600 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
13601 * this value on chain.
13603 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
13605 * This value will be `None` for outbound channels until the counterparty accepts the channel.
13607 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
13609 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13612 * The value, in satoshis, that must always be held in the channel for us. This value ensures
13613 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
13614 * this value on chain.
13616 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
13618 * This value will be `None` for outbound channels until the counterparty accepts the channel.
13620 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
13622 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
13625 * The user_id passed in to create_channel, or 0 if the channel was inbound.
13627 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13630 * The user_id passed in to create_channel, or 0 if the channel was inbound.
13632 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
13635 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
13636 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
13637 * available for inclusion in new outbound HTLCs). This further does not include any pending
13638 * outgoing HTLCs which are awaiting some other resolution to be sent.
13640 * This value is not exact. Due to various in-flight changes, feerate changes, and our
13641 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
13642 * should be able to spend nearly this amount.
13644 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13647 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
13648 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
13649 * available for inclusion in new outbound HTLCs). This further does not include any pending
13650 * outgoing HTLCs which are awaiting some other resolution to be sent.
13652 * This value is not exact. Due to various in-flight changes, feerate changes, and our
13653 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
13654 * should be able to spend nearly this amount.
13656 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
13659 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
13660 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
13661 * available for inclusion in new inbound HTLCs).
13662 * Note that there are some corner cases not fully handled here, so the actual available
13663 * inbound capacity may be slightly higher than this.
13665 * This value is not exact. Due to various in-flight changes, feerate changes, and our
13666 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
13667 * However, our counterparty should be able to spend nearly this amount.
13669 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13672 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
13673 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
13674 * available for inclusion in new inbound HTLCs).
13675 * Note that there are some corner cases not fully handled here, so the actual available
13676 * inbound capacity may be slightly higher than this.
13678 * This value is not exact. Due to various in-flight changes, feerate changes, and our
13679 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
13680 * However, our counterparty should be able to spend nearly this amount.
13682 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
13685 * The number of required confirmations on the funding transaction before the funding will be
13686 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
13687 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
13688 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
13689 * [`ChannelHandshakeLimits::max_minimum_depth`].
13691 * This value will be `None` for outbound channels until the counterparty accepts the channel.
13693 * [`is_outbound`]: ChannelDetails::is_outbound
13694 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
13695 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
13697 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13700 * The number of required confirmations on the funding transaction before the funding will be
13701 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
13702 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
13703 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
13704 * [`ChannelHandshakeLimits::max_minimum_depth`].
13706 * This value will be `None` for outbound channels until the counterparty accepts the channel.
13708 * [`is_outbound`]: ChannelDetails::is_outbound
13709 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
13710 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
13712 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
13715 * The number of blocks (after our commitment transaction confirms) that we will need to wait
13716 * until we can claim our funds after we force-close the channel. During this time our
13717 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
13718 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
13719 * time to claim our non-HTLC-encumbered funds.
13721 * This value will be `None` for outbound channels until the counterparty accepts the channel.
13723 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13726 * The number of blocks (after our commitment transaction confirms) that we will need to wait
13727 * until we can claim our funds after we force-close the channel. During this time our
13728 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
13729 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
13730 * time to claim our non-HTLC-encumbered funds.
13732 * This value will be `None` for outbound channels until the counterparty accepts the channel.
13734 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
13737 * True if the channel was initiated (and thus funded) by us.
13739 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13742 * True if the channel was initiated (and thus funded) by us.
13744 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
13747 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
13748 * channel is not currently being shut down. `funding_locked` message exchange implies the
13749 * required confirmation count has been reached (and we were connected to the peer at some
13750 * point after the funding transaction received enough confirmations). The required
13751 * confirmation count is provided in [`confirmations_required`].
13753 * [`confirmations_required`]: ChannelDetails::confirmations_required
13755 bool ChannelDetails_get_is_funding_locked(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13758 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
13759 * channel is not currently being shut down. `funding_locked` message exchange implies the
13760 * required confirmation count has been reached (and we were connected to the peer at some
13761 * point after the funding transaction received enough confirmations). The required
13762 * confirmation count is provided in [`confirmations_required`].
13764 * [`confirmations_required`]: ChannelDetails::confirmations_required
13766 void ChannelDetails_set_is_funding_locked(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
13769 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
13770 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
13772 * This is a strict superset of `is_funding_locked`.
13774 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13777 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
13778 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
13780 * This is a strict superset of `is_funding_locked`.
13782 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
13785 * True if this channel is (or will be) publicly-announced.
13787 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13790 * True if this channel is (or will be) publicly-announced.
13792 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
13795 * Constructs a new ChannelDetails given each field
13797 MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_id_arg, uint64_t outbound_capacity_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg);
13800 * Creates a copy of the ChannelDetails
13802 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
13805 * Frees any resources used by the PaymentSendFailure
13807 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
13810 * Creates a copy of the PaymentSendFailure
13812 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
13815 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
13817 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
13820 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
13822 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
13825 * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure
13827 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
13830 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
13832 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ a);
13835 * Constructs a new ChannelManager to hold several channels and route between them.
13837 * This is the main \"logic hub\" for all channel-related actions, and implements
13838 * ChannelMessageHandler.
13840 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
13842 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
13844 * Users need to notify the new ChannelManager when a new block is connected or
13845 * disconnected using its `block_connected` and `block_disconnected` methods, starting
13846 * from after `params.latest_hash`.
13848 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);
13851 * Gets the current configuration applied to all new channels, as
13853 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
13856 * Creates a new outbound channel to the given remote node and with the given value.
13858 * user_id will be provided back as user_channel_id in FundingGenerationReady events to allow
13859 * tracking of which events correspond with which create_channel call. Note that the
13860 * user_channel_id defaults to 0 for inbound channels, so you may wish to avoid using 0 for
13861 * user_id here. user_id has no meaning inside of LDK, it is simply copied to events and
13862 * otherwise ignored.
13864 * If successful, will generate a SendOpenChannel message event, so you should probably poll
13865 * PeerManager::process_events afterwards.
13867 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
13868 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
13870 * Note that we do not check if you are currently connected to the given peer. If no
13871 * connection is available, the outbound `open_channel` message may fail to send, resulting in
13872 * the channel eventually being silently forgotten.
13874 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
13876 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);
13879 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
13880 * more information.
13882 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
13885 * Gets the list of usable channels, in random order. Useful as an argument to
13886 * get_route to ensure non-announced channels are used.
13888 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
13889 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
13892 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
13895 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
13896 * will be accepted on the given channel, and after additional timeout/the closing of all
13897 * pending HTLCs, the channel will be closed on chain.
13899 * May generate a SendShutdown message event on success, which should be relayed.
13901 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
13904 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
13905 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
13907 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
13910 * Force close all channels, immediately broadcasting the latest local commitment transaction
13911 * for each to the chain and rejecting new HTLCs on each.
13913 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
13916 * Sends a payment along a given route.
13918 * Value parameters are provided via the last hop in route, see documentation for RouteHop
13919 * fields for more info.
13921 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
13922 * payment), we don't do anything to stop you! We always try to ensure that if the provided
13923 * next hop knows the preimage to payment_hash they can claim an additional amount as
13924 * specified in the last hop in the route! Thus, you should probably do your own
13925 * payment_preimage tracking (which you should already be doing as they represent \"proof of
13926 * payment\") and prevent double-sends yourself.
13928 * May generate SendHTLCs message(s) event on success, which should be relayed.
13930 * Each path may have a different return value, and PaymentSendValue may return a Vec with
13931 * each entry matching the corresponding-index entry in the route paths, see
13932 * PaymentSendFailure for more info.
13934 * In general, a path may raise:
13935 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
13936 * node public key) is specified.
13937 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
13938 * (including due to previous monitor update failure or new permanent monitor update
13940 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
13941 * relevant updates.
13943 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
13944 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
13945 * different route unless you intend to pay twice!
13947 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
13948 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
13949 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
13950 * must not contain multiple paths as multi-path payments require a recipient-provided
13952 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
13953 * bit set (either as required or as available). If multiple paths are present in the Route,
13954 * we assume the invoice had the basic_mpp feature set.
13956 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
13958 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);
13961 * Call this upon creation of a funding transaction for the given channel.
13963 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
13964 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
13966 * Panics if a funding transaction has already been provided for this channel.
13968 * May panic if the output found in the funding transaction is duplicative with some other
13969 * channel (note that this should be trivially prevented by using unique funding transaction
13970 * keys per-channel).
13972 * Do NOT broadcast the funding transaction yourself. When we have safely received our
13973 * counterparty's signature the funding transaction will automatically be broadcast via the
13974 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
13976 * Note that this includes RBF or similar transaction replacement strategies - lightning does
13977 * not currently support replacing a funding transaction on an existing channel. Instead,
13978 * create a new channel with a conflicting funding transaction.
13980 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
13982 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);
13985 * Regenerates channel_announcements and generates a signed node_announcement from the given
13986 * arguments, providing them in corresponding events via
13987 * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed
13988 * on-chain. This effectively re-broadcasts all channel announcements and sends our node
13989 * announcement to ensure that the lightning P2P network is aware of the channels we have and
13990 * our network addresses.
13992 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
13993 * node to humans. They carry no in-protocol meaning.
13995 * `addresses` represent the set (possibly empty) of socket addresses on which this node
13996 * accepts incoming connections. These will be included in the node_announcement, publicly
13997 * tying these addresses together and to this node. If you wish to preserve user privacy,
13998 * addresses should likely contain only Tor Onion addresses.
14000 * Panics if `addresses` is absurdly large (more than 500).
14002 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
14004 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
14007 * Processes HTLCs which are pending waiting on random forward delay.
14009 * Should only really ever be called in response to a PendingHTLCsForwardable event.
14010 * Will likely generate further events.
14012 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
14015 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
14016 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
14017 * to inform the network about the uselessness of these channels.
14019 * This method handles all the details, and must be called roughly once per minute.
14021 * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
14023 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
14026 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
14027 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
14028 * along the path (including in our own channel on which we received it).
14029 * Returns false if no payment was found to fail backwards, true if the process of failing the
14030 * HTLC backwards has been started.
14032 MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
14035 * Provides a payment preimage in response to a PaymentReceived event, returning true and
14036 * generating message events for the net layer to claim the payment, if possible. Thus, you
14037 * should probably kick the net layer to go send messages if this returns true!
14039 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
14040 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
14041 * event matches your expectation. If you fail to do so and call this method, you may provide
14042 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
14044 * May panic if called except in response to a PaymentReceived event.
14046 * [`create_inbound_payment`]: Self::create_inbound_payment
14047 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
14049 MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
14052 * Gets the node_id held by this ChannelManager
14054 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
14057 * Restores a single, given channel to normal operation after a
14058 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
14061 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
14062 * fully committed in every copy of the given channels' ChannelMonitors.
14064 * Note that there is no effect to calling with a highest_applied_update_id other than the
14065 * current latest ChannelMonitorUpdate and one call to this function after multiple
14066 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
14067 * exists largely only to prevent races between this and concurrent update_monitor calls.
14069 * Thus, the anticipated use is, at a high level:
14070 * 1) You register a chain::Watch with this ChannelManager,
14071 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
14072 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
14073 * any time it cannot do so instantly,
14074 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
14075 * 4) once all remote copies are updated, you call this function with the update_id that
14076 * completed, and once it is the latest the Channel will be re-enabled.
14078 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);
14081 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
14084 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
14085 * [`PaymentHash`] and [`PaymentPreimage`] for you, returning the first and storing the second.
14087 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
14088 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
14089 * passed directly to [`claim_funds`].
14091 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
14093 * [`claim_funds`]: Self::claim_funds
14094 * [`PaymentReceived`]: events::Event::PaymentReceived
14095 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
14096 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
14098 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);
14101 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
14102 * stored external to LDK.
14104 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
14105 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
14106 * the `min_value_msat` provided here, if one is provided.
14108 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) must be globally unique. This
14109 * method may return an Err if another payment with the same payment_hash is still pending.
14111 * `user_payment_id` will be provided back in [`PaymentReceived::user_payment_id`] events to
14112 * allow tracking of which events correspond with which calls to this and
14113 * [`create_inbound_payment`]. `user_payment_id` has no meaning inside of LDK, it is simply
14114 * copied to events and otherwise ignored. It may be used to correlate PaymentReceived events
14115 * with invoice metadata stored elsewhere.
14117 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
14118 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
14119 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
14120 * sender \"proof-of-payment\" unless they have paid the required amount.
14122 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
14123 * in excess of the current time. This should roughly match the expiry time set in the invoice.
14124 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
14125 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
14126 * invoices when no timeout is set.
14128 * Note that we use block header time to time-out pending inbound payments (with some margin
14129 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
14130 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
14131 * If you need exact expiry semantics, you should enforce them upon receipt of
14132 * [`PaymentReceived`].
14134 * Pending inbound payments are stored in memory and in serialized versions of this
14135 * [`ChannelManager`]. If potentially unbounded numbers of inbound payments may exist and
14136 * space is limited, you may wish to rate-limit inbound payment creation.
14138 * May panic if `invoice_expiry_delta_secs` is greater than one year.
14140 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
14141 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
14143 * [`create_inbound_payment`]: Self::create_inbound_payment
14144 * [`PaymentReceived`]: events::Event::PaymentReceived
14145 * [`PaymentReceived::user_payment_id`]: events::Event::PaymentReceived::user_payment_id
14147 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);
14150 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
14151 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
14153 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
14156 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
14157 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
14159 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
14162 * Constructs a new Listen which calls the relevant methods on this_arg.
14163 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
14165 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
14168 * Constructs a new Confirm which calls the relevant methods on this_arg.
14169 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
14171 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
14174 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
14175 * indicating whether persistence is necessary. Only one listener on
14176 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
14178 * Note that the feature `allow_wallclock_use` must be enabled to use this function.
14180 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
14183 * Blocks until ChannelManager needs to be persisted. Only one listener on
14184 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
14187 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
14190 * Gets the latest best block which was connected either via the [`chain::Listen`] or
14191 * [`chain::Confirm`] interfaces.
14193 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
14196 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
14197 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
14199 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
14202 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
14204 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
14207 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
14209 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
14212 * The keys provider which will give us relevant keys. Some keys will be loaded during
14213 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
14216 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
14219 * The keys provider which will give us relevant keys. Some keys will be loaded during
14220 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
14223 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
14226 * The fee_estimator for use in the ChannelManager in the future.
14228 * No calls to the FeeEstimator will be made during deserialization.
14230 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
14233 * The fee_estimator for use in the ChannelManager in the future.
14235 * No calls to the FeeEstimator will be made during deserialization.
14237 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
14240 * The chain::Watch for use in the ChannelManager in the future.
14242 * No calls to the chain::Watch will be made during deserialization. It is assumed that
14243 * you have deserialized ChannelMonitors separately and will add them to your
14244 * chain::Watch after deserializing this ChannelManager.
14246 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
14249 * The chain::Watch for use in the ChannelManager in the future.
14251 * No calls to the chain::Watch will be made during deserialization. It is assumed that
14252 * you have deserialized ChannelMonitors separately and will add them to your
14253 * chain::Watch after deserializing this ChannelManager.
14255 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
14258 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
14259 * used to broadcast the latest local commitment transactions of channels which must be
14260 * force-closed during deserialization.
14262 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
14265 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
14266 * used to broadcast the latest local commitment transactions of channels which must be
14267 * force-closed during deserialization.
14269 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
14272 * The Logger for use in the ChannelManager and which may be used to log information during
14275 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
14278 * The Logger for use in the ChannelManager and which may be used to log information during
14281 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
14284 * Default settings used for new channels. Any existing channels will continue to use the
14285 * runtime settings which were stored when the ChannelManager was serialized.
14287 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
14290 * Default settings used for new channels. Any existing channels will continue to use the
14291 * runtime settings which were stored when the ChannelManager was serialized.
14293 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
14296 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
14297 * HashMap for you. This is primarily useful for C bindings where it is not practical to
14298 * populate a HashMap directly from C.
14300 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);
14303 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
14305 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
14308 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
14310 void DecodeError_free(struct LDKDecodeError this_obj);
14313 * Creates a copy of the DecodeError
14315 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
14318 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
14320 void Init_free(struct LDKInit this_obj);
14323 * The relevant features which the sender supports
14325 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
14328 * The relevant features which the sender supports
14330 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
14333 * Constructs a new Init given each field
14335 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
14338 * Creates a copy of the Init
14340 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
14343 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
14345 void ErrorMessage_free(struct LDKErrorMessage this_obj);
14348 * The channel ID involved in the error
14350 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
14353 * The channel ID involved in the error
14355 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14358 * A possibly human-readable error description.
14359 * The string should be sanitized before it is used (e.g. emitted to logs
14360 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
14361 * vulnerability in the terminal emulator or the logging subsystem.
14363 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
14366 * A possibly human-readable error description.
14367 * The string should be sanitized before it is used (e.g. emitted to logs
14368 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
14369 * vulnerability in the terminal emulator or the logging subsystem.
14371 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
14374 * Constructs a new ErrorMessage given each field
14376 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
14379 * Creates a copy of the ErrorMessage
14381 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
14384 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
14386 void Ping_free(struct LDKPing this_obj);
14389 * The desired response length
14391 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
14394 * The desired response length
14396 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
14399 * The ping packet size.
14400 * This field is not sent on the wire. byteslen zeros are sent.
14402 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
14405 * The ping packet size.
14406 * This field is not sent on the wire. byteslen zeros are sent.
14408 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
14411 * Constructs a new Ping given each field
14413 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
14416 * Creates a copy of the Ping
14418 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
14421 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
14423 void Pong_free(struct LDKPong this_obj);
14426 * The pong packet size.
14427 * This field is not sent on the wire. byteslen zeros are sent.
14429 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
14432 * The pong packet size.
14433 * This field is not sent on the wire. byteslen zeros are sent.
14435 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
14438 * Constructs a new Pong given each field
14440 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
14443 * Creates a copy of the Pong
14445 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
14448 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
14450 void OpenChannel_free(struct LDKOpenChannel this_obj);
14453 * The genesis hash of the blockchain where the channel is to be opened
14455 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
14458 * The genesis hash of the blockchain where the channel is to be opened
14460 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14463 * A temporary channel ID, until the funding outpoint is announced
14465 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
14468 * A temporary channel ID, until the funding outpoint is announced
14470 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14473 * The channel value
14475 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14478 * The channel value
14480 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
14483 * The amount to push to the counterparty as part of the open, in milli-satoshi
14485 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14488 * The amount to push to the counterparty as part of the open, in milli-satoshi
14490 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
14493 * The threshold below which outputs on transactions broadcast by sender will be omitted
14495 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14498 * The threshold below which outputs on transactions broadcast by sender will be omitted
14500 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
14503 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
14505 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14508 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
14510 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
14513 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
14515 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14518 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
14520 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
14523 * The minimum HTLC size incoming to sender, in milli-satoshi
14525 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14528 * The minimum HTLC size incoming to sender, in milli-satoshi
14530 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
14533 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
14535 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14538 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
14540 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
14543 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
14545 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14548 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
14550 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
14553 * The maximum number of inbound HTLCs towards sender
14555 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14558 * The maximum number of inbound HTLCs towards sender
14560 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
14563 * The sender's key controlling the funding transaction
14565 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14568 * The sender's key controlling the funding transaction
14570 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14573 * Used to derive a revocation key for transactions broadcast by counterparty
14575 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14578 * Used to derive a revocation key for transactions broadcast by counterparty
14580 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14583 * A payment key to sender for transactions broadcast by counterparty
14585 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14588 * A payment key to sender for transactions broadcast by counterparty
14590 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14593 * Used to derive a payment key to sender for transactions broadcast by sender
14595 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14598 * Used to derive a payment key to sender for transactions broadcast by sender
14600 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14603 * Used to derive an HTLC payment key to sender
14605 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14608 * Used to derive an HTLC payment key to sender
14610 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14613 * The first to-be-broadcast-by-sender transaction's per commitment point
14615 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14618 * The first to-be-broadcast-by-sender transaction's per commitment point
14620 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14625 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14630 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
14633 * Creates a copy of the OpenChannel
14635 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
14638 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
14640 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
14643 * A temporary channel ID, until the funding outpoint is announced
14645 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
14648 * A temporary channel ID, until the funding outpoint is announced
14650 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14653 * The threshold below which outputs on transactions broadcast by sender will be omitted
14655 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14658 * The threshold below which outputs on transactions broadcast by sender will be omitted
14660 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
14663 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
14665 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14668 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
14670 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
14673 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
14675 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14678 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
14680 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
14683 * The minimum HTLC size incoming to sender, in milli-satoshi
14685 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14688 * The minimum HTLC size incoming to sender, in milli-satoshi
14690 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
14693 * Minimum depth of the funding transaction before the channel is considered open
14695 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14698 * Minimum depth of the funding transaction before the channel is considered open
14700 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
14703 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
14705 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14708 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
14710 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
14713 * The maximum number of inbound HTLCs towards sender
14715 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14718 * The maximum number of inbound HTLCs towards sender
14720 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
14723 * The sender's key controlling the funding transaction
14725 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14728 * The sender's key controlling the funding transaction
14730 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14733 * Used to derive a revocation key for transactions broadcast by counterparty
14735 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14738 * Used to derive a revocation key for transactions broadcast by counterparty
14740 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14743 * A payment key to sender for transactions broadcast by counterparty
14745 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14748 * A payment key to sender for transactions broadcast by counterparty
14750 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14753 * Used to derive a payment key to sender for transactions broadcast by sender
14755 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14758 * Used to derive a payment key to sender for transactions broadcast by sender
14760 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14763 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
14765 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14768 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
14770 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14773 * The first to-be-broadcast-by-sender transaction's per commitment point
14775 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14778 * The first to-be-broadcast-by-sender transaction's per commitment point
14780 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14783 * Creates a copy of the AcceptChannel
14785 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
14788 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
14790 void FundingCreated_free(struct LDKFundingCreated this_obj);
14793 * A temporary channel ID, until the funding is established
14795 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
14798 * A temporary channel ID, until the funding is established
14800 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14803 * The funding transaction ID
14805 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
14808 * The funding transaction ID
14810 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14813 * The specific output index funding this channel
14815 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
14818 * The specific output index funding this channel
14820 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
14823 * The signature of the channel initiator (funder) on the funding transaction
14825 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
14828 * The signature of the channel initiator (funder) on the funding transaction
14830 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
14833 * Constructs a new FundingCreated given each field
14835 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);
14838 * Creates a copy of the FundingCreated
14840 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
14843 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
14845 void FundingSigned_free(struct LDKFundingSigned this_obj);
14850 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
14855 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14858 * The signature of the channel acceptor (fundee) on the funding transaction
14860 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
14863 * The signature of the channel acceptor (fundee) on the funding transaction
14865 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
14868 * Constructs a new FundingSigned given each field
14870 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
14873 * Creates a copy of the FundingSigned
14875 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
14878 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
14880 void FundingLocked_free(struct LDKFundingLocked this_obj);
14885 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
14890 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14893 * The per-commitment point of the second commitment transaction
14895 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
14898 * The per-commitment point of the second commitment transaction
14900 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14903 * Constructs a new FundingLocked given each field
14905 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
14908 * Creates a copy of the FundingLocked
14910 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
14913 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
14915 void Shutdown_free(struct LDKShutdown this_obj);
14920 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
14925 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14928 * The destination of this peer's funds on closing.
14929 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
14931 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
14934 * The destination of this peer's funds on closing.
14935 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
14937 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
14940 * Constructs a new Shutdown given each field
14942 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
14945 * Creates a copy of the Shutdown
14947 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
14950 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
14952 void ClosingSigned_free(struct LDKClosingSigned this_obj);
14957 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
14962 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14965 * The proposed total fee for the closing transaction
14967 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
14970 * The proposed total fee for the closing transaction
14972 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
14975 * A signature on the closing transaction
14977 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
14980 * A signature on the closing transaction
14982 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
14985 * Constructs a new ClosingSigned given each field
14987 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
14990 * Creates a copy of the ClosingSigned
14992 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
14995 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
14997 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
15002 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
15007 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15012 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
15017 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
15020 * The HTLC value in milli-satoshi
15022 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
15025 * The HTLC value in milli-satoshi
15027 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
15030 * The payment hash, the pre-image of which controls HTLC redemption
15032 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
15035 * The payment hash, the pre-image of which controls HTLC redemption
15037 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15040 * The expiry height of the HTLC
15042 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
15045 * The expiry height of the HTLC
15047 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
15050 * Creates a copy of the UpdateAddHTLC
15052 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
15055 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
15057 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
15062 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
15067 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15072 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
15077 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
15080 * The pre-image of the payment hash, allowing HTLC redemption
15082 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
15085 * The pre-image of the payment hash, allowing HTLC redemption
15087 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15090 * Constructs a new UpdateFulfillHTLC given each field
15092 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
15095 * Creates a copy of the UpdateFulfillHTLC
15097 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
15100 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
15102 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
15107 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
15112 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15117 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
15122 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
15125 * Creates a copy of the UpdateFailHTLC
15127 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
15130 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
15132 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
15137 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
15142 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15147 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
15152 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
15157 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
15162 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
15165 * Creates a copy of the UpdateFailMalformedHTLC
15167 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
15170 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
15172 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
15177 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
15182 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15185 * A signature on the commitment transaction
15187 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
15190 * A signature on the commitment transaction
15192 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
15195 * Signatures on the HTLC transactions
15197 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
15200 * Constructs a new CommitmentSigned given each field
15202 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
15205 * Creates a copy of the CommitmentSigned
15207 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
15210 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
15212 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
15217 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
15222 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15225 * The secret corresponding to the per-commitment point
15227 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
15230 * The secret corresponding to the per-commitment point
15232 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15235 * The next sender-broadcast commitment transaction's per-commitment point
15237 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
15240 * The next sender-broadcast commitment transaction's per-commitment point
15242 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15245 * Constructs a new RevokeAndACK given each field
15247 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);
15250 * Creates a copy of the RevokeAndACK
15252 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
15255 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
15257 void UpdateFee_free(struct LDKUpdateFee this_obj);
15262 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
15267 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15270 * Fee rate per 1000-weight of the transaction
15272 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
15275 * Fee rate per 1000-weight of the transaction
15277 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
15280 * Constructs a new UpdateFee given each field
15282 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
15285 * Creates a copy of the UpdateFee
15287 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
15290 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
15292 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
15295 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
15296 * belonging to the recipient
15298 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
15301 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
15302 * belonging to the recipient
15304 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15307 * The sender's per-commitment point for their current commitment transaction
15309 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
15312 * The sender's per-commitment point for their current commitment transaction
15314 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15317 * Constructs a new DataLossProtect given each field
15319 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
15322 * Creates a copy of the DataLossProtect
15324 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
15327 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
15329 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
15334 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
15339 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15342 * The next commitment number for the sender
15344 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
15347 * The next commitment number for the sender
15349 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
15352 * The next commitment number for the recipient
15354 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
15357 * The next commitment number for the recipient
15359 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
15362 * Creates a copy of the ChannelReestablish
15364 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
15367 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
15369 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
15374 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
15379 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15382 * The short channel ID
15384 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
15387 * The short channel ID
15389 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
15392 * A signature by the node key
15394 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
15397 * A signature by the node key
15399 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
15402 * A signature by the funding key
15404 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
15407 * A signature by the funding key
15409 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
15412 * Constructs a new AnnouncementSignatures given each field
15414 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);
15417 * Creates a copy of the AnnouncementSignatures
15419 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
15422 * Frees any resources used by the NetAddress
15424 void NetAddress_free(struct LDKNetAddress this_ptr);
15427 * Creates a copy of the NetAddress
15429 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
15432 * Utility method to constructs a new IPv4-variant NetAddress
15434 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
15437 * Utility method to constructs a new IPv6-variant NetAddress
15439 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
15442 * Utility method to constructs a new OnionV2-variant NetAddress
15444 struct LDKNetAddress NetAddress_onion_v2(struct LDKTenBytes addr, uint16_t port);
15447 * Utility method to constructs a new OnionV3-variant NetAddress
15449 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
15452 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
15454 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
15457 * Read a Result from a byte array, created by Result_write
15459 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
15462 * Read a NetAddress from a byte array, created by NetAddress_write
15464 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
15467 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
15469 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
15472 * The advertised features
15474 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
15477 * The advertised features
15479 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
15482 * A strictly monotonic announcement counter, with gaps allowed
15484 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
15487 * A strictly monotonic announcement counter, with gaps allowed
15489 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
15492 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
15495 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
15498 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
15501 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15504 * An RGB color for UI purposes
15506 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
15509 * An RGB color for UI purposes
15511 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
15514 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
15517 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
15520 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
15523 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15526 * List of addresses on which this node is reachable
15528 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
15531 * Creates a copy of the UnsignedNodeAnnouncement
15533 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
15536 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
15538 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
15541 * The signature by the node key
15543 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
15546 * The signature by the node key
15548 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
15551 * The actual content of the announcement
15553 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
15556 * The actual content of the announcement
15558 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
15561 * Constructs a new NodeAnnouncement given each field
15563 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
15566 * Creates a copy of the NodeAnnouncement
15568 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
15571 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
15573 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
15576 * The advertised channel features
15578 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
15581 * The advertised channel features
15583 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
15586 * The genesis hash of the blockchain where the channel is to be opened
15588 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
15591 * The genesis hash of the blockchain where the channel is to be opened
15593 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15596 * The short channel ID
15598 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
15601 * The short channel ID
15603 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
15606 * One of the two node_ids which are endpoints of this channel
15608 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
15611 * One of the two node_ids which are endpoints of this channel
15613 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15616 * The other of the two node_ids which are endpoints of this channel
15618 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
15621 * The other of the two node_ids which are endpoints of this channel
15623 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15626 * The funding key for the first node
15628 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
15631 * The funding key for the first node
15633 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15636 * The funding key for the second node
15638 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
15641 * The funding key for the second node
15643 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15646 * Creates a copy of the UnsignedChannelAnnouncement
15648 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
15651 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
15653 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
15656 * Authentication of the announcement by the first public node
15658 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
15661 * Authentication of the announcement by the first public node
15663 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
15666 * Authentication of the announcement by the second public node
15668 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
15671 * Authentication of the announcement by the second public node
15673 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
15676 * Proof of funding UTXO ownership by the first public node
15678 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
15681 * Proof of funding UTXO ownership by the first public node
15683 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
15686 * Proof of funding UTXO ownership by the second public node
15688 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
15691 * Proof of funding UTXO ownership by the second public node
15693 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
15696 * The actual announcement
15698 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
15701 * The actual announcement
15703 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
15706 * Constructs a new ChannelAnnouncement given each field
15708 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);
15711 * Creates a copy of the ChannelAnnouncement
15713 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
15716 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
15718 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
15721 * The genesis hash of the blockchain where the channel is to be opened
15723 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
15726 * The genesis hash of the blockchain where the channel is to be opened
15728 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15731 * The short channel ID
15733 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15736 * The short channel ID
15738 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
15741 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
15743 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15746 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
15748 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
15753 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15758 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
15761 * The number of blocks such that if:
15762 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
15763 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
15764 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
15765 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
15766 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
15767 * forwarding. Note that the HTLC sender is the one who originally sets this value when
15768 * constructing the route.
15770 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15773 * The number of blocks such that if:
15774 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
15775 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
15776 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
15777 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
15778 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
15779 * forwarding. Note that the HTLC sender is the one who originally sets this value when
15780 * constructing the route.
15782 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
15785 * The minimum HTLC size incoming to sender, in milli-satoshi
15787 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15790 * The minimum HTLC size incoming to sender, in milli-satoshi
15792 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
15795 * The base HTLC fee charged by sender, in milli-satoshi
15797 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15800 * The base HTLC fee charged by sender, in milli-satoshi
15802 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
15805 * The amount to fee multiplier, in micro-satoshi
15807 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15810 * The amount to fee multiplier, in micro-satoshi
15812 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
15815 * Creates a copy of the UnsignedChannelUpdate
15817 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
15820 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
15822 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
15825 * A signature of the channel update
15827 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
15830 * A signature of the channel update
15832 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
15835 * The actual channel update
15837 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
15840 * The actual channel update
15842 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
15845 * Constructs a new ChannelUpdate given each field
15847 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
15850 * Creates a copy of the ChannelUpdate
15852 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
15855 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
15857 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
15860 * The genesis hash of the blockchain being queried
15862 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
15865 * The genesis hash of the blockchain being queried
15867 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15870 * The height of the first block for the channel UTXOs being queried
15872 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
15875 * The height of the first block for the channel UTXOs being queried
15877 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15880 * The number of blocks to include in the query results
15882 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
15885 * The number of blocks to include in the query results
15887 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15890 * Constructs a new QueryChannelRange given each field
15892 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
15895 * Creates a copy of the QueryChannelRange
15897 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
15900 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
15902 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
15905 * The genesis hash of the blockchain being queried
15907 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
15910 * The genesis hash of the blockchain being queried
15912 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15915 * The height of the first block in the range of the reply
15917 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
15920 * The height of the first block in the range of the reply
15922 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15925 * The number of blocks included in the range of the reply
15927 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
15930 * The number of blocks included in the range of the reply
15932 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15935 * True when this is the final reply for a query
15937 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
15940 * True when this is the final reply for a query
15942 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
15945 * The short_channel_ids in the channel range
15947 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
15950 * Constructs a new ReplyChannelRange given each field
15952 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);
15955 * Creates a copy of the ReplyChannelRange
15957 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
15960 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
15962 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
15965 * The genesis hash of the blockchain being queried
15967 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
15970 * The genesis hash of the blockchain being queried
15972 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15975 * The short_channel_ids that are being queried
15977 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
15980 * Constructs a new QueryShortChannelIds given each field
15982 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
15985 * Creates a copy of the QueryShortChannelIds
15987 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
15990 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
15992 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
15995 * The genesis hash of the blockchain that was queried
15997 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
16000 * The genesis hash of the blockchain that was queried
16002 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16005 * Indicates if the query recipient maintains up-to-date channel
16006 * information for the chain_hash
16008 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
16011 * Indicates if the query recipient maintains up-to-date channel
16012 * information for the chain_hash
16014 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
16017 * Constructs a new ReplyShortChannelIdsEnd given each field
16019 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
16022 * Creates a copy of the ReplyShortChannelIdsEnd
16024 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
16027 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
16029 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
16032 * The genesis hash of the blockchain for channel and node information
16034 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
16037 * The genesis hash of the blockchain for channel and node information
16039 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16042 * The starting unix timestamp
16044 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
16047 * The starting unix timestamp
16049 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
16052 * The range of information in seconds
16054 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
16057 * The range of information in seconds
16059 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
16062 * Constructs a new GossipTimestampFilter given each field
16064 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
16067 * Creates a copy of the GossipTimestampFilter
16069 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
16072 * Frees any resources used by the ErrorAction
16074 void ErrorAction_free(struct LDKErrorAction this_ptr);
16077 * Creates a copy of the ErrorAction
16079 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
16082 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
16084 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
16087 * Utility method to constructs a new IgnoreError-variant ErrorAction
16089 struct LDKErrorAction ErrorAction_ignore_error(void);
16092 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
16094 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
16097 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
16099 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
16102 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
16104 void LightningError_free(struct LDKLightningError this_obj);
16107 * A human-readable message describing the error
16109 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
16112 * A human-readable message describing the error
16114 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
16117 * The action which should be taken against the offending peer.
16119 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
16122 * The action which should be taken against the offending peer.
16124 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
16127 * Constructs a new LightningError given each field
16129 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
16132 * Creates a copy of the LightningError
16134 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
16137 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
16139 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
16142 * update_add_htlc messages which should be sent
16144 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
16147 * update_fulfill_htlc messages which should be sent
16149 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
16152 * update_fail_htlc messages which should be sent
16154 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
16157 * update_fail_malformed_htlc messages which should be sent
16159 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
16162 * An update_fee message which should be sent
16164 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
16166 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
16169 * An update_fee message which should be sent
16171 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
16173 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
16176 * Finally, the commitment_signed message which should be sent
16178 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
16181 * Finally, the commitment_signed message which should be sent
16183 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
16186 * Constructs a new CommitmentUpdate given each field
16188 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);
16191 * Creates a copy of the CommitmentUpdate
16193 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
16196 * Frees any resources used by the HTLCFailChannelUpdate
16198 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
16201 * Creates a copy of the HTLCFailChannelUpdate
16203 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
16206 * Utility method to constructs a new ChannelUpdateMessage-variant HTLCFailChannelUpdate
16208 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_channel_update_message(struct LDKChannelUpdate msg);
16211 * Utility method to constructs a new ChannelClosed-variant HTLCFailChannelUpdate
16213 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_channel_closed(uint64_t short_channel_id, bool is_permanent);
16216 * Utility method to constructs a new NodeFailure-variant HTLCFailChannelUpdate
16218 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
16221 * Calls the free function if one is set
16223 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
16226 * Calls the free function if one is set
16228 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
16231 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
16233 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
16236 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
16238 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
16241 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
16243 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
16246 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
16248 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
16251 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
16253 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
16256 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
16258 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
16261 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
16263 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
16266 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
16268 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
16271 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
16273 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
16276 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
16278 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
16281 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
16283 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
16286 * Read a FundingCreated from a byte array, created by FundingCreated_write
16288 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
16291 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
16293 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
16296 * Read a FundingSigned from a byte array, created by FundingSigned_write
16298 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
16301 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
16303 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
16306 * Read a FundingLocked from a byte array, created by FundingLocked_write
16308 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
16311 * Serialize the Init object into a byte array which can be read by Init_read
16313 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
16316 * Read a Init from a byte array, created by Init_write
16318 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
16321 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
16323 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
16326 * Read a OpenChannel from a byte array, created by OpenChannel_write
16328 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
16331 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
16333 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
16336 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
16338 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
16341 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
16343 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
16346 * Read a Shutdown from a byte array, created by Shutdown_write
16348 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
16351 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
16353 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
16356 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
16358 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
16361 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
16363 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
16366 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
16368 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
16371 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
16373 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
16376 * Read a UpdateFee from a byte array, created by UpdateFee_write
16378 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
16381 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
16383 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
16386 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
16388 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
16391 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
16393 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
16396 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
16398 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
16401 * Serialize the Ping object into a byte array which can be read by Ping_read
16403 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
16406 * Read a Ping from a byte array, created by Ping_write
16408 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
16411 * Serialize the Pong object into a byte array which can be read by Pong_read
16413 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
16416 * Read a Pong from a byte array, created by Pong_write
16418 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
16421 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
16423 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
16426 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
16428 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
16431 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
16433 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
16436 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
16438 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
16441 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
16443 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
16446 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
16448 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
16451 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
16453 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
16456 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
16458 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
16461 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
16463 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
16466 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
16468 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
16471 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
16473 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
16476 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
16478 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
16481 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
16483 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
16486 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
16488 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
16491 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
16493 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
16496 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
16498 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
16501 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
16503 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
16506 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
16508 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
16511 *\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
16513 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
16516 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
16518 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
16521 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
16523 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
16526 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
16528 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
16531 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
16533 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
16536 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
16538 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
16541 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
16543 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
16546 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
16548 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
16551 * Constructs a new IgnoringMessageHandler given each field
16553 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
16556 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
16557 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
16559 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
16562 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
16563 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
16565 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
16568 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
16570 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
16573 * Constructs a new ErroringMessageHandler
16575 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
16578 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
16579 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
16581 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
16584 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
16585 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
16587 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
16590 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
16592 void MessageHandler_free(struct LDKMessageHandler this_obj);
16595 * A message handler which handles messages specific to channels. Usually this is just a
16596 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
16598 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
16600 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
16603 * A message handler which handles messages specific to channels. Usually this is just a
16604 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
16606 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
16608 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
16611 * A message handler which handles messages updating our knowledge of the network channel
16612 * graph. Usually this is just a [`NetGraphMsgHandler`] object or an
16613 * [`IgnoringMessageHandler`].
16615 * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
16617 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
16620 * A message handler which handles messages updating our knowledge of the network channel
16621 * graph. Usually this is just a [`NetGraphMsgHandler`] object or an
16622 * [`IgnoringMessageHandler`].
16624 * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
16626 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
16629 * Constructs a new MessageHandler given each field
16631 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
16634 * Creates a copy of a SocketDescriptor
16636 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
16639 * Calls the free function if one is set
16641 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
16644 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
16646 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
16649 * Used to indicate that we probably can't make any future connections to this peer, implying
16650 * we should go ahead and force-close any channels we have with it.
16652 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
16655 * Used to indicate that we probably can't make any future connections to this peer, implying
16656 * we should go ahead and force-close any channels we have with it.
16658 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
16661 * Constructs a new PeerHandleError given each field
16663 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
16666 * Creates a copy of the PeerHandleError
16668 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
16671 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
16673 void PeerManager_free(struct LDKPeerManager this_obj);
16676 * Constructs a new PeerManager with the given message handlers and node_id secret key
16677 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
16678 * cryptographically secure random bytes.
16680 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);
16683 * Get the list of node ids for peers which have completed the initial handshake.
16685 * For outbound connections, this will be the same as the their_node_id parameter passed in to
16686 * new_outbound_connection, however entries will only appear once the initial handshake has
16687 * completed and we are sure the remote peer has the private key for the given node_id.
16689 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
16692 * Indicates a new outbound connection has been established to a node with the given node_id.
16693 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
16694 * descriptor but must disconnect the connection immediately.
16696 * Returns a small number of bytes to send to the remote node (currently always 50).
16698 * Panics if descriptor is duplicative with some other descriptor which has not yet been
16699 * [`socket_disconnected()`].
16701 * [`socket_disconnected()`]: PeerManager::socket_disconnected
16703 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);
16706 * Indicates a new inbound connection has been established.
16708 * May refuse the connection by returning an Err, but will never write bytes to the remote end
16709 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
16710 * call socket_disconnected for the new descriptor but must disconnect the connection
16713 * Panics if descriptor is duplicative with some other descriptor which has not yet been
16714 * [`socket_disconnected()`].
16716 * [`socket_disconnected()`]: PeerManager::socket_disconnected
16718 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
16721 * Indicates that there is room to write data to the given socket descriptor.
16723 * May return an Err to indicate that the connection should be closed.
16725 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
16726 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
16727 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
16728 * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
16731 * [`send_data`]: SocketDescriptor::send_data
16732 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
16734 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
16737 * Indicates that data was read from the given socket descriptor.
16739 * May return an Err to indicate that the connection should be closed.
16741 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
16742 * Thus, however, you should call [`process_events`] after any `read_event` to generate
16743 * [`send_data`] calls to handle responses.
16745 * If `Ok(true)` is returned, further read_events should not be triggered until a
16746 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
16749 * [`send_data`]: SocketDescriptor::send_data
16750 * [`process_events`]: PeerManager::process_events
16752 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);
16755 * Checks for any events generated by our handlers and processes them. Includes sending most
16756 * response messages as well as messages generated by calls to handler functions directly (eg
16757 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
16759 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
16762 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16763 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
16764 * [`send_data`]: SocketDescriptor::send_data
16766 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
16769 * Indicates that the given socket descriptor's connection is now closed.
16771 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
16774 * Disconnect a peer given its node id.
16776 * Set `no_connection_possible` to true to prevent any further connection with this peer,
16777 * force-closing any channels we have with it.
16779 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
16780 * peer. Thus, be very careful about reentrancy issues.
16782 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
16784 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
16787 * This function should be called roughly once every 30 seconds.
16788 * It will send pings to each peer and disconnect those which did not respond to the last
16791 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
16794 * [`send_data`]: SocketDescriptor::send_data
16796 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
16799 * Build the commitment secret from the seed and the commitment number
16801 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
16804 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
16805 * from the base secret and the per_commitment_point.
16807 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
16808 * generated (ie our own).
16810 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
16813 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
16814 * from the base point and the per_commitment_key. This is the public equivalent of
16815 * derive_private_key - using only public keys to derive a public key instead of private keys.
16817 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
16818 * generated (ie our own).
16820 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
16823 * Derives a per-commitment-transaction revocation key from its constituent parts.
16825 * Only the cheating participant owns a valid witness to propagate a revoked
16826 * commitment transaction, thus per_commitment_secret always come from cheater
16827 * and revocation_base_secret always come from punisher, which is the broadcaster
16828 * of the transaction spending with this key knowledge.
16830 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
16831 * generated (ie our own).
16833 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
16836 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
16837 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
16838 * public key instead of private keys.
16840 * Only the cheating participant owns a valid witness to propagate a revoked
16841 * commitment transaction, thus per_commitment_point always come from cheater
16842 * and revocation_base_point always come from punisher, which is the broadcaster
16843 * of the transaction spending with this key knowledge.
16845 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
16846 * generated (ie our own).
16848 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
16851 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
16853 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
16856 * The broadcaster's per-commitment public key which was used to derive the other keys.
16858 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16861 * The broadcaster's per-commitment public key which was used to derive the other keys.
16863 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16866 * The revocation key which is used to allow the broadcaster of the commitment
16867 * transaction to provide their counterparty the ability to punish them if they broadcast
16870 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16873 * The revocation key which is used to allow the broadcaster of the commitment
16874 * transaction to provide their counterparty the ability to punish them if they broadcast
16877 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16880 * Broadcaster's HTLC Key
16882 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16885 * Broadcaster's HTLC Key
16887 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16890 * Countersignatory's HTLC Key
16892 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16895 * Countersignatory's HTLC Key
16897 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16900 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
16902 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16905 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
16907 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16910 * Constructs a new TxCreationKeys given each field
16912 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);
16915 * Creates a copy of the TxCreationKeys
16917 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
16920 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
16922 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
16925 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
16927 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
16930 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
16932 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
16935 * The public key which is used to sign all commitment transactions, as it appears in the
16936 * on-chain channel lock-in 2-of-2 multisig output.
16938 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16941 * The public key which is used to sign all commitment transactions, as it appears in the
16942 * on-chain channel lock-in 2-of-2 multisig output.
16944 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16947 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
16948 * revocation keys. This is combined with the per-commitment-secret generated by the
16949 * counterparty to create a secret which the counterparty can reveal to revoke previous
16952 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16955 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
16956 * revocation keys. This is combined with the per-commitment-secret generated by the
16957 * counterparty to create a secret which the counterparty can reveal to revoke previous
16960 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16963 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
16964 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
16965 * static across every commitment transaction.
16967 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16970 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
16971 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
16972 * static across every commitment transaction.
16974 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16977 * The base point which is used (with derive_public_key) to derive a per-commitment payment
16978 * public key which receives non-HTLC-encumbered funds which are only available for spending
16979 * after some delay (or can be claimed via the revocation path).
16981 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16984 * The base point which is used (with derive_public_key) to derive a per-commitment payment
16985 * public key which receives non-HTLC-encumbered funds which are only available for spending
16986 * after some delay (or can be claimed via the revocation path).
16988 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16991 * The base point which is used (with derive_public_key) to derive a per-commitment public key
16992 * which is used to encumber HTLC-in-flight outputs.
16994 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16997 * The base point which is used (with derive_public_key) to derive a per-commitment public key
16998 * which is used to encumber HTLC-in-flight outputs.
17000 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17003 * Constructs a new ChannelPublicKeys given each field
17005 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);
17008 * Creates a copy of the ChannelPublicKeys
17010 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
17013 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
17015 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
17018 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
17020 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
17023 * Create per-state keys from channel base points and the per-commitment point.
17024 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
17026 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);
17029 * Generate per-state keys from channel static keys.
17030 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
17032 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);
17035 * A script either spendable by the revocation
17036 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
17037 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
17039 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
17042 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
17044 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
17047 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
17048 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
17049 * need to compare this value to whether the commitment transaction in question is that of
17050 * the counterparty or our own.
17052 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
17055 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
17056 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
17057 * need to compare this value to whether the commitment transaction in question is that of
17058 * the counterparty or our own.
17060 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
17063 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
17064 * this divided by 1000.
17066 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
17069 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
17070 * this divided by 1000.
17072 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
17075 * The CLTV lock-time at which this HTLC expires.
17077 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
17080 * The CLTV lock-time at which this HTLC expires.
17082 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
17085 * The hash of the preimage which unlocks this HTLC.
17087 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
17090 * The hash of the preimage which unlocks this HTLC.
17092 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
17095 * The position within the commitment transactions' outputs. This may be None if the value is
17096 * below the dust limit (in which case no output appears in the commitment transaction and the
17097 * value is spent to additional transaction fees).
17099 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
17102 * The position within the commitment transactions' outputs. This may be None if the value is
17103 * below the dust limit (in which case no output appears in the commitment transaction and the
17104 * value is spent to additional transaction fees).
17106 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
17109 * Constructs a new HTLCOutputInCommitment given each field
17111 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);
17114 * Creates a copy of the HTLCOutputInCommitment
17116 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
17119 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
17121 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
17124 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
17126 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
17129 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
17130 * does not need to have its previous_output_index filled.
17132 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
17135 * Gets the redeemscript for a funding output from the two funding public keys.
17136 * Note that the order of funding public keys does not matter.
17138 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
17141 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
17142 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
17143 * transaction which needs signing, and can be used to construct an HTLC transaction which is
17144 * broadcastable given a counterparty HTLC signature.
17146 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
17147 * commitment transaction).
17149 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);
17152 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
17154 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
17157 * Holder public keys
17159 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
17162 * Holder public keys
17164 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
17167 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
17169 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
17172 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
17174 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
17177 * Whether the holder is the initiator of this channel.
17178 * This is an input to the commitment number obscure factor computation.
17180 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
17183 * Whether the holder is the initiator of this channel.
17184 * This is an input to the commitment number obscure factor computation.
17186 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
17189 * The late-bound counterparty channel transaction parameters.
17190 * These parameters are populated at the point in the protocol where the counterparty provides them.
17192 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
17194 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
17197 * The late-bound counterparty channel transaction parameters.
17198 * These parameters are populated at the point in the protocol where the counterparty provides them.
17200 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
17202 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
17205 * The late-bound funding outpoint
17207 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
17209 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
17212 * The late-bound funding outpoint
17214 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
17216 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
17219 * Constructs a new ChannelTransactionParameters given each field
17221 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);
17224 * Creates a copy of the ChannelTransactionParameters
17226 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
17229 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
17231 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
17234 * Counter-party public keys
17236 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
17239 * Counter-party public keys
17241 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
17244 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
17246 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
17249 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
17251 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
17254 * Constructs a new CounterpartyChannelTransactionParameters given each field
17256 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
17259 * Creates a copy of the CounterpartyChannelTransactionParameters
17261 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
17264 * Whether the late bound parameters are populated.
17266 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
17269 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
17270 * given that the holder is the broadcaster.
17272 * self.is_populated() must be true before calling this function.
17274 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
17277 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
17278 * given that the counterparty is the broadcaster.
17280 * self.is_populated() must be true before calling this function.
17282 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
17285 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
17287 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
17290 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
17292 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
17295 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
17297 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
17300 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
17302 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
17305 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
17307 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
17310 * Get the channel pubkeys for the broadcaster
17312 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
17315 * Get the channel pubkeys for the countersignatory
17317 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
17320 * Get the contest delay applicable to the transactions.
17321 * Note that the contest delay was selected by the countersignatory.
17323 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
17326 * Whether the channel is outbound from the broadcaster.
17328 * The boolean representing the side that initiated the channel is
17329 * an input to the commitment number obscure factor computation.
17331 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
17334 * The funding outpoint
17336 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
17339 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
17341 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
17344 * Our counterparty's signature for the transaction
17346 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
17349 * Our counterparty's signature for the transaction
17351 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
17354 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
17356 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
17359 * Creates a copy of the HolderCommitmentTransaction
17361 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
17364 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
17366 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
17369 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
17371 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
17374 * Create a new holder transaction with the given counterparty signatures.
17375 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
17377 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);
17380 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
17382 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
17385 * The commitment transaction
17387 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
17390 * The commitment transaction
17392 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
17395 * The txid for the commitment transaction.
17397 * This is provided as a performance optimization, instead of calling transaction.txid()
17400 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
17403 * The txid for the commitment transaction.
17405 * This is provided as a performance optimization, instead of calling transaction.txid()
17408 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
17411 * Constructs a new BuiltCommitmentTransaction given each field
17413 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
17416 * Creates a copy of the BuiltCommitmentTransaction
17418 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
17421 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
17423 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
17426 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
17428 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
17431 * Get the SIGHASH_ALL sighash value of the transaction.
17433 * This can be used to verify a signature.
17435 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);
17438 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
17439 * because we are about to broadcast a holder transaction.
17441 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);
17444 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
17446 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
17449 * Creates a copy of the CommitmentTransaction
17451 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
17454 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
17456 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
17459 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
17461 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
17464 * The backwards-counting commitment number
17466 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
17469 * The value to be sent to the broadcaster
17471 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
17474 * The value to be sent to the counterparty
17476 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
17479 * The feerate paid per 1000-weight-unit in this commitment transaction.
17481 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
17484 * Trust our pre-built transaction and derived transaction creation public keys.
17486 * Applies a wrapper which allows access to these fields.
17488 * This should only be used if you fully trust the builder of this object. It should not
17489 *\tbe used by an external signer - instead use the verify function.
17491 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
17494 * Verify our pre-built transaction and derived transaction creation public keys.
17496 * Applies a wrapper which allows access to these fields.
17498 * An external validating signer must call this method before signing
17499 * or using the built transaction.
17501 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);
17504 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
17506 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
17509 * The transaction ID of the built Bitcoin transaction
17511 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
17514 * The pre-built Bitcoin commitment transaction
17516 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
17519 * The pre-calculated transaction creation public keys.
17521 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
17524 * Get a signature for each HTLC which was included in the commitment transaction (ie for
17525 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
17527 * The returned Vec has one entry for each HTLC, and in the same order.
17529 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);
17532 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
17533 * shared secret first. This prevents on-chain observers from discovering how many commitment
17534 * transactions occurred in a channel before it was closed.
17536 * This function gets the shared secret from relevant channel public keys and can be used to
17537 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
17539 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
17542 * Checks if two InitFeaturess contain equal inner contents.
17543 * This ignores pointers and is_owned flags and looks at the values in fields.
17544 * Two objects with NULL inner values will be considered "equal" here.
17546 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
17549 * Checks if two NodeFeaturess contain equal inner contents.
17550 * This ignores pointers and is_owned flags and looks at the values in fields.
17551 * Two objects with NULL inner values will be considered "equal" here.
17553 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
17556 * Checks if two ChannelFeaturess contain equal inner contents.
17557 * This ignores pointers and is_owned flags and looks at the values in fields.
17558 * Two objects with NULL inner values will be considered "equal" here.
17560 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
17563 * Checks if two InvoiceFeaturess contain equal inner contents.
17564 * This ignores pointers and is_owned flags and looks at the values in fields.
17565 * Two objects with NULL inner values will be considered "equal" here.
17567 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
17570 * Creates a copy of the InitFeatures
17572 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
17575 * Creates a copy of the NodeFeatures
17577 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
17580 * Creates a copy of the ChannelFeatures
17582 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
17585 * Creates a copy of the InvoiceFeatures
17587 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
17590 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
17592 void InitFeatures_free(struct LDKInitFeatures this_obj);
17595 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
17597 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
17600 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
17602 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
17605 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
17607 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
17610 * Create a blank Features with no features set
17612 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
17615 * Creates a Features with the bits set which are known by the implementation
17617 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
17620 * Create a blank Features with no features set
17622 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
17625 * Creates a Features with the bits set which are known by the implementation
17627 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
17630 * Create a blank Features with no features set
17632 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
17635 * Creates a Features with the bits set which are known by the implementation
17637 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
17640 * Create a blank Features with no features set
17642 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
17645 * Creates a Features with the bits set which are known by the implementation
17647 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
17650 * Returns whether the `payment_secret` feature is supported.
17652 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
17655 * Returns whether the `payment_secret` feature is supported.
17657 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
17660 * Returns whether the `payment_secret` feature is supported.
17662 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
17665 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
17667 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
17670 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
17672 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
17675 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
17677 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
17680 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
17682 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
17685 * Read a InitFeatures from a byte array, created by InitFeatures_write
17687 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
17690 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
17692 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
17695 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
17697 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
17700 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
17702 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
17705 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
17707 void RouteHop_free(struct LDKRouteHop this_obj);
17710 * The node_id of the node at this hop.
17712 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
17715 * The node_id of the node at this hop.
17717 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17720 * The node_announcement features of the node at this hop. For the last hop, these may be
17721 * amended to match the features present in the invoice this node generated.
17723 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
17726 * The node_announcement features of the node at this hop. For the last hop, these may be
17727 * amended to match the features present in the invoice this node generated.
17729 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
17732 * The channel that should be used from the previous hop to reach this node.
17734 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
17737 * The channel that should be used from the previous hop to reach this node.
17739 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
17742 * The channel_announcement features of the channel that should be used from the previous hop
17743 * to reach this node.
17745 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
17748 * The channel_announcement features of the channel that should be used from the previous hop
17749 * to reach this node.
17751 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
17754 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
17755 * For the last hop, this should be the full value of the payment (might be more than
17756 * requested if we had to match htlc_minimum_msat).
17758 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
17761 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
17762 * For the last hop, this should be the full value of the payment (might be more than
17763 * requested if we had to match htlc_minimum_msat).
17765 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
17768 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
17769 * expected at the destination, in excess of the current block height.
17771 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
17774 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
17775 * expected at the destination, in excess of the current block height.
17777 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
17780 * Constructs a new RouteHop given each field
17782 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);
17785 * Creates a copy of the RouteHop
17787 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
17790 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
17792 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
17795 * Read a RouteHop from a byte array, created by RouteHop_write
17797 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
17800 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
17802 void Route_free(struct LDKRoute this_obj);
17805 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
17806 * last RouteHop in each path must be the same.
17807 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
17808 * destination. Thus, this must always be at least length one. While the maximum length of any
17809 * given path is variable, keeping the length of any path to less than 20 should currently
17810 * ensure it is viable.
17812 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
17815 * Constructs a new Route given each field
17817 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
17820 * Creates a copy of the Route
17822 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
17825 * Serialize the Route object into a byte array which can be read by Route_read
17827 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
17830 * Read a Route from a byte array, created by Route_write
17832 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
17835 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
17837 void RouteHint_free(struct LDKRouteHint this_obj);
17840 * Checks if two RouteHints contain equal inner contents.
17841 * This ignores pointers and is_owned flags and looks at the values in fields.
17842 * Two objects with NULL inner values will be considered "equal" here.
17844 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
17847 * Creates a copy of the RouteHint
17849 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
17852 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
17854 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
17857 * The node_id of the non-target end of the route
17859 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17862 * The node_id of the non-target end of the route
17864 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17867 * The short_channel_id of this channel
17869 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17872 * The short_channel_id of this channel
17874 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
17877 * The fees which must be paid to use this channel
17879 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17882 * The fees which must be paid to use this channel
17884 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
17887 * The difference in CLTV values between this node and the next node.
17889 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17892 * The difference in CLTV values between this node and the next node.
17894 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
17897 * The minimum value, in msat, which must be relayed to the next hop.
17899 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17902 * The minimum value, in msat, which must be relayed to the next hop.
17904 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
17907 * The maximum value in msat available for routing with a single HTLC.
17909 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17912 * The maximum value in msat available for routing with a single HTLC.
17914 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
17917 * Constructs a new RouteHintHop given each field
17919 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);
17922 * Checks if two RouteHintHops contain equal inner contents.
17923 * This ignores pointers and is_owned flags and looks at the values in fields.
17924 * Two objects with NULL inner values will be considered "equal" here.
17926 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
17929 * Creates a copy of the RouteHintHop
17931 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
17934 * Gets a route from us (payer) to the given target node (payee).
17936 * If the payee provided features in their invoice, they should be provided via payee_features.
17937 * Without this, MPP will only be used if the payee's features are available in the network graph.
17939 * Private routing paths between a public node and the target may be included in `last_hops`.
17940 * Currently, only the last hop in each path is considered.
17942 * If some channels aren't announced, it may be useful to fill in a first_hops with the
17943 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
17944 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
17945 * in first_hops will be used.
17947 * Panics if first_hops contains channels without short_channel_ids
17948 * (ChannelManager::list_usable_channels will never include such channels).
17950 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
17951 * equal), however the enabled/disabled bit on such channels as well as the
17952 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
17954 * Note that payee_features (or a relevant inner pointer) may be NULL or all-0s to represent None
17955 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
17957 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_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
17960 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
17962 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
17965 * Creates a copy of the NetworkGraph
17967 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
17970 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
17972 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
17975 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
17977 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
17980 * Creates a new tracker of the actual state of the network of channels and nodes,
17981 * assuming a fresh network graph.
17982 * Chain monitor is used to make sure announced channels exist on-chain,
17983 * channel data is correct, and that the announcement is signed with
17984 * channel owners' keys.
17986 * Note that chain_access (or a relevant inner pointer) may be NULL or all-0s to represent None
17988 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
17991 * Creates a new tracker of the actual state of the network of channels and nodes,
17992 * assuming an existing Network Graph.
17994 * Note that chain_access (or a relevant inner pointer) may be NULL or all-0s to represent None
17996 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
17999 * Adds a provider used to check new announcements. Does not affect
18000 * existing announcements unless they are updated.
18001 * Add, update or remove the provider would replace the current one.
18003 * Note that chain_access (or a relevant inner pointer) may be NULL or all-0s to represent None
18005 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
18008 * Take a read lock on the network_graph and return it in the C-bindings
18009 * newtype helper. This is likely only useful when called via the C
18010 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
18013 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
18016 * Get a reference to the NetworkGraph which this read-lock contains.
18018 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
18021 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
18022 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
18024 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
18027 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
18028 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
18030 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
18033 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
18035 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
18038 * When the last update to the channel direction was issued.
18039 * Value is opaque, as set in the announcement.
18041 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
18044 * When the last update to the channel direction was issued.
18045 * Value is opaque, as set in the announcement.
18047 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
18050 * Whether the channel can be currently used for payments (in this one direction).
18052 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
18055 * Whether the channel can be currently used for payments (in this one direction).
18057 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
18060 * The difference in CLTV values that you must have when routing through this channel.
18062 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
18065 * The difference in CLTV values that you must have when routing through this channel.
18067 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
18070 * The minimum value, which must be relayed to the next hop via the channel
18072 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
18075 * The minimum value, which must be relayed to the next hop via the channel
18077 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
18080 * The maximum value which may be relayed to the next hop via the channel.
18082 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
18085 * The maximum value which may be relayed to the next hop via the channel.
18087 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
18090 * Fees charged when the channel is used for routing
18092 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
18095 * Fees charged when the channel is used for routing
18097 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
18100 * Most recent update for the channel received from the network
18101 * Mostly redundant with the data we store in fields explicitly.
18102 * Everything else is useful only for sending out for initial routing sync.
18103 * Not stored if contains excess data to prevent DoS.
18105 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18107 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
18110 * Most recent update for the channel received from the network
18111 * Mostly redundant with the data we store in fields explicitly.
18112 * Everything else is useful only for sending out for initial routing sync.
18113 * Not stored if contains excess data to prevent DoS.
18115 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18117 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
18120 * Constructs a new DirectionalChannelInfo given each field
18122 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);
18125 * Creates a copy of the DirectionalChannelInfo
18127 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
18130 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
18132 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
18135 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
18137 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
18140 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
18142 void ChannelInfo_free(struct LDKChannelInfo this_obj);
18145 * Protocol features of a channel communicated during its announcement
18147 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
18150 * Protocol features of a channel communicated during its announcement
18152 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
18155 * Source node of the first direction of a channel
18157 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
18160 * Source node of the first direction of a channel
18162 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18165 * Details about the first direction of a channel
18167 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18169 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
18172 * Details about the first direction of a channel
18174 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18176 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
18179 * Source node of the second direction of a channel
18181 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
18184 * Source node of the second direction of a channel
18186 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18189 * Details about the second direction of a channel
18191 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18193 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
18196 * Details about the second direction of a channel
18198 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18200 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
18203 * The channel capacity as seen on-chain, if chain lookup is available.
18205 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
18208 * The channel capacity as seen on-chain, if chain lookup is available.
18210 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
18213 * An initial announcement of the channel
18214 * Mostly redundant with the data we store in fields explicitly.
18215 * Everything else is useful only for sending out for initial routing sync.
18216 * Not stored if contains excess data to prevent DoS.
18218 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18220 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
18223 * An initial announcement of the channel
18224 * Mostly redundant with the data we store in fields explicitly.
18225 * Everything else is useful only for sending out for initial routing sync.
18226 * Not stored if contains excess data to prevent DoS.
18228 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18230 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
18233 * Constructs a new ChannelInfo given each field
18235 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);
18238 * Creates a copy of the ChannelInfo
18240 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
18243 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
18245 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
18248 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
18250 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
18253 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
18255 void RoutingFees_free(struct LDKRoutingFees this_obj);
18258 * Flat routing fee in satoshis
18260 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
18263 * Flat routing fee in satoshis
18265 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
18268 * Liquidity-based routing fee in millionths of a routed amount.
18269 * In other words, 10000 is 1%.
18271 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
18274 * Liquidity-based routing fee in millionths of a routed amount.
18275 * In other words, 10000 is 1%.
18277 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
18280 * Constructs a new RoutingFees given each field
18282 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
18285 * Checks if two RoutingFeess contain equal inner contents.
18286 * This ignores pointers and is_owned flags and looks at the values in fields.
18287 * Two objects with NULL inner values will be considered "equal" here.
18289 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
18292 * Creates a copy of the RoutingFees
18294 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
18297 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
18299 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
18302 * Read a RoutingFees from a byte array, created by RoutingFees_write
18304 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
18307 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
18309 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
18312 * Protocol features the node announced support for
18314 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
18317 * Protocol features the node announced support for
18319 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
18322 * When the last known update to the node state was issued.
18323 * Value is opaque, as set in the announcement.
18325 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
18328 * When the last known update to the node state was issued.
18329 * Value is opaque, as set in the announcement.
18331 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
18334 * Color assigned to the node
18336 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
18339 * Color assigned to the node
18341 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
18344 * Moniker assigned to the node.
18345 * May be invalid or malicious (eg control chars),
18346 * should not be exposed to the user.
18348 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
18351 * Moniker assigned to the node.
18352 * May be invalid or malicious (eg control chars),
18353 * should not be exposed to the user.
18355 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18358 * Internet-level addresses via which one can connect to the node
18360 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
18363 * An initial announcement of the node
18364 * Mostly redundant with the data we store in fields explicitly.
18365 * Everything else is useful only for sending out for initial routing sync.
18366 * Not stored if contains excess data to prevent DoS.
18368 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18370 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
18373 * An initial announcement of the node
18374 * Mostly redundant with the data we store in fields explicitly.
18375 * Everything else is useful only for sending out for initial routing sync.
18376 * Not stored if contains excess data to prevent DoS.
18378 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18380 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
18383 * Constructs a new NodeAnnouncementInfo given each field
18385 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);
18388 * Creates a copy of the NodeAnnouncementInfo
18390 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
18393 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
18395 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
18398 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
18400 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
18403 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
18405 void NodeInfo_free(struct LDKNodeInfo this_obj);
18408 * All valid channels a node has announced
18410 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
18413 * Lowest fees enabling routing via any of the enabled, known channels to a node.
18414 * The two fields (flat and proportional fee) are independent,
18415 * meaning they don't have to refer to the same channel.
18417 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18419 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
18422 * Lowest fees enabling routing via any of the enabled, known channels to a node.
18423 * The two fields (flat and proportional fee) are independent,
18424 * meaning they don't have to refer to the same channel.
18426 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18428 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
18431 * More information about a node from node_announcement.
18432 * Optional because we store a Node entry after learning about it from
18433 * a channel announcement, but before receiving a node announcement.
18435 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18437 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
18440 * More information about a node from node_announcement.
18441 * Optional because we store a Node entry after learning about it from
18442 * a channel announcement, but before receiving a node announcement.
18444 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18446 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
18449 * Constructs a new NodeInfo given each field
18451 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
18454 * Creates a copy of the NodeInfo
18456 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
18459 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
18461 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
18464 * Read a NodeInfo from a byte array, created by NodeInfo_write
18466 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
18469 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
18471 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
18474 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
18476 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
18479 * Creates a new, empty, network graph.
18481 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
18484 * For an already known node (from channel announcements), update its stored properties from a
18485 * given node announcement.
18487 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
18488 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
18489 * routing messages from a source using a protocol other than the lightning P2P protocol.
18491 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
18494 * For an already known node (from channel announcements), update its stored properties from a
18495 * given node announcement without verifying the associated signatures. Because we aren't
18496 * given the associated signatures here we cannot relay the node announcement to any of our
18499 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
18502 * Store or update channel info from a channel announcement.
18504 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
18505 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
18506 * routing messages from a source using a protocol other than the lightning P2P protocol.
18508 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
18509 * the corresponding UTXO exists on chain and is correctly-formatted.
18511 * Note that chain_access (or a relevant inner pointer) may be NULL or all-0s to represent None
18513 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);
18516 * Store or update channel info from a channel announcement without verifying the associated
18517 * signatures. Because we aren't given the associated signatures here we cannot relay the
18518 * channel announcement to any of our peers.
18520 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
18521 * the corresponding UTXO exists on chain and is correctly-formatted.
18523 * Note that chain_access (or a relevant inner pointer) may be NULL or all-0s to represent None
18525 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);
18528 * Close a channel if a corresponding HTLC fail was sent.
18529 * If permanent, removes a channel from the local storage.
18530 * May cause the removal of nodes too, if this was their last channel.
18531 * If not permanent, makes channels unavailable for routing.
18533 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
18536 * For an already known (from announcement) channel, update info about one of the directions
18539 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
18540 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
18541 * routing messages from a source using a protocol other than the lightning P2P protocol.
18543 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
18546 * For an already known (from announcement) channel, update info about one of the directions
18547 * of the channel without verifying the associated signatures. Because we aren't given the
18548 * associated signatures here we cannot relay the channel update to any of our peers.
18550 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
18553 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
18555 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
18558 * Initialize a new FilesystemPersister and set the path to the individual channels'
18561 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
18564 * Get the directory which was provided when this persister was initialized.
18566 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
18569 * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
18570 * initialization, within a file called \"manager\".
18572 MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKStr data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
18575 * Read `ChannelMonitor`s from disk.
18577 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
18580 * Constructs a new Persist which calls the relevant methods on this_arg.
18581 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
18583 struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
18586 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
18588 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
18591 * Calls the free function if one is set
18593 void ChannelManagerPersister_free(struct LDKChannelManagerPersister this_ptr);
18596 * Start a background thread that takes care of responsibilities enumerated in the top-level
18599 * If `persist_manager` returns an error, then this thread will return said error (and
18600 * `start()` will need to be called again to restart the `BackgroundProcessor`). Users should
18601 * wait on [`thread_handle`]'s `join()` method to be able to tell if and when an error is
18602 * returned, or implement `persist_manager` such that an error is never returned to the
18603 * `BackgroundProcessor`
18605 * `persist_manager` is responsible for writing out the [`ChannelManager`] to disk, and/or
18606 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
18607 * [`ChannelManager`]. See [`FilesystemPersister::persist_manager`] for Rust-Lightning's
18608 * provided implementation.
18610 * [`thread_handle`]: BackgroundProcessor::thread_handle
18611 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
18612 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
18613 * [`FilesystemPersister::persist_manager`]: lightning_persister::FilesystemPersister::persist_manager
18615 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);
18618 * Stop `BackgroundProcessor`'s thread.
18620 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
18623 * **Call this function on startup to ensure that all assumptions about the platform are valid.**
18625 * Unfortunately we have to make assumptions about the upper bounds of the `SystemTime` type on
18626 * your platform which we can't fully verify at compile time and which isn't part of it's contract.
18627 * To our best knowledge our assumptions hold for all platforms officially supported by rust, but
18628 * since this check is fast we recommend to do it anyway.
18630 * If this function fails this is considered a bug. Please open an issue describing your
18631 * platform and stating your current system time.
18634 * If the check fails this function panics. By calling this function on startup you ensure that
18635 * this wont happen at an arbitrary later point in time.
18637 void check_platform(void);
18640 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
18642 void Invoice_free(struct LDKInvoice this_obj);
18645 * Checks if two Invoices contain equal inner contents.
18646 * This ignores pointers and is_owned flags and looks at the values in fields.
18647 * Two objects with NULL inner values will be considered "equal" here.
18649 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
18652 * Creates a copy of the Invoice
18654 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
18657 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
18659 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
18662 * Checks if two SignedRawInvoices contain equal inner contents.
18663 * This ignores pointers and is_owned flags and looks at the values in fields.
18664 * Two objects with NULL inner values will be considered "equal" here.
18666 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
18669 * Creates a copy of the SignedRawInvoice
18671 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
18674 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
18676 void RawInvoice_free(struct LDKRawInvoice this_obj);
18681 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
18686 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
18689 * Checks if two RawInvoices contain equal inner contents.
18690 * This ignores pointers and is_owned flags and looks at the values in fields.
18691 * Two objects with NULL inner values will be considered "equal" here.
18693 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
18696 * Creates a copy of the RawInvoice
18698 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
18701 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
18703 void RawDataPart_free(struct LDKRawDataPart this_obj);
18706 * generation time of the invoice
18708 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
18711 * generation time of the invoice
18713 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
18716 * Checks if two RawDataParts contain equal inner contents.
18717 * This ignores pointers and is_owned flags and looks at the values in fields.
18718 * Two objects with NULL inner values will be considered "equal" here.
18720 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
18723 * Creates a copy of the RawDataPart
18725 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
18728 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
18730 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
18733 * Checks if two PositiveTimestamps contain equal inner contents.
18734 * This ignores pointers and is_owned flags and looks at the values in fields.
18735 * Two objects with NULL inner values will be considered "equal" here.
18737 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
18740 * Creates a copy of the PositiveTimestamp
18742 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
18745 * Creates a copy of the SiPrefix
18747 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
18750 * Utility method to constructs a new Milli-variant SiPrefix
18752 enum LDKSiPrefix SiPrefix_milli(void);
18755 * Utility method to constructs a new Micro-variant SiPrefix
18757 enum LDKSiPrefix SiPrefix_micro(void);
18760 * Utility method to constructs a new Nano-variant SiPrefix
18762 enum LDKSiPrefix SiPrefix_nano(void);
18765 * Utility method to constructs a new Pico-variant SiPrefix
18767 enum LDKSiPrefix SiPrefix_pico(void);
18770 * Checks if two SiPrefixs contain equal inner contents.
18771 * This ignores pointers and is_owned flags and looks at the values in fields.
18773 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
18776 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
18777 * This is effectively 10^12 * the prefix multiplier
18779 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
18782 * Creates a copy of the Currency
18784 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
18787 * Utility method to constructs a new Bitcoin-variant Currency
18789 enum LDKCurrency Currency_bitcoin(void);
18792 * Utility method to constructs a new BitcoinTestnet-variant Currency
18794 enum LDKCurrency Currency_bitcoin_testnet(void);
18797 * Utility method to constructs a new Regtest-variant Currency
18799 enum LDKCurrency Currency_regtest(void);
18802 * Utility method to constructs a new Simnet-variant Currency
18804 enum LDKCurrency Currency_simnet(void);
18807 * Utility method to constructs a new Signet-variant Currency
18809 enum LDKCurrency Currency_signet(void);
18812 * Checks if two Currencys contain equal inner contents.
18813 * This ignores pointers and is_owned flags and looks at the values in fields.
18815 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
18818 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
18820 void Sha256_free(struct LDKSha256 this_obj);
18823 * Checks if two Sha256s contain equal inner contents.
18824 * This ignores pointers and is_owned flags and looks at the values in fields.
18825 * Two objects with NULL inner values will be considered "equal" here.
18827 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
18830 * Creates a copy of the Sha256
18832 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
18835 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
18837 void Description_free(struct LDKDescription this_obj);
18840 * Checks if two Descriptions contain equal inner contents.
18841 * This ignores pointers and is_owned flags and looks at the values in fields.
18842 * Two objects with NULL inner values will be considered "equal" here.
18844 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
18847 * Creates a copy of the Description
18849 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
18852 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
18854 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
18857 * Checks if two PayeePubKeys contain equal inner contents.
18858 * This ignores pointers and is_owned flags and looks at the values in fields.
18859 * Two objects with NULL inner values will be considered "equal" here.
18861 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
18864 * Creates a copy of the PayeePubKey
18866 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
18869 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
18871 void ExpiryTime_free(struct LDKExpiryTime this_obj);
18874 * Checks if two ExpiryTimes contain equal inner contents.
18875 * This ignores pointers and is_owned flags and looks at the values in fields.
18876 * Two objects with NULL inner values will be considered "equal" here.
18878 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
18881 * Creates a copy of the ExpiryTime
18883 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
18886 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
18888 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
18891 * Checks if two MinFinalCltvExpirys contain equal inner contents.
18892 * This ignores pointers and is_owned flags and looks at the values in fields.
18893 * Two objects with NULL inner values will be considered "equal" here.
18895 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
18898 * Creates a copy of the MinFinalCltvExpiry
18900 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
18903 * Frees any resources used by the Fallback
18905 void Fallback_free(struct LDKFallback this_ptr);
18908 * Creates a copy of the Fallback
18910 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
18913 * Utility method to constructs a new SegWitProgram-variant Fallback
18915 struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program);
18918 * Utility method to constructs a new PubKeyHash-variant Fallback
18920 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
18923 * Utility method to constructs a new ScriptHash-variant Fallback
18925 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
18928 * Checks if two Fallbacks contain equal inner contents.
18929 * This ignores pointers and is_owned flags and looks at the values in fields.
18931 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
18934 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
18936 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
18939 * Checks if two InvoiceSignatures contain equal inner contents.
18940 * This ignores pointers and is_owned flags and looks at the values in fields.
18941 * Two objects with NULL inner values will be considered "equal" here.
18943 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
18946 * Creates a copy of the InvoiceSignature
18948 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
18951 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
18953 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
18956 * Checks if two PrivateRoutes contain equal inner contents.
18957 * This ignores pointers and is_owned flags and looks at the values in fields.
18958 * Two objects with NULL inner values will be considered "equal" here.
18960 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
18963 * Creates a copy of the PrivateRoute
18965 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
18968 * Disassembles the `SignedRawInvoice` into its three parts:
18970 * 2. hash of the raw invoice
18973 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
18976 * The `RawInvoice` which was signed.
18978 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
18981 * The hash of the `RawInvoice` that was signed.
18983 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
18986 * InvoiceSignature for the invoice.
18988 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
18991 * Recovers the public key used for signing the invoice from the recoverable signature.
18993 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
18996 * Checks if the signature is valid for the included payee public key or if none exists if it's
18997 * valid for the recovered signature (which should always be true?).
18999 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
19002 * Calculate the hash of the encoded `RawInvoice`
19004 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19008 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19010 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19014 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19016 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19020 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19022 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19026 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19028 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19032 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19034 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19038 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19040 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19044 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19046 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19050 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19052 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19054 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19056 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19058 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19061 * Create a new `PositiveTimestamp` from a unix timestamp in the Range
19062 * `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
19063 * `CreationError::TimestampOutOfBounds`.
19065 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
19068 * Create a new `PositiveTimestamp` from a `SystemTime` with a corresponding unix timestamp in
19069 * the Range `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
19070 * `CreationError::TimestampOutOfBounds`.
19072 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
19075 * Returns the UNIX timestamp representing the stored time
19077 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
19080 * Returns a reference to the internal `SystemTime` time representation
19082 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
19085 * Transform the `Invoice` into it's unchecked version
19087 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
19090 * Check that the invoice is signed correctly and that key recovery works
19092 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
19095 * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
19097 * use lightning_invoice::*;
19099 * let invoice = \"lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdp\\
19100 * \tl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d7\\
19101 * \t3gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ec\\
19102 * \tky03ylcqca784w\";
19104 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
19106 * assert!(Invoice::from_signed(signed).is_ok());
19109 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
19112 * Returns the `Invoice`'s timestamp (should equal it's creation time)
19114 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
19117 * Returns the hash to which we will receive the preimage on completion of the payment
19119 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
19122 * Get the payee's public key if one was included in the invoice
19124 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19126 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
19129 * Get the payment secret if one was included in the invoice
19131 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19133 MUST_USE_RES struct LDKThirtyTwoBytes Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg);
19136 * Get the invoice features if they were included in the invoice
19138 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19140 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
19143 * Recover the payee's public key (only to be used if none was included in the invoice)
19145 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
19148 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
19150 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
19153 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
19154 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
19156 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
19159 * Returns a list of all routes included in the invoice
19161 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
19164 * Returns a list of all routes included in the invoice as the underlying hints
19166 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
19169 * Returns the currency for which the invoice was issued
19171 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
19174 * Returns the amount if specified in the invoice as pico <currency>.
19176 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_pico_btc(const struct LDKInvoice *NONNULL_PTR this_arg);
19179 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
19180 * returns `CreationError::DescriptionTooLong` otherwise
19182 * Please note that single characters may use more than one byte due to UTF8 encoding.
19184 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
19187 * Returns the underlying description `String`
19189 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
19192 * Construct an `ExpiryTime` from seconds. If there exists a `PositiveTimestamp` which would
19193 * overflow on adding the `EpiryTime` to it then this function will return a
19194 * `CreationError::ExpiryTimeOutOfBounds`.
19196 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_seconds(uint64_t seconds);
19199 * Construct an `ExpiryTime` from a `Duration`. If there exists a `PositiveTimestamp` which
19200 * would overflow on adding the `EpiryTime` to it then this function will return a
19201 * `CreationError::ExpiryTimeOutOfBounds`.
19203 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_duration(uint64_t duration);
19206 * Returns the expiry time in seconds
19208 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
19211 * Returns a reference to the underlying `Duration` (=expiry time)
19213 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
19216 * Creates a new (partial) route from a list of hops
19218 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
19221 * Returns the underlying list of hops
19223 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
19226 * Creates a copy of the CreationError
19228 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
19231 * Utility method to constructs a new DescriptionTooLong-variant CreationError
19233 enum LDKCreationError CreationError_description_too_long(void);
19236 * Utility method to constructs a new RouteTooLong-variant CreationError
19238 enum LDKCreationError CreationError_route_too_long(void);
19241 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
19243 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
19246 * Utility method to constructs a new ExpiryTimeOutOfBounds-variant CreationError
19248 enum LDKCreationError CreationError_expiry_time_out_of_bounds(void);
19251 * Checks if two CreationErrors contain equal inner contents.
19252 * This ignores pointers and is_owned flags and looks at the values in fields.
19254 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
19257 * Get the string representation of a CreationError object
19259 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
19262 * Creates a copy of the SemanticError
19264 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
19267 * Utility method to constructs a new NoPaymentHash-variant SemanticError
19269 enum LDKSemanticError SemanticError_no_payment_hash(void);
19272 * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
19274 enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
19277 * Utility method to constructs a new NoDescription-variant SemanticError
19279 enum LDKSemanticError SemanticError_no_description(void);
19282 * Utility method to constructs a new MultipleDescriptions-variant SemanticError
19284 enum LDKSemanticError SemanticError_multiple_descriptions(void);
19287 * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
19289 enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
19292 * Utility method to constructs a new InvalidFeatures-variant SemanticError
19294 enum LDKSemanticError SemanticError_invalid_features(void);
19297 * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
19299 enum LDKSemanticError SemanticError_invalid_recovery_id(void);
19302 * Utility method to constructs a new InvalidSignature-variant SemanticError
19304 enum LDKSemanticError SemanticError_invalid_signature(void);
19307 * Checks if two SemanticErrors contain equal inner contents.
19308 * This ignores pointers and is_owned flags and looks at the values in fields.
19310 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
19313 * Get the string representation of a SemanticError object
19315 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
19318 * Frees any resources used by the SignOrCreationError
19320 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
19323 * Creates a copy of the SignOrCreationError
19325 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
19328 * Utility method to constructs a new SignError-variant SignOrCreationError
19330 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
19333 * Utility method to constructs a new CreationError-variant SignOrCreationError
19335 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
19338 * Checks if two SignOrCreationErrors contain equal inner contents.
19339 * This ignores pointers and is_owned flags and looks at the values in fields.
19341 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
19344 * Get the string representation of a SignOrCreationError object
19346 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
19349 * Utility to construct an invoice. Generally, unless you want to do something like a custom
19350 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
19351 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
19352 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
19353 * that the payment secret is valid when the invoice is paid.
19355 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);
19358 * Read a SiPrefix object from a string
19360 struct LDKCResult_SiPrefixNoneZ SiPrefix_from_str(struct LDKStr s);
19363 * Read a Invoice object from a string
19365 struct LDKCResult_InvoiceNoneZ Invoice_from_str(struct LDKStr s);
19368 * Read a SignedRawInvoice object from a string
19370 struct LDKCResult_SignedRawInvoiceNoneZ SignedRawInvoice_from_str(struct LDKStr s);
19373 * Get the string representation of a Invoice object
19375 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
19378 * Get the string representation of a SignedRawInvoice object
19380 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
19383 * Get the string representation of a Currency object
19385 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
19388 * Get the string representation of a SiPrefix object
19390 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
19392 #endif /* LDK_C_BINDINGS_H */
19394 #include "ldk_ver.h"