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,
167 * Bitcoin simnet/signet
171 * Must be last for serialization purposes
173 LDKCurrency_Sentinel,
177 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
179 typedef enum LDKIOError {
181 LDKIOError_PermissionDenied,
182 LDKIOError_ConnectionRefused,
183 LDKIOError_ConnectionReset,
184 LDKIOError_ConnectionAborted,
185 LDKIOError_NotConnected,
186 LDKIOError_AddrInUse,
187 LDKIOError_AddrNotAvailable,
188 LDKIOError_BrokenPipe,
189 LDKIOError_AlreadyExists,
190 LDKIOError_WouldBlock,
191 LDKIOError_InvalidInput,
192 LDKIOError_InvalidData,
194 LDKIOError_WriteZero,
195 LDKIOError_Interrupted,
197 LDKIOError_UnexpectedEof,
199 * Must be last for serialization purposes
205 * An enum representing the available verbosity levels of the logger.
207 typedef enum LDKLevel {
209 *Designates logger being silent
213 * Designates very serious errors
217 * Designates hazardous situations
221 * Designates useful information
225 * Designates lower priority information
229 * Designates very low priority, often extremely verbose, information
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
464 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
465 * with our counterparty.
467 typedef struct MUST_USE_STRUCT LDKChannelConfig {
469 * A pointer to the opaque Rust object.
470 * Nearly everywhere, inner must be non-null, however in places where
471 * the Rust equivalent takes an Option, it may be set to null to indicate None.
473 LDKnativeChannelConfig *inner;
475 * Indicates that this is the only struct which contains the same pointer.
476 * Rust functions which take ownership of an object provided via an argument require
477 * this to be true and invalidate the object pointed to by inner.
485 * An error in decoding a message or struct.
487 typedef struct MUST_USE_STRUCT LDKDecodeError {
489 * A pointer to the opaque Rust object.
490 * Nearly everywhere, inner must be non-null, however in places where
491 * the Rust equivalent takes an Option, it may be set to null to indicate None.
493 LDKnativeDecodeError *inner;
495 * Indicates that this is the only struct which contains the same pointer.
496 * Rust functions which take ownership of an object provided via an argument require
497 * this to be true and invalidate the object pointed to by inner.
503 * The contents of CResult_ChannelConfigDecodeErrorZ
505 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
507 * A pointer to the contents in the success state.
508 * Reading from this pointer when `result_ok` is not set is undefined.
510 struct LDKChannelConfig *result;
512 * A pointer to the contents in the error state.
513 * Reading from this pointer when `result_ok` is set is undefined.
515 struct LDKDecodeError *err;
516 } LDKCResult_ChannelConfigDecodeErrorZPtr;
519 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
520 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
521 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
523 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
525 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
526 * `err` or `result` depending on the state of `result_ok`.
528 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
530 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
533 } LDKCResult_ChannelConfigDecodeErrorZ;
538 * A reference to a transaction output.
540 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
541 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
543 typedef struct MUST_USE_STRUCT LDKOutPoint {
545 * A pointer to the opaque Rust object.
546 * Nearly everywhere, inner must be non-null, however in places where
547 * the Rust equivalent takes an Option, it may be set to null to indicate None.
549 LDKnativeOutPoint *inner;
551 * Indicates that this is the only struct which contains the same pointer.
552 * Rust functions which take ownership of an object provided via an argument require
553 * this to be true and invalidate the object pointed to by inner.
559 * The contents of CResult_OutPointDecodeErrorZ
561 typedef union LDKCResult_OutPointDecodeErrorZPtr {
563 * A pointer to the contents in the success state.
564 * Reading from this pointer when `result_ok` is not set is undefined.
566 struct LDKOutPoint *result;
568 * A pointer to the contents in the error state.
569 * Reading from this pointer when `result_ok` is set is undefined.
571 struct LDKDecodeError *err;
572 } LDKCResult_OutPointDecodeErrorZPtr;
575 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
576 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
577 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
579 typedef struct LDKCResult_OutPointDecodeErrorZ {
581 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
582 * `err` or `result` depending on the state of `result_ok`.
584 union LDKCResult_OutPointDecodeErrorZPtr contents;
586 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
589 } LDKCResult_OutPointDecodeErrorZ;
592 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
594 typedef struct LDKSecretKey {
596 * The bytes of the secret key
602 * The contents of CResult_SecretKeyErrorZ
604 typedef union LDKCResult_SecretKeyErrorZPtr {
606 * A pointer to the contents in the success state.
607 * Reading from this pointer when `result_ok` is not set is undefined.
609 struct LDKSecretKey *result;
611 * A pointer to the contents in the error state.
612 * Reading from this pointer when `result_ok` is set is undefined.
614 enum LDKSecp256k1Error *err;
615 } LDKCResult_SecretKeyErrorZPtr;
618 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
619 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
620 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
622 typedef struct LDKCResult_SecretKeyErrorZ {
624 * The contents of this CResult_SecretKeyErrorZ, accessible via either
625 * `err` or `result` depending on the state of `result_ok`.
627 union LDKCResult_SecretKeyErrorZPtr contents;
629 * Whether this CResult_SecretKeyErrorZ represents a success state.
632 } LDKCResult_SecretKeyErrorZ;
635 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
637 typedef struct LDKPublicKey {
639 * The bytes of the public key
641 uint8_t compressed_form[33];
645 * The contents of CResult_PublicKeyErrorZ
647 typedef union LDKCResult_PublicKeyErrorZPtr {
649 * A pointer to the contents in the success state.
650 * Reading from this pointer when `result_ok` is not set is undefined.
652 struct LDKPublicKey *result;
654 * A pointer to the contents in the error state.
655 * Reading from this pointer when `result_ok` is set is undefined.
657 enum LDKSecp256k1Error *err;
658 } LDKCResult_PublicKeyErrorZPtr;
661 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
662 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
663 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
665 typedef struct LDKCResult_PublicKeyErrorZ {
667 * The contents of this CResult_PublicKeyErrorZ, accessible via either
668 * `err` or `result` depending on the state of `result_ok`.
670 union LDKCResult_PublicKeyErrorZPtr contents;
672 * Whether this CResult_PublicKeyErrorZ represents a success state.
675 } LDKCResult_PublicKeyErrorZ;
680 * The set of public keys which are used in the creation of one commitment transaction.
681 * These are derived from the channel base keys and per-commitment data.
683 * A broadcaster key is provided from potential broadcaster of the computed transaction.
684 * A countersignatory key is coming from a protocol participant unable to broadcast the
687 * These keys are assumed to be good, either because the code derived them from
688 * channel basepoints via the new function, or they were obtained via
689 * CommitmentTransaction.trust().keys() because we trusted the source of the
690 * pre-calculated keys.
692 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
694 * A pointer to the opaque Rust object.
695 * Nearly everywhere, inner must be non-null, however in places where
696 * the Rust equivalent takes an Option, it may be set to null to indicate None.
698 LDKnativeTxCreationKeys *inner;
700 * Indicates that this is the only struct which contains the same pointer.
701 * Rust functions which take ownership of an object provided via an argument require
702 * this to be true and invalidate the object pointed to by inner.
708 * The contents of CResult_TxCreationKeysDecodeErrorZ
710 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
712 * A pointer to the contents in the success state.
713 * Reading from this pointer when `result_ok` is not set is undefined.
715 struct LDKTxCreationKeys *result;
717 * A pointer to the contents in the error state.
718 * Reading from this pointer when `result_ok` is set is undefined.
720 struct LDKDecodeError *err;
721 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
724 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
725 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
726 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
728 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
730 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
731 * `err` or `result` depending on the state of `result_ok`.
733 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
735 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
738 } LDKCResult_TxCreationKeysDecodeErrorZ;
743 * One counterparty's public keys which do not change over the life of a channel.
745 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
747 * A pointer to the opaque Rust object.
748 * Nearly everywhere, inner must be non-null, however in places where
749 * the Rust equivalent takes an Option, it may be set to null to indicate None.
751 LDKnativeChannelPublicKeys *inner;
753 * Indicates that this is the only struct which contains the same pointer.
754 * Rust functions which take ownership of an object provided via an argument require
755 * this to be true and invalidate the object pointed to by inner.
758 } LDKChannelPublicKeys;
761 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
763 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
765 * A pointer to the contents in the success state.
766 * Reading from this pointer when `result_ok` is not set is undefined.
768 struct LDKChannelPublicKeys *result;
770 * A pointer to the contents in the error state.
771 * Reading from this pointer when `result_ok` is set is undefined.
773 struct LDKDecodeError *err;
774 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
777 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
778 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
779 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
781 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
783 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
784 * `err` or `result` depending on the state of `result_ok`.
786 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
788 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
791 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
794 * The contents of CResult_TxCreationKeysErrorZ
796 typedef union LDKCResult_TxCreationKeysErrorZPtr {
798 * A pointer to the contents in the success state.
799 * Reading from this pointer when `result_ok` is not set is undefined.
801 struct LDKTxCreationKeys *result;
803 * A pointer to the contents in the error state.
804 * Reading from this pointer when `result_ok` is set is undefined.
806 enum LDKSecp256k1Error *err;
807 } LDKCResult_TxCreationKeysErrorZPtr;
810 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
811 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
812 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
814 typedef struct LDKCResult_TxCreationKeysErrorZ {
816 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
817 * `err` or `result` depending on the state of `result_ok`.
819 union LDKCResult_TxCreationKeysErrorZPtr contents;
821 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
824 } LDKCResult_TxCreationKeysErrorZ;
827 * An enum which can either contain a u32 or not
829 typedef enum LDKCOption_u32Z_Tag {
831 * When we're in this state, this COption_u32Z contains a u32
833 LDKCOption_u32Z_Some,
835 * When we're in this state, this COption_u32Z contains nothing
837 LDKCOption_u32Z_None,
839 * Must be last for serialization purposes
841 LDKCOption_u32Z_Sentinel,
842 } LDKCOption_u32Z_Tag;
844 typedef struct LDKCOption_u32Z {
845 LDKCOption_u32Z_Tag tag;
856 * Information about an HTLC as it appears in a commitment transaction
858 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
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 LDKnativeHTLCOutputInCommitment *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 } LDKHTLCOutputInCommitment;
874 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
876 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
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 LDKHTLCOutputInCommitment *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_HTLCOutputInCommitmentDecodeErrorZPtr;
890 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
891 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment 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_HTLCOutputInCommitmentDecodeErrorZ {
896 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
897 * `err` or `result` depending on the state of `result_ok`.
899 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
901 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
904 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
909 * Late-bound per-channel counterparty data used to build transactions.
911 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
913 * A pointer to the opaque Rust object.
914 * Nearly everywhere, inner must be non-null, however in places where
915 * the Rust equivalent takes an Option, it may be set to null to indicate None.
917 LDKnativeCounterpartyChannelTransactionParameters *inner;
919 * Indicates that this is the only struct which contains the same pointer.
920 * Rust functions which take ownership of an object provided via an argument require
921 * this to be true and invalidate the object pointed to by inner.
924 } LDKCounterpartyChannelTransactionParameters;
927 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
929 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
931 * A pointer to the contents in the success state.
932 * Reading from this pointer when `result_ok` is not set is undefined.
934 struct LDKCounterpartyChannelTransactionParameters *result;
936 * A pointer to the contents in the error state.
937 * Reading from this pointer when `result_ok` is set is undefined.
939 struct LDKDecodeError *err;
940 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
943 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
944 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
945 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
947 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
949 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
950 * `err` or `result` depending on the state of `result_ok`.
952 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
954 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
957 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
962 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
963 * The fields are organized by holder/counterparty.
965 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
966 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
968 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
970 * A pointer to the opaque Rust object.
971 * Nearly everywhere, inner must be non-null, however in places where
972 * the Rust equivalent takes an Option, it may be set to null to indicate None.
974 LDKnativeChannelTransactionParameters *inner;
976 * Indicates that this is the only struct which contains the same pointer.
977 * Rust functions which take ownership of an object provided via an argument require
978 * this to be true and invalidate the object pointed to by inner.
981 } LDKChannelTransactionParameters;
984 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
986 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
988 * A pointer to the contents in the success state.
989 * Reading from this pointer when `result_ok` is not set is undefined.
991 struct LDKChannelTransactionParameters *result;
993 * A pointer to the contents in the error state.
994 * Reading from this pointer when `result_ok` is set is undefined.
996 struct LDKDecodeError *err;
997 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
1000 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1001 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1002 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1004 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
1006 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
1007 * `err` or `result` depending on the state of `result_ok`.
1009 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
1011 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
1014 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
1017 * Represents a secp256k1 signature serialized as two 32-byte numbers
1019 typedef struct LDKSignature {
1021 * The bytes of the signature in "compact" form
1023 uint8_t compact_form[64];
1027 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
1028 * This corresponds to std::vector in C++
1030 typedef struct LDKCVec_SignatureZ {
1032 * The elements in the array.
1033 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1035 struct LDKSignature *data;
1037 * The number of elements pointed to by `data`.
1040 } LDKCVec_SignatureZ;
1045 * Information needed to build and sign a holder's commitment transaction.
1047 * The transaction is only signed once we are ready to broadcast.
1049 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
1051 * A pointer to the opaque Rust object.
1052 * Nearly everywhere, inner must be non-null, however in places where
1053 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1055 LDKnativeHolderCommitmentTransaction *inner;
1057 * Indicates that this is the only struct which contains the same pointer.
1058 * Rust functions which take ownership of an object provided via an argument require
1059 * this to be true and invalidate the object pointed to by inner.
1062 } LDKHolderCommitmentTransaction;
1065 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
1067 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
1069 * A pointer to the contents in the success state.
1070 * Reading from this pointer when `result_ok` is not set is undefined.
1072 struct LDKHolderCommitmentTransaction *result;
1074 * A pointer to the contents in the error state.
1075 * Reading from this pointer when `result_ok` is set is undefined.
1077 struct LDKDecodeError *err;
1078 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
1081 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1082 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1083 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1085 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
1087 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
1088 * `err` or `result` depending on the state of `result_ok`.
1090 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
1092 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
1095 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
1100 * A pre-built Bitcoin commitment transaction and its txid.
1102 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
1104 * A pointer to the opaque Rust object.
1105 * Nearly everywhere, inner must be non-null, however in places where
1106 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1108 LDKnativeBuiltCommitmentTransaction *inner;
1110 * Indicates that this is the only struct which contains the same pointer.
1111 * Rust functions which take ownership of an object provided via an argument require
1112 * this to be true and invalidate the object pointed to by inner.
1115 } LDKBuiltCommitmentTransaction;
1118 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1120 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
1122 * A pointer to the contents in the success state.
1123 * Reading from this pointer when `result_ok` is not set is undefined.
1125 struct LDKBuiltCommitmentTransaction *result;
1127 * A pointer to the contents in the error state.
1128 * Reading from this pointer when `result_ok` is set is undefined.
1130 struct LDKDecodeError *err;
1131 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1134 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1135 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1136 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1138 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1140 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1141 * `err` or `result` depending on the state of `result_ok`.
1143 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1145 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1148 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1153 * This class tracks the per-transaction information needed to build a commitment transaction and to
1154 * actually build it and sign. It is used for holder transactions that we sign only when needed
1155 * and for transactions we sign for the counterparty.
1157 * This class can be used inside a signer implementation to generate a signature given the relevant
1160 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1162 * A pointer to the opaque Rust object.
1163 * Nearly everywhere, inner must be non-null, however in places where
1164 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1166 LDKnativeCommitmentTransaction *inner;
1168 * Indicates that this is the only struct which contains the same pointer.
1169 * Rust functions which take ownership of an object provided via an argument require
1170 * this to be true and invalidate the object pointed to by inner.
1173 } LDKCommitmentTransaction;
1176 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1178 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1180 * A pointer to the contents in the success state.
1181 * Reading from this pointer when `result_ok` is not set is undefined.
1183 struct LDKCommitmentTransaction *result;
1185 * A pointer to the contents in the error state.
1186 * Reading from this pointer when `result_ok` is set is undefined.
1188 struct LDKDecodeError *err;
1189 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1192 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1193 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1194 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1196 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1198 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1199 * `err` or `result` depending on the state of `result_ok`.
1201 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1203 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1206 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1211 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1212 * transaction and the transaction creation keys) are trusted.
1214 * See trust() and verify() functions on CommitmentTransaction.
1216 * This structure implements Deref.
1218 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1220 * A pointer to the opaque Rust object.
1221 * Nearly everywhere, inner must be non-null, however in places where
1222 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1224 LDKnativeTrustedCommitmentTransaction *inner;
1226 * Indicates that this is the only struct which contains the same pointer.
1227 * Rust functions which take ownership of an object provided via an argument require
1228 * this to be true and invalidate the object pointed to by inner.
1231 } LDKTrustedCommitmentTransaction;
1234 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1236 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1238 * A pointer to the contents in the success state.
1239 * Reading from this pointer when `result_ok` is not set is undefined.
1241 struct LDKTrustedCommitmentTransaction *result;
1243 * Note that this value is always NULL, as there are no contents in the Err variant
1246 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1249 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1250 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1251 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1253 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1255 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1256 * `err` or `result` depending on the state of `result_ok`.
1258 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1260 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1263 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1266 * The contents of CResult_CVec_SignatureZNoneZ
1268 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1270 * A pointer to the contents in the success state.
1271 * Reading from this pointer when `result_ok` is not set is undefined.
1273 struct LDKCVec_SignatureZ *result;
1275 * Note that this value is always NULL, as there are no contents in the Err variant
1278 } LDKCResult_CVec_SignatureZNoneZPtr;
1281 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1282 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1283 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1285 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1287 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1288 * `err` or `result` depending on the state of `result_ok`.
1290 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1292 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1295 } LDKCResult_CVec_SignatureZNoneZ;
1298 * The contents of CResult_SiPrefixNoneZ
1300 typedef union LDKCResult_SiPrefixNoneZPtr {
1302 * A pointer to the contents in the success state.
1303 * Reading from this pointer when `result_ok` is not set is undefined.
1305 enum LDKSiPrefix *result;
1307 * Note that this value is always NULL, as there are no contents in the Err variant
1310 } LDKCResult_SiPrefixNoneZPtr;
1313 * A CResult_SiPrefixNoneZ represents the result of a fallible operation,
1314 * containing a crate::lightning_invoice::SiPrefix on success and a () on failure.
1315 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1317 typedef struct LDKCResult_SiPrefixNoneZ {
1319 * The contents of this CResult_SiPrefixNoneZ, accessible via either
1320 * `err` or `result` depending on the state of `result_ok`.
1322 union LDKCResult_SiPrefixNoneZPtr contents;
1324 * Whether this CResult_SiPrefixNoneZ represents a success state.
1327 } LDKCResult_SiPrefixNoneZ;
1332 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
1334 * There are three ways to construct an `Invoice`:
1335 * 1. using `InvoiceBuilder`
1336 * 2. using `Invoice::from_signed(SignedRawInvoice)`
1337 * 3. using `str::parse::<Invoice>(&str)`
1339 typedef struct MUST_USE_STRUCT LDKInvoice {
1341 * A pointer to the opaque Rust object.
1342 * Nearly everywhere, inner must be non-null, however in places where
1343 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1345 LDKnativeInvoice *inner;
1347 * Indicates that this is the only struct which contains the same pointer.
1348 * Rust functions which take ownership of an object provided via an argument require
1349 * this to be true and invalidate the object pointed to by inner.
1355 * The contents of CResult_InvoiceNoneZ
1357 typedef union LDKCResult_InvoiceNoneZPtr {
1359 * A pointer to the contents in the success state.
1360 * Reading from this pointer when `result_ok` is not set is undefined.
1362 struct LDKInvoice *result;
1364 * Note that this value is always NULL, as there are no contents in the Err variant
1367 } LDKCResult_InvoiceNoneZPtr;
1370 * A CResult_InvoiceNoneZ represents the result of a fallible operation,
1371 * containing a crate::lightning_invoice::Invoice on success and a () on failure.
1372 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1374 typedef struct LDKCResult_InvoiceNoneZ {
1376 * The contents of this CResult_InvoiceNoneZ, accessible via either
1377 * `err` or `result` depending on the state of `result_ok`.
1379 union LDKCResult_InvoiceNoneZPtr contents;
1381 * Whether this CResult_InvoiceNoneZ represents a success state.
1384 } LDKCResult_InvoiceNoneZ;
1389 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
1393 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
1395 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
1397 * A pointer to the opaque Rust object.
1398 * Nearly everywhere, inner must be non-null, however in places where
1399 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1401 LDKnativeSignedRawInvoice *inner;
1403 * Indicates that this is the only struct which contains the same pointer.
1404 * Rust functions which take ownership of an object provided via an argument require
1405 * this to be true and invalidate the object pointed to by inner.
1408 } LDKSignedRawInvoice;
1411 * The contents of CResult_SignedRawInvoiceNoneZ
1413 typedef union LDKCResult_SignedRawInvoiceNoneZPtr {
1415 * A pointer to the contents in the success state.
1416 * Reading from this pointer when `result_ok` is not set is undefined.
1418 struct LDKSignedRawInvoice *result;
1420 * Note that this value is always NULL, as there are no contents in the Err variant
1423 } LDKCResult_SignedRawInvoiceNoneZPtr;
1426 * A CResult_SignedRawInvoiceNoneZ represents the result of a fallible operation,
1427 * containing a crate::lightning_invoice::SignedRawInvoice on success and a () on failure.
1428 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1430 typedef struct LDKCResult_SignedRawInvoiceNoneZ {
1432 * The contents of this CResult_SignedRawInvoiceNoneZ, accessible via either
1433 * `err` or `result` depending on the state of `result_ok`.
1435 union LDKCResult_SignedRawInvoiceNoneZPtr contents;
1437 * Whether this CResult_SignedRawInvoiceNoneZ represents a success state.
1440 } LDKCResult_SignedRawInvoiceNoneZ;
1445 * Represents an syntactically correct Invoice for a payment on the lightning network,
1446 * but without the signature information.
1447 * De- and encoding should not lead to information loss but may lead to different hashes.
1449 * For methods without docs see the corresponding methods in `Invoice`.
1451 typedef struct MUST_USE_STRUCT LDKRawInvoice {
1453 * A pointer to the opaque Rust object.
1454 * Nearly everywhere, inner must be non-null, however in places where
1455 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1457 LDKnativeRawInvoice *inner;
1459 * Indicates that this is the only struct which contains the same pointer.
1460 * Rust functions which take ownership of an object provided via an argument require
1461 * this to be true and invalidate the object pointed to by inner.
1467 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1468 * look up the corresponding function in rust-lightning's docs.
1470 typedef struct LDKThirtyTwoBytes {
1472 * The thirty-two bytes
1475 } LDKThirtyTwoBytes;
1480 * Recoverable signature
1482 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
1484 * A pointer to the opaque Rust object.
1485 * Nearly everywhere, inner must be non-null, however in places where
1486 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1488 LDKnativeInvoiceSignature *inner;
1490 * Indicates that this is the only struct which contains the same pointer.
1491 * Rust functions which take ownership of an object provided via an argument require
1492 * this to be true and invalidate the object pointed to by inner.
1495 } LDKInvoiceSignature;
1498 * A tuple of 3 elements. See the individual fields for the types contained.
1500 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
1502 * The element at position 0
1504 struct LDKRawInvoice a;
1506 * The element at position 1
1508 struct LDKThirtyTwoBytes b;
1510 * The element at position 2
1512 struct LDKInvoiceSignature c;
1513 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
1520 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
1522 * A pointer to the opaque Rust object.
1523 * Nearly everywhere, inner must be non-null, however in places where
1524 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1526 LDKnativePayeePubKey *inner;
1528 * Indicates that this is the only struct which contains the same pointer.
1529 * Rust functions which take ownership of an object provided via an argument require
1530 * this to be true and invalidate the object pointed to by inner.
1536 * The contents of CResult_PayeePubKeyErrorZ
1538 typedef union LDKCResult_PayeePubKeyErrorZPtr {
1540 * A pointer to the contents in the success state.
1541 * Reading from this pointer when `result_ok` is not set is undefined.
1543 struct LDKPayeePubKey *result;
1545 * A pointer to the contents in the error state.
1546 * Reading from this pointer when `result_ok` is set is undefined.
1548 enum LDKSecp256k1Error *err;
1549 } LDKCResult_PayeePubKeyErrorZPtr;
1552 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
1553 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
1554 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1556 typedef struct LDKCResult_PayeePubKeyErrorZ {
1558 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
1559 * `err` or `result` depending on the state of `result_ok`.
1561 union LDKCResult_PayeePubKeyErrorZPtr contents;
1563 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
1566 } LDKCResult_PayeePubKeyErrorZ;
1571 * Private routing information
1574 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
1577 typedef struct MUST_USE_STRUCT LDKRouteHint {
1579 * A pointer to the opaque Rust object.
1580 * Nearly everywhere, inner must be non-null, however in places where
1581 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1583 LDKnativeRouteHint *inner;
1585 * Indicates that this is the only struct which contains the same pointer.
1586 * Rust functions which take ownership of an object provided via an argument require
1587 * this to be true and invalidate the object pointed to by inner.
1593 * A dynamically-allocated array of crate::lightning_invoice::RouteHints of arbitrary size.
1594 * This corresponds to std::vector in C++
1596 typedef struct LDKCVec_RouteHintZ {
1598 * The elements in the array.
1599 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1601 struct LDKRouteHint *data;
1603 * The number of elements pointed to by `data`.
1606 } LDKCVec_RouteHintZ;
1609 * An enum which can either contain a u64 or not
1611 typedef enum LDKCOption_u64Z_Tag {
1613 * When we're in this state, this COption_u64Z contains a u64
1615 LDKCOption_u64Z_Some,
1617 * When we're in this state, this COption_u64Z contains nothing
1619 LDKCOption_u64Z_None,
1621 * Must be last for serialization purposes
1623 LDKCOption_u64Z_Sentinel,
1624 } LDKCOption_u64Z_Tag;
1626 typedef struct LDKCOption_u64Z {
1627 LDKCOption_u64Z_Tag tag;
1638 * A timestamp that refers to a date after 1 January 1970 which means its representation as UNIX
1639 * timestamp is positive.
1642 * The UNIX timestamp representing the stored time has to be positive and small enough so that
1643 * a `EpiryTime` can be added to it without an overflow.
1645 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
1647 * A pointer to the opaque Rust object.
1648 * Nearly everywhere, inner must be non-null, however in places where
1649 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1651 LDKnativePositiveTimestamp *inner;
1653 * Indicates that this is the only struct which contains the same pointer.
1654 * Rust functions which take ownership of an object provided via an argument require
1655 * this to be true and invalidate the object pointed to by inner.
1658 } LDKPositiveTimestamp;
1661 * The contents of CResult_PositiveTimestampCreationErrorZ
1663 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
1665 * A pointer to the contents in the success state.
1666 * Reading from this pointer when `result_ok` is not set is undefined.
1668 struct LDKPositiveTimestamp *result;
1670 * A pointer to the contents in the error state.
1671 * Reading from this pointer when `result_ok` is set is undefined.
1673 enum LDKCreationError *err;
1674 } LDKCResult_PositiveTimestampCreationErrorZPtr;
1677 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
1678 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
1679 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1681 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
1683 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
1684 * `err` or `result` depending on the state of `result_ok`.
1686 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
1688 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
1691 } LDKCResult_PositiveTimestampCreationErrorZ;
1694 * The contents of CResult_NoneSemanticErrorZ
1696 typedef union LDKCResult_NoneSemanticErrorZPtr {
1698 * Note that this value is always NULL, as there are no contents in the OK variant
1702 * A pointer to the contents in the error state.
1703 * Reading from this pointer when `result_ok` is set is undefined.
1705 enum LDKSemanticError *err;
1706 } LDKCResult_NoneSemanticErrorZPtr;
1709 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
1710 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
1711 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1713 typedef struct LDKCResult_NoneSemanticErrorZ {
1715 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
1716 * `err` or `result` depending on the state of `result_ok`.
1718 union LDKCResult_NoneSemanticErrorZPtr contents;
1720 * Whether this CResult_NoneSemanticErrorZ represents a success state.
1723 } LDKCResult_NoneSemanticErrorZ;
1726 * The contents of CResult_InvoiceSemanticErrorZ
1728 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
1730 * A pointer to the contents in the success state.
1731 * Reading from this pointer when `result_ok` is not set is undefined.
1733 struct LDKInvoice *result;
1735 * A pointer to the contents in the error state.
1736 * Reading from this pointer when `result_ok` is set is undefined.
1738 enum LDKSemanticError *err;
1739 } LDKCResult_InvoiceSemanticErrorZPtr;
1742 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
1743 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
1744 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1746 typedef struct LDKCResult_InvoiceSemanticErrorZ {
1748 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
1749 * `err` or `result` depending on the state of `result_ok`.
1751 union LDKCResult_InvoiceSemanticErrorZPtr contents;
1753 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
1756 } LDKCResult_InvoiceSemanticErrorZ;
1761 * Description string
1764 * The description can be at most 639 __bytes__ long
1766 typedef struct MUST_USE_STRUCT LDKDescription {
1768 * A pointer to the opaque Rust object.
1769 * Nearly everywhere, inner must be non-null, however in places where
1770 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1772 LDKnativeDescription *inner;
1774 * Indicates that this is the only struct which contains the same pointer.
1775 * Rust functions which take ownership of an object provided via an argument require
1776 * this to be true and invalidate the object pointed to by inner.
1782 * The contents of CResult_DescriptionCreationErrorZ
1784 typedef union LDKCResult_DescriptionCreationErrorZPtr {
1786 * A pointer to the contents in the success state.
1787 * Reading from this pointer when `result_ok` is not set is undefined.
1789 struct LDKDescription *result;
1791 * A pointer to the contents in the error state.
1792 * Reading from this pointer when `result_ok` is set is undefined.
1794 enum LDKCreationError *err;
1795 } LDKCResult_DescriptionCreationErrorZPtr;
1798 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
1799 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
1800 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1802 typedef struct LDKCResult_DescriptionCreationErrorZ {
1804 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
1805 * `err` or `result` depending on the state of `result_ok`.
1807 union LDKCResult_DescriptionCreationErrorZPtr contents;
1809 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
1812 } LDKCResult_DescriptionCreationErrorZ;
1817 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
1821 * The number of seconds this expiry time represents has to be in the range
1822 * `0...(SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME)` to avoid overflows when adding it to a
1825 typedef struct MUST_USE_STRUCT LDKExpiryTime {
1827 * A pointer to the opaque Rust object.
1828 * Nearly everywhere, inner must be non-null, however in places where
1829 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1831 LDKnativeExpiryTime *inner;
1833 * Indicates that this is the only struct which contains the same pointer.
1834 * Rust functions which take ownership of an object provided via an argument require
1835 * this to be true and invalidate the object pointed to by inner.
1841 * The contents of CResult_ExpiryTimeCreationErrorZ
1843 typedef union LDKCResult_ExpiryTimeCreationErrorZPtr {
1845 * A pointer to the contents in the success state.
1846 * Reading from this pointer when `result_ok` is not set is undefined.
1848 struct LDKExpiryTime *result;
1850 * A pointer to the contents in the error state.
1851 * Reading from this pointer when `result_ok` is set is undefined.
1853 enum LDKCreationError *err;
1854 } LDKCResult_ExpiryTimeCreationErrorZPtr;
1857 * A CResult_ExpiryTimeCreationErrorZ represents the result of a fallible operation,
1858 * containing a crate::lightning_invoice::ExpiryTime on success and a crate::lightning_invoice::CreationError on failure.
1859 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1861 typedef struct LDKCResult_ExpiryTimeCreationErrorZ {
1863 * The contents of this CResult_ExpiryTimeCreationErrorZ, accessible via either
1864 * `err` or `result` depending on the state of `result_ok`.
1866 union LDKCResult_ExpiryTimeCreationErrorZPtr contents;
1868 * Whether this CResult_ExpiryTimeCreationErrorZ represents a success state.
1871 } LDKCResult_ExpiryTimeCreationErrorZ;
1876 * A channel descriptor which provides a last-hop route to get_route
1878 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
1880 * A pointer to the opaque Rust object.
1881 * Nearly everywhere, inner must be non-null, however in places where
1882 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1884 LDKnativeRouteHintHop *inner;
1886 * Indicates that this is the only struct which contains the same pointer.
1887 * Rust functions which take ownership of an object provided via an argument require
1888 * this to be true and invalidate the object pointed to by inner.
1894 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
1895 * This corresponds to std::vector in C++
1897 typedef struct LDKCVec_RouteHintHopZ {
1899 * The elements in the array.
1900 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1902 struct LDKRouteHintHop *data;
1904 * The number of elements pointed to by `data`.
1907 } LDKCVec_RouteHintHopZ;
1910 * The contents of CResult_RouteHintCreationErrorZ
1912 typedef union LDKCResult_RouteHintCreationErrorZPtr {
1914 * A pointer to the contents in the success state.
1915 * Reading from this pointer when `result_ok` is not set is undefined.
1917 struct LDKRouteHint *result;
1919 * A pointer to the contents in the error state.
1920 * Reading from this pointer when `result_ok` is set is undefined.
1922 enum LDKCreationError *err;
1923 } LDKCResult_RouteHintCreationErrorZPtr;
1926 * A CResult_RouteHintCreationErrorZ represents the result of a fallible operation,
1927 * containing a crate::lightning_invoice::RouteHint on success and a crate::lightning_invoice::CreationError on failure.
1928 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1930 typedef struct LDKCResult_RouteHintCreationErrorZ {
1932 * The contents of this CResult_RouteHintCreationErrorZ, accessible via either
1933 * `err` or `result` depending on the state of `result_ok`.
1935 union LDKCResult_RouteHintCreationErrorZPtr contents;
1937 * Whether this CResult_RouteHintCreationErrorZ represents a success state.
1940 } LDKCResult_RouteHintCreationErrorZ;
1943 * The contents of CResult_StringErrorZ
1945 typedef union LDKCResult_StringErrorZPtr {
1947 * A pointer to the contents in the success state.
1948 * Reading from this pointer when `result_ok` is not set is undefined.
1950 struct LDKStr *result;
1952 * A pointer to the contents in the error state.
1953 * Reading from this pointer when `result_ok` is set is undefined.
1955 enum LDKSecp256k1Error *err;
1956 } LDKCResult_StringErrorZPtr;
1959 * A CResult_StringErrorZ represents the result of a fallible operation,
1960 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
1961 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1963 typedef struct LDKCResult_StringErrorZ {
1965 * The contents of this CResult_StringErrorZ, accessible via either
1966 * `err` or `result` depending on the state of `result_ok`.
1968 union LDKCResult_StringErrorZPtr contents;
1970 * Whether this CResult_StringErrorZ represents a success state.
1973 } LDKCResult_StringErrorZ;
1978 * An update generated by the underlying Channel itself which contains some new information the
1979 * ChannelMonitor should be made aware of.
1981 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
1983 * A pointer to the opaque Rust object.
1984 * Nearly everywhere, inner must be non-null, however in places where
1985 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1987 LDKnativeChannelMonitorUpdate *inner;
1989 * Indicates that this is the only struct which contains the same pointer.
1990 * Rust functions which take ownership of an object provided via an argument require
1991 * this to be true and invalidate the object pointed to by inner.
1994 } LDKChannelMonitorUpdate;
1997 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
1999 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
2001 * A pointer to the contents in the success state.
2002 * Reading from this pointer when `result_ok` is not set is undefined.
2004 struct LDKChannelMonitorUpdate *result;
2006 * A pointer to the contents in the error state.
2007 * Reading from this pointer when `result_ok` is set is undefined.
2009 struct LDKDecodeError *err;
2010 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
2013 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
2014 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
2015 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2017 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
2019 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
2020 * `err` or `result` depending on the state of `result_ok`.
2022 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
2024 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
2027 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
2032 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
2033 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
2034 * preimage claim backward will lead to loss of funds.
2036 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
2038 * A pointer to the opaque Rust object.
2039 * Nearly everywhere, inner must be non-null, however in places where
2040 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2042 LDKnativeHTLCUpdate *inner;
2044 * Indicates that this is the only struct which contains the same pointer.
2045 * Rust functions which take ownership of an object provided via an argument require
2046 * this to be true and invalidate the object pointed to by inner.
2052 * The contents of CResult_HTLCUpdateDecodeErrorZ
2054 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
2056 * A pointer to the contents in the success state.
2057 * Reading from this pointer when `result_ok` is not set is undefined.
2059 struct LDKHTLCUpdate *result;
2061 * A pointer to the contents in the error state.
2062 * Reading from this pointer when `result_ok` is set is undefined.
2064 struct LDKDecodeError *err;
2065 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
2068 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
2069 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
2070 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2072 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
2074 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
2075 * `err` or `result` depending on the state of `result_ok`.
2077 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
2079 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
2082 } LDKCResult_HTLCUpdateDecodeErrorZ;
2087 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
2088 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
2089 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
2091 * Contains a developer-readable error message.
2093 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
2095 * A pointer to the opaque Rust object.
2096 * Nearly everywhere, inner must be non-null, however in places where
2097 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2099 LDKnativeMonitorUpdateError *inner;
2101 * Indicates that this is the only struct which contains the same pointer.
2102 * Rust functions which take ownership of an object provided via an argument require
2103 * this to be true and invalidate the object pointed to by inner.
2106 } LDKMonitorUpdateError;
2109 * The contents of CResult_NoneMonitorUpdateErrorZ
2111 typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
2113 * Note that this value is always NULL, as there are no contents in the OK variant
2117 * A pointer to the contents in the error state.
2118 * Reading from this pointer when `result_ok` is set is undefined.
2120 struct LDKMonitorUpdateError *err;
2121 } LDKCResult_NoneMonitorUpdateErrorZPtr;
2124 * A CResult_NoneMonitorUpdateErrorZ represents the result of a fallible operation,
2125 * containing a () on success and a crate::lightning::chain::channelmonitor::MonitorUpdateError on failure.
2126 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2128 typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
2130 * The contents of this CResult_NoneMonitorUpdateErrorZ, accessible via either
2131 * `err` or `result` depending on the state of `result_ok`.
2133 union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
2135 * Whether this CResult_NoneMonitorUpdateErrorZ represents a success state.
2138 } LDKCResult_NoneMonitorUpdateErrorZ;
2141 * A tuple of 2 elements. See the individual fields for the types contained.
2143 typedef struct LDKC2Tuple_OutPointScriptZ {
2145 * The element at position 0
2147 struct LDKOutPoint a;
2149 * The element at position 1
2151 struct LDKCVec_u8Z b;
2152 } LDKC2Tuple_OutPointScriptZ;
2155 * A tuple of 2 elements. See the individual fields for the types contained.
2157 typedef struct LDKC2Tuple_u32ScriptZ {
2159 * The element at position 0
2163 * The element at position 1
2165 struct LDKCVec_u8Z b;
2166 } LDKC2Tuple_u32ScriptZ;
2169 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
2170 * This corresponds to std::vector in C++
2172 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
2174 * The elements in the array.
2175 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2177 struct LDKC2Tuple_u32ScriptZ *data;
2179 * The number of elements pointed to by `data`.
2182 } LDKCVec_C2Tuple_u32ScriptZZ;
2185 * A tuple of 2 elements. See the individual fields for the types contained.
2187 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
2189 * The element at position 0
2191 struct LDKThirtyTwoBytes a;
2193 * The element at position 1
2195 struct LDKCVec_C2Tuple_u32ScriptZZ b;
2196 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
2199 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
2200 * This corresponds to std::vector in C++
2202 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
2204 * The elements in the array.
2205 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2207 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
2209 * The number of elements pointed to by `data`.
2212 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
2215 * An event to be processed by the ChannelManager.
2217 typedef enum LDKMonitorEvent_Tag {
2219 * A monitor event containing an HTLCUpdate.
2221 LDKMonitorEvent_HTLCEvent,
2223 * A monitor event that the Channel's commitment transaction was broadcasted.
2225 LDKMonitorEvent_CommitmentTxBroadcasted,
2227 * Must be last for serialization purposes
2229 LDKMonitorEvent_Sentinel,
2230 } LDKMonitorEvent_Tag;
2232 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
2233 LDKMonitorEvent_Tag tag;
2236 struct LDKHTLCUpdate htlc_event;
2239 struct LDKOutPoint commitment_tx_broadcasted;
2245 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
2246 * This corresponds to std::vector in C++
2248 typedef struct LDKCVec_MonitorEventZ {
2250 * The elements in the array.
2251 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2253 struct LDKMonitorEvent *data;
2255 * The number of elements pointed to by `data`.
2258 } LDKCVec_MonitorEventZ;
2263 * Information about a spendable output to a P2WSH script. See
2264 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
2266 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2268 * A pointer to the opaque Rust object.
2269 * Nearly everywhere, inner must be non-null, however in places where
2270 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2272 LDKnativeDelayedPaymentOutputDescriptor *inner;
2274 * Indicates that this is the only struct which contains the same pointer.
2275 * Rust functions which take ownership of an object provided via an argument require
2276 * this to be true and invalidate the object pointed to by inner.
2279 } LDKDelayedPaymentOutputDescriptor;
2284 * Information about a spendable output to our \"payment key\". See
2285 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
2287 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2289 * A pointer to the opaque Rust object.
2290 * Nearly everywhere, inner must be non-null, however in places where
2291 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2293 LDKnativeStaticPaymentOutputDescriptor *inner;
2295 * Indicates that this is the only struct which contains the same pointer.
2296 * Rust functions which take ownership of an object provided via an argument require
2297 * this to be true and invalidate the object pointed to by inner.
2300 } LDKStaticPaymentOutputDescriptor;
2303 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
2304 * claim at any point in the future) an event is generated which you must track and be able to
2305 * spend on-chain. The information needed to do this is provided in this enum, including the
2306 * outpoint describing which txid and output index is available, the full output which exists at
2307 * that txid/index, and any keys or other information required to sign.
2309 typedef enum LDKSpendableOutputDescriptor_Tag {
2311 * An output to a script which was provided via KeysInterface directly, either from
2312 * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
2313 * spend it. No secret keys are provided as rust-lightning was never given any key.
2314 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2315 * on-chain using the payment preimage or after it has timed out.
2317 LDKSpendableOutputDescriptor_StaticOutput,
2319 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
2321 * The witness in the spending input should be:
2322 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2324 * Note that the nSequence field in the spending input must be set to to_self_delay
2325 * (which means the transaction is not broadcastable until at least to_self_delay
2326 * blocks after the outpoint confirms).
2328 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2329 * it is an output from an old state which we broadcast (which should never happen).
2331 * To derive the delayed_payment key which is used to sign for this input, you must pass the
2332 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
2333 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
2334 * chan_utils::derive_private_key. The public key can be generated without the secret key
2335 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
2338 * To derive the revocation_pubkey provided here (which is used in the witness
2339 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
2340 * call to Sign::ready_channel) and the provided per_commitment point
2341 * to chan_utils::derive_public_revocation_key.
2343 * The witness script which is hashed and included in the output script_pubkey may be
2344 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
2345 * (derived as above), and the to_self_delay contained here to
2346 * chan_utils::get_revokeable_redeemscript.
2348 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2350 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
2351 * corresponds to the public key in Sign::pubkeys().payment_point).
2352 * The witness in the spending input, is, thus, simply:
2353 * <BIP 143 signature> <payment key>
2355 * These are generally the result of our counterparty having broadcast the current state,
2356 * allowing us to claim the non-HTLC-encumbered outputs immediately.
2358 LDKSpendableOutputDescriptor_StaticPaymentOutput,
2360 * Must be last for serialization purposes
2362 LDKSpendableOutputDescriptor_Sentinel,
2363 } LDKSpendableOutputDescriptor_Tag;
2365 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2367 * The outpoint which is spendable
2369 struct LDKOutPoint outpoint;
2371 * The output which is referenced by the given outpoint.
2373 struct LDKTxOut output;
2374 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2376 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2377 LDKSpendableOutputDescriptor_Tag tag;
2379 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2381 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2384 struct LDKStaticPaymentOutputDescriptor static_payment_output;
2387 } LDKSpendableOutputDescriptor;
2390 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
2391 * This corresponds to std::vector in C++
2393 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2395 * The elements in the array.
2396 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2398 struct LDKSpendableOutputDescriptor *data;
2400 * The number of elements pointed to by `data`.
2403 } LDKCVec_SpendableOutputDescriptorZ;
2406 * An Event which you should probably take some action in response to.
2408 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
2409 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
2410 * written as it makes no sense to respond to it after reconnecting to peers).
2412 typedef enum LDKEvent_Tag {
2414 * Used to indicate that the client should generate a funding transaction with the given
2415 * parameters and then call ChannelManager::funding_transaction_generated.
2416 * Generated in ChannelManager message handling.
2417 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
2418 * counterparty can steal your funds!
2420 LDKEvent_FundingGenerationReady,
2422 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
2423 * ChannelManager::claim_funds to get it....
2424 * Note that if the preimage is not known or the amount paid is incorrect, you should call
2425 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
2426 * network congestion.
2427 * The amount paid should be considered 'incorrect' when it is less than or more than twice
2428 * the amount expected.
2429 * If you fail to call either ChannelManager::claim_funds or
2430 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
2431 * automatically failed.
2433 LDKEvent_PaymentReceived,
2435 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
2436 * and we got back the payment preimage for it).
2438 LDKEvent_PaymentSent,
2440 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
2441 * something. You may wish to retry with a different route.
2443 LDKEvent_PaymentFailed,
2445 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
2446 * time in the future.
2448 LDKEvent_PendingHTLCsForwardable,
2450 * Used to indicate that an output was generated on-chain which you should know how to spend.
2451 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
2452 * counterparty spending them due to some kind of timeout. Thus, you need to store them
2453 * somewhere and spend them when you create on-chain transactions.
2455 LDKEvent_SpendableOutputs,
2457 * Must be last for serialization purposes
2462 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
2464 * The random channel_id we picked which you'll need to pass into
2465 * ChannelManager::funding_transaction_generated.
2467 struct LDKThirtyTwoBytes temporary_channel_id;
2469 * The value, in satoshis, that the output should have.
2471 uint64_t channel_value_satoshis;
2473 * The script which should be used in the transaction output.
2475 struct LDKCVec_u8Z output_script;
2477 * The value passed in to ChannelManager::create_channel
2479 uint64_t user_channel_id;
2480 } LDKEvent_LDKFundingGenerationReady_Body;
2482 typedef struct LDKEvent_LDKPaymentReceived_Body {
2484 * The hash for which the preimage should be handed to the ChannelManager.
2486 struct LDKThirtyTwoBytes payment_hash;
2488 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
2489 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
2490 * [`ChannelManager::claim_funds`].
2492 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2493 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2495 struct LDKThirtyTwoBytes payment_preimage;
2497 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
2498 * number of deanonymization attacks during the routing process.
2499 * It is provided here for your reference, however its accuracy is enforced directly by
2500 * [`ChannelManager`] using the values you previously provided to
2501 * [`ChannelManager::create_inbound_payment`] or
2502 * [`ChannelManager::create_inbound_payment_for_hash`].
2504 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2505 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2506 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2508 struct LDKThirtyTwoBytes payment_secret;
2510 * The value, in thousandths of a satoshi, that this payment is for. Note that you must
2511 * compare this to the expected value before accepting the payment (as otherwise you are
2512 * providing proof-of-payment for less than the value you expected!).
2516 * This is the `user_payment_id` which was provided to
2517 * [`ChannelManager::create_inbound_payment_for_hash`] or
2518 * [`ChannelManager::create_inbound_payment`]. It has no meaning inside of LDK and is
2519 * simply copied here. It may be used to correlate PaymentReceived events with invoice
2520 * metadata stored elsewhere.
2522 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2523 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2525 uint64_t user_payment_id;
2526 } LDKEvent_LDKPaymentReceived_Body;
2528 typedef struct LDKEvent_LDKPaymentSent_Body {
2530 * The preimage to the hash given to ChannelManager::send_payment.
2531 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
2534 struct LDKThirtyTwoBytes payment_preimage;
2535 } LDKEvent_LDKPaymentSent_Body;
2537 typedef struct LDKEvent_LDKPaymentFailed_Body {
2539 * The hash which was given to ChannelManager::send_payment.
2541 struct LDKThirtyTwoBytes payment_hash;
2543 * Indicates the payment was rejected for some reason by the recipient. This implies that
2544 * the payment has failed, not just the route in question. If this is not set, you may
2545 * retry the payment via a different route.
2547 bool rejected_by_dest;
2548 } LDKEvent_LDKPaymentFailed_Body;
2550 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
2552 * The minimum amount of time that should be waited prior to calling
2553 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
2554 * you should wait a random amount of time in roughly the range (now + time_forwardable,
2555 * now + 5*time_forwardable).
2557 uint64_t time_forwardable;
2558 } LDKEvent_LDKPendingHTLCsForwardable_Body;
2560 typedef struct LDKEvent_LDKSpendableOutputs_Body {
2562 * The outputs which you should store as spendable by you.
2564 struct LDKCVec_SpendableOutputDescriptorZ outputs;
2565 } LDKEvent_LDKSpendableOutputs_Body;
2567 typedef struct MUST_USE_STRUCT LDKEvent {
2570 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
2571 LDKEvent_LDKPaymentReceived_Body payment_received;
2572 LDKEvent_LDKPaymentSent_Body payment_sent;
2573 LDKEvent_LDKPaymentFailed_Body payment_failed;
2574 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
2575 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
2580 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
2581 * This corresponds to std::vector in C++
2583 typedef struct LDKCVec_EventZ {
2585 * The elements in the array.
2586 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2588 struct LDKEvent *data;
2590 * The number of elements pointed to by `data`.
2596 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
2597 * This corresponds to std::vector in C++
2599 typedef struct LDKCVec_TransactionZ {
2601 * The elements in the array.
2602 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2604 struct LDKTransaction *data;
2606 * The number of elements pointed to by `data`.
2609 } LDKCVec_TransactionZ;
2612 * A tuple of 2 elements. See the individual fields for the types contained.
2614 typedef struct LDKC2Tuple_usizeTransactionZ {
2616 * The element at position 0
2620 * The element at position 1
2622 struct LDKTransaction b;
2623 } LDKC2Tuple_usizeTransactionZ;
2626 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
2627 * This corresponds to std::vector in C++
2629 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
2631 * The elements in the array.
2632 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2634 struct LDKC2Tuple_usizeTransactionZ *data;
2636 * The number of elements pointed to by `data`.
2639 } LDKCVec_C2Tuple_usizeTransactionZZ;
2642 * A tuple of 2 elements. See the individual fields for the types contained.
2644 typedef struct LDKC2Tuple_u32TxOutZ {
2646 * The element at position 0
2650 * The element at position 1
2653 } LDKC2Tuple_u32TxOutZ;
2656 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
2657 * This corresponds to std::vector in C++
2659 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
2661 * The elements in the array.
2662 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2664 struct LDKC2Tuple_u32TxOutZ *data;
2666 * The number of elements pointed to by `data`.
2669 } LDKCVec_C2Tuple_u32TxOutZZ;
2672 * A tuple of 2 elements. See the individual fields for the types contained.
2674 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
2676 * The element at position 0
2678 struct LDKThirtyTwoBytes a;
2680 * The element at position 1
2682 struct LDKCVec_C2Tuple_u32TxOutZZ b;
2683 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
2686 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
2687 * This corresponds to std::vector in C++
2689 typedef struct LDKCVec_TransactionOutputsZ {
2691 * The elements in the array.
2692 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2694 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
2696 * The number of elements pointed to by `data`.
2699 } LDKCVec_TransactionOutputsZ;
2702 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
2703 * This corresponds to std::vector in C++
2705 typedef struct LDKCVec_TxidZ {
2707 * The elements in the array.
2708 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2710 struct LDKThirtyTwoBytes *data;
2712 * The number of elements pointed to by `data`.
2718 * The contents of CResult_NoneChannelMonitorUpdateErrZ
2720 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
2722 * Note that this value is always NULL, as there are no contents in the OK variant
2726 * A pointer to the contents in the error state.
2727 * Reading from this pointer when `result_ok` is set is undefined.
2729 enum LDKChannelMonitorUpdateErr *err;
2730 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
2733 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
2734 * containing a () on success and a crate::lightning::chain::channelmonitor::ChannelMonitorUpdateErr on failure.
2735 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2737 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
2739 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
2740 * `err` or `result` depending on the state of `result_ok`.
2742 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
2744 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
2747 } LDKCResult_NoneChannelMonitorUpdateErrZ;
2750 * A tuple of 2 elements. See the individual fields for the types contained.
2752 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
2754 * The element at position 0
2756 struct LDKSignature a;
2758 * The element at position 1
2760 struct LDKCVec_SignatureZ b;
2761 } LDKC2Tuple_SignatureCVec_SignatureZZ;
2764 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
2766 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
2768 * A pointer to the contents in the success state.
2769 * Reading from this pointer when `result_ok` is not set is undefined.
2771 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
2773 * Note that this value is always NULL, as there are no contents in the Err variant
2776 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
2779 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
2780 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
2781 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2783 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
2785 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
2786 * `err` or `result` depending on the state of `result_ok`.
2788 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
2790 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
2793 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
2796 * The contents of CResult_SignatureNoneZ
2798 typedef union LDKCResult_SignatureNoneZPtr {
2800 * A pointer to the contents in the success state.
2801 * Reading from this pointer when `result_ok` is not set is undefined.
2803 struct LDKSignature *result;
2805 * Note that this value is always NULL, as there are no contents in the Err variant
2808 } LDKCResult_SignatureNoneZPtr;
2811 * A CResult_SignatureNoneZ represents the result of a fallible operation,
2812 * containing a crate::c_types::Signature on success and a () on failure.
2813 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2815 typedef struct LDKCResult_SignatureNoneZ {
2817 * The contents of this CResult_SignatureNoneZ, accessible via either
2818 * `err` or `result` depending on the state of `result_ok`.
2820 union LDKCResult_SignatureNoneZPtr contents;
2822 * Whether this CResult_SignatureNoneZ represents a success state.
2825 } LDKCResult_SignatureNoneZ;
2830 * The unsigned part of a channel_announcement
2832 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
2834 * A pointer to the opaque Rust object.
2835 * Nearly everywhere, inner must be non-null, however in places where
2836 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2838 LDKnativeUnsignedChannelAnnouncement *inner;
2840 * Indicates that this is the only struct which contains the same pointer.
2841 * Rust functions which take ownership of an object provided via an argument require
2842 * this to be true and invalidate the object pointed to by inner.
2845 } LDKUnsignedChannelAnnouncement;
2848 * A trait to sign lightning channel transactions as described in BOLT 3.
2850 * Signing services could be implemented on a hardware wallet. In this case,
2851 * the current Sign would be a front-end on top of a communication
2852 * channel connected to your secure device and lightning key material wouldn't
2853 * reside on a hot server. Nevertheless, a this deployment would still need
2854 * to trust the ChannelManager to avoid loss of funds as this latest component
2855 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
2857 * A more secure iteration would be to use hashlock (or payment points) to pair
2858 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
2859 * at the price of more state and computation on the hardware wallet side. In the future,
2860 * we are looking forward to design such interface.
2862 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
2863 * to act, as liveness and breach reply correctness are always going to be hard requirements
2864 * of LN security model, orthogonal of key management issues.
2866 typedef struct LDKBaseSign {
2868 * An opaque pointer which is passed to your function implementations as an argument.
2869 * This has no meaning in the LDK, and can be NULL or any other value.
2873 * Gets the per-commitment point for a specific commitment number
2875 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2877 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
2879 * Gets the commitment secret for a specific commitment number as part of the revocation process
2881 * An external signer implementation should error here if the commitment was already signed
2882 * and should refuse to sign it in the future.
2884 * May be called more than once for the same index.
2886 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2888 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
2890 * Gets the holder's channel public keys and basepoints
2892 struct LDKChannelPublicKeys pubkeys;
2894 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
2895 * Note that this takes a pointer to this object, not the this_ptr like other methods do
2896 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
2898 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
2900 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
2901 * some SpendableOutputDescriptor types. This should be sufficient to identify this
2902 * Sign object uniquely and lookup or re-derive its keys.
2904 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
2906 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
2908 * Note that if signing fails or is rejected, the channel will be force-closed.
2910 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
2912 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
2913 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
2914 * latest commitment_tx when we initiate a force-close.
2915 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
2916 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
2918 * This may be called multiple times for the same transaction.
2920 * An external signer implementation should check that the commitment has not been revoked.
2922 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
2924 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
2926 * Create a signature for the given input in a transaction spending an HTLC transaction output
2927 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
2929 * A justice transaction may claim multiple outputs at the same time if timelocks are
2930 * similar, but only a signature for the input at index `input` should be signed for here.
2931 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2932 * to an upcoming timelock expiration.
2934 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2936 * per_commitment_key is revocation secret which was provided by our counterparty when they
2937 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2938 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
2941 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]);
2943 * Create a signature for the given input in a transaction spending a commitment transaction
2944 * HTLC output when our counterparty broadcasts an old state.
2946 * A justice transaction may claim multiple outputs at the same time if timelocks are
2947 * similar, but only a signature for the input at index `input` should be signed for here.
2948 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2949 * to an upcoming timelock expiration.
2951 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2953 * per_commitment_key is revocation secret which was provided by our counterparty when they
2954 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2955 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
2958 * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
2959 * (which is committed to in the BIP 143 signatures).
2961 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);
2963 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
2964 * transaction, either offered or received.
2966 * Such a transaction may claim multiples offered outputs at same time if we know the
2967 * preimage for each when we create it, but only the input at index `input` should be
2968 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
2969 * needed with regards to an upcoming timelock expiration.
2971 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
2974 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2976 * Per_commitment_point is the dynamic point corresponding to the channel state
2977 * detected onchain. It has been generated by our counterparty and is used to derive
2978 * channel state keys, which are then included in the witness script and committed to in the
2979 * BIP 143 signature.
2981 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);
2983 * Create a signature for a (proposed) closing transaction.
2985 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
2986 * chosen to forgo their output as dust.
2988 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
2990 * Signs a channel announcement message with our funding key, proving it comes from one
2991 * of the channel participants.
2993 * Note that if this fails or is rejected, the channel will not be publicly announced and
2994 * our counterparty may (though likely will not) close the channel on us for violating the
2997 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
2999 * Set the counterparty static channel data, including basepoints,
3000 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
3001 * This is done as soon as the funding outpoint is known. Since these are static channel data,
3002 * they MUST NOT be allowed to change to different values once set.
3004 * channel_parameters.is_populated() MUST be true.
3006 * We bind holder_selected_contest_delay late here for API convenience.
3008 * Will be called before any signatures are applied.
3010 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
3012 * Frees any resources associated with this object given its this_arg pointer.
3013 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3015 void (*free)(void *this_arg);
3019 * A cloneable signer.
3021 * Although we require signers to be cloneable, it may be useful for developers to be able to use
3022 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
3023 * which implies Sized, into this derived trait.
3025 typedef struct LDKSign {
3027 * An opaque pointer which is passed to your function implementations as an argument.
3028 * This has no meaning in the LDK, and can be NULL or any other value.
3032 * Implementation of BaseSign for this object.
3034 struct LDKBaseSign BaseSign;
3036 * Creates a copy of the BaseSign, for a copy of this Sign.
3037 * Because BaseSign doesn't natively support copying itself, you have to provide a full copy implementation here.
3039 struct LDKBaseSign (*BaseSign_clone)(const struct LDKBaseSign *NONNULL_PTR orig_BaseSign);
3041 * Serialize the object into a byte array
3043 struct LDKCVec_u8Z (*write)(const void *this_arg);
3045 * Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
3046 * Note that the ultimate copy of the Sign will have all function pointers the same as the original.
3047 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
3049 void *(*clone)(const void *this_arg);
3051 * Frees any resources associated with this object given its this_arg pointer.
3052 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3054 void (*free)(void *this_arg);
3060 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
3061 * on-chain transactions to ensure no loss of funds occurs.
3063 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
3064 * information and are actively monitoring the chain.
3066 * Pending Events or updated HTLCs which have not yet been read out by
3067 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
3068 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
3069 * gotten are fully handled before re-serializing the new state.
3071 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
3072 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
3073 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
3074 * returned block hash and the the current chain and then reconnecting blocks to get to the
3075 * best chain) upon deserializing the object!
3077 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
3079 * A pointer to the opaque Rust object.
3080 * Nearly everywhere, inner must be non-null, however in places where
3081 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3083 LDKnativeChannelMonitor *inner;
3085 * Indicates that this is the only struct which contains the same pointer.
3086 * Rust functions which take ownership of an object provided via an argument require
3087 * this to be true and invalidate the object pointed to by inner.
3090 } LDKChannelMonitor;
3093 * A tuple of 2 elements. See the individual fields for the types contained.
3095 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
3097 * The element at position 0
3099 struct LDKThirtyTwoBytes a;
3101 * The element at position 1
3103 struct LDKChannelMonitor b;
3104 } LDKC2Tuple_BlockHashChannelMonitorZ;
3107 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
3109 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
3111 * A pointer to the contents in the success state.
3112 * Reading from this pointer when `result_ok` is not set is undefined.
3114 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
3116 * A pointer to the contents in the error state.
3117 * Reading from this pointer when `result_ok` is set is undefined.
3119 struct LDKDecodeError *err;
3120 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
3123 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
3124 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
3125 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3127 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3129 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
3130 * `err` or `result` depending on the state of `result_ok`.
3132 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
3134 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
3137 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
3144 typedef struct MUST_USE_STRUCT LDKRouteHop {
3146 * A pointer to the opaque Rust object.
3147 * Nearly everywhere, inner must be non-null, however in places where
3148 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3150 LDKnativeRouteHop *inner;
3152 * Indicates that this is the only struct which contains the same pointer.
3153 * Rust functions which take ownership of an object provided via an argument require
3154 * this to be true and invalidate the object pointed to by inner.
3160 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
3161 * This corresponds to std::vector in C++
3163 typedef struct LDKCVec_RouteHopZ {
3165 * The elements in the array.
3166 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3168 struct LDKRouteHop *data;
3170 * The number of elements pointed to by `data`.
3173 } LDKCVec_RouteHopZ;
3176 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
3177 * This corresponds to std::vector in C++
3179 typedef struct LDKCVec_CVec_RouteHopZZ {
3181 * The elements in the array.
3182 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3184 struct LDKCVec_RouteHopZ *data;
3186 * The number of elements pointed to by `data`.
3189 } LDKCVec_CVec_RouteHopZZ;
3194 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
3195 * it can take multiple paths. Each path is composed of one or more hops through the network.
3197 typedef struct MUST_USE_STRUCT LDKRoute {
3199 * A pointer to the opaque Rust object.
3200 * Nearly everywhere, inner must be non-null, however in places where
3201 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3203 LDKnativeRoute *inner;
3205 * Indicates that this is the only struct which contains the same pointer.
3206 * Rust functions which take ownership of an object provided via an argument require
3207 * this to be true and invalidate the object pointed to by inner.
3213 * The contents of CResult_RouteDecodeErrorZ
3215 typedef union LDKCResult_RouteDecodeErrorZPtr {
3217 * A pointer to the contents in the success state.
3218 * Reading from this pointer when `result_ok` is not set is undefined.
3220 struct LDKRoute *result;
3222 * A pointer to the contents in the error state.
3223 * Reading from this pointer when `result_ok` is set is undefined.
3225 struct LDKDecodeError *err;
3226 } LDKCResult_RouteDecodeErrorZPtr;
3229 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
3230 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
3231 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3233 typedef struct LDKCResult_RouteDecodeErrorZ {
3235 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
3236 * `err` or `result` depending on the state of `result_ok`.
3238 union LDKCResult_RouteDecodeErrorZPtr contents;
3240 * Whether this CResult_RouteDecodeErrorZ represents a success state.
3243 } LDKCResult_RouteDecodeErrorZ;
3248 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
3250 typedef struct MUST_USE_STRUCT LDKChannelDetails {
3252 * A pointer to the opaque Rust object.
3253 * Nearly everywhere, inner must be non-null, however in places where
3254 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3256 LDKnativeChannelDetails *inner;
3258 * Indicates that this is the only struct which contains the same pointer.
3259 * Rust functions which take ownership of an object provided via an argument require
3260 * this to be true and invalidate the object pointed to by inner.
3263 } LDKChannelDetails;
3266 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
3267 * This corresponds to std::vector in C++
3269 typedef struct LDKCVec_ChannelDetailsZ {
3271 * The elements in the array.
3272 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3274 struct LDKChannelDetails *data;
3276 * The number of elements pointed to by `data`.
3279 } LDKCVec_ChannelDetailsZ;
3284 * An Err type for failure to process messages.
3286 typedef struct MUST_USE_STRUCT LDKLightningError {
3288 * A pointer to the opaque Rust object.
3289 * Nearly everywhere, inner must be non-null, however in places where
3290 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3292 LDKnativeLightningError *inner;
3294 * Indicates that this is the only struct which contains the same pointer.
3295 * Rust functions which take ownership of an object provided via an argument require
3296 * this to be true and invalidate the object pointed to by inner.
3299 } LDKLightningError;
3302 * The contents of CResult_RouteLightningErrorZ
3304 typedef union LDKCResult_RouteLightningErrorZPtr {
3306 * A pointer to the contents in the success state.
3307 * Reading from this pointer when `result_ok` is not set is undefined.
3309 struct LDKRoute *result;
3311 * A pointer to the contents in the error state.
3312 * Reading from this pointer when `result_ok` is set is undefined.
3314 struct LDKLightningError *err;
3315 } LDKCResult_RouteLightningErrorZPtr;
3318 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
3319 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
3320 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3322 typedef struct LDKCResult_RouteLightningErrorZ {
3324 * The contents of this CResult_RouteLightningErrorZ, accessible via either
3325 * `err` or `result` depending on the state of `result_ok`.
3327 union LDKCResult_RouteLightningErrorZPtr contents;
3329 * Whether this CResult_RouteLightningErrorZ represents a success state.
3332 } LDKCResult_RouteLightningErrorZ;
3337 * An accept_channel message to be sent or received from a peer
3339 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
3341 * A pointer to the opaque Rust object.
3342 * Nearly everywhere, inner must be non-null, however in places where
3343 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3345 LDKnativeAcceptChannel *inner;
3347 * Indicates that this is the only struct which contains the same pointer.
3348 * Rust functions which take ownership of an object provided via an argument require
3349 * this to be true and invalidate the object pointed to by inner.
3357 * An open_channel message to be sent or received from a peer
3359 typedef struct MUST_USE_STRUCT LDKOpenChannel {
3361 * A pointer to the opaque Rust object.
3362 * Nearly everywhere, inner must be non-null, however in places where
3363 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3365 LDKnativeOpenChannel *inner;
3367 * Indicates that this is the only struct which contains the same pointer.
3368 * Rust functions which take ownership of an object provided via an argument require
3369 * this to be true and invalidate the object pointed to by inner.
3377 * A funding_created message to be sent or received from a peer
3379 typedef struct MUST_USE_STRUCT LDKFundingCreated {
3381 * A pointer to the opaque Rust object.
3382 * Nearly everywhere, inner must be non-null, however in places where
3383 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3385 LDKnativeFundingCreated *inner;
3387 * Indicates that this is the only struct which contains the same pointer.
3388 * Rust functions which take ownership of an object provided via an argument require
3389 * this to be true and invalidate the object pointed to by inner.
3392 } LDKFundingCreated;
3397 * A funding_signed message to be sent or received from a peer
3399 typedef struct MUST_USE_STRUCT LDKFundingSigned {
3401 * A pointer to the opaque Rust object.
3402 * Nearly everywhere, inner must be non-null, however in places where
3403 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3405 LDKnativeFundingSigned *inner;
3407 * Indicates that this is the only struct which contains the same pointer.
3408 * Rust functions which take ownership of an object provided via an argument require
3409 * this to be true and invalidate the object pointed to by inner.
3417 * A funding_locked message to be sent or received from a peer
3419 typedef struct MUST_USE_STRUCT LDKFundingLocked {
3421 * A pointer to the opaque Rust object.
3422 * Nearly everywhere, inner must be non-null, however in places where
3423 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3425 LDKnativeFundingLocked *inner;
3427 * Indicates that this is the only struct which contains the same pointer.
3428 * Rust functions which take ownership of an object provided via an argument require
3429 * this to be true and invalidate the object pointed to by inner.
3437 * An announcement_signatures message to be sent or received from a peer
3439 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
3441 * A pointer to the opaque Rust object.
3442 * Nearly everywhere, inner must be non-null, however in places where
3443 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3445 LDKnativeAnnouncementSignatures *inner;
3447 * Indicates that this is the only struct which contains the same pointer.
3448 * Rust functions which take ownership of an object provided via an argument require
3449 * this to be true and invalidate the object pointed to by inner.
3452 } LDKAnnouncementSignatures;
3457 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
3458 * transaction updates if they were pending.
3460 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
3462 * A pointer to the opaque Rust object.
3463 * Nearly everywhere, inner must be non-null, however in places where
3464 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3466 LDKnativeCommitmentUpdate *inner;
3468 * Indicates that this is the only struct which contains the same pointer.
3469 * Rust functions which take ownership of an object provided via an argument require
3470 * this to be true and invalidate the object pointed to by inner.
3473 } LDKCommitmentUpdate;
3478 * A revoke_and_ack message to be sent or received from a peer
3480 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
3482 * A pointer to the opaque Rust object.
3483 * Nearly everywhere, inner must be non-null, however in places where
3484 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3486 LDKnativeRevokeAndACK *inner;
3488 * Indicates that this is the only struct which contains the same pointer.
3489 * Rust functions which take ownership of an object provided via an argument require
3490 * this to be true and invalidate the object pointed to by inner.
3498 * A closing_signed message to be sent or received from a peer
3500 typedef struct MUST_USE_STRUCT LDKClosingSigned {
3502 * A pointer to the opaque Rust object.
3503 * Nearly everywhere, inner must be non-null, however in places where
3504 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3506 LDKnativeClosingSigned *inner;
3508 * Indicates that this is the only struct which contains the same pointer.
3509 * Rust functions which take ownership of an object provided via an argument require
3510 * this to be true and invalidate the object pointed to by inner.
3518 * A shutdown message to be sent or received from a peer
3520 typedef struct MUST_USE_STRUCT LDKShutdown {
3522 * A pointer to the opaque Rust object.
3523 * Nearly everywhere, inner must be non-null, however in places where
3524 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3526 LDKnativeShutdown *inner;
3528 * Indicates that this is the only struct which contains the same pointer.
3529 * Rust functions which take ownership of an object provided via an argument require
3530 * this to be true and invalidate the object pointed to by inner.
3538 * A channel_reestablish message to be sent or received from a peer
3540 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
3542 * A pointer to the opaque Rust object.
3543 * Nearly everywhere, inner must be non-null, however in places where
3544 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3546 LDKnativeChannelReestablish *inner;
3548 * Indicates that this is the only struct which contains the same pointer.
3549 * Rust functions which take ownership of an object provided via an argument require
3550 * this to be true and invalidate the object pointed to by inner.
3553 } LDKChannelReestablish;
3558 * A channel_announcement message to be sent or received from a peer
3560 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
3562 * A pointer to the opaque Rust object.
3563 * Nearly everywhere, inner must be non-null, however in places where
3564 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3566 LDKnativeChannelAnnouncement *inner;
3568 * Indicates that this is the only struct which contains the same pointer.
3569 * Rust functions which take ownership of an object provided via an argument require
3570 * this to be true and invalidate the object pointed to by inner.
3573 } LDKChannelAnnouncement;
3578 * A channel_update message to be sent or received from a peer
3580 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
3582 * A pointer to the opaque Rust object.
3583 * Nearly everywhere, inner must be non-null, however in places where
3584 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3586 LDKnativeChannelUpdate *inner;
3588 * Indicates that this is the only struct which contains the same pointer.
3589 * Rust functions which take ownership of an object provided via an argument require
3590 * this to be true and invalidate the object pointed to by inner.
3598 * A node_announcement message to be sent or received from a peer
3600 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
3602 * A pointer to the opaque Rust object.
3603 * Nearly everywhere, inner must be non-null, however in places where
3604 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3606 LDKnativeNodeAnnouncement *inner;
3608 * Indicates that this is the only struct which contains the same pointer.
3609 * Rust functions which take ownership of an object provided via an argument require
3610 * this to be true and invalidate the object pointed to by inner.
3613 } LDKNodeAnnouncement;
3618 * An error message to be sent or received from a peer
3620 typedef struct MUST_USE_STRUCT LDKErrorMessage {
3622 * A pointer to the opaque Rust object.
3623 * Nearly everywhere, inner must be non-null, however in places where
3624 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3626 LDKnativeErrorMessage *inner;
3628 * Indicates that this is the only struct which contains the same pointer.
3629 * Rust functions which take ownership of an object provided via an argument require
3630 * this to be true and invalidate the object pointed to by inner.
3636 * Used to put an error message in a LightningError
3638 typedef enum LDKErrorAction_Tag {
3640 * The peer took some action which made us think they were useless. Disconnect them.
3642 LDKErrorAction_DisconnectPeer,
3644 * The peer did something harmless that we weren't able to process, just log and ignore
3646 LDKErrorAction_IgnoreError,
3648 * The peer did something incorrect. Tell them.
3650 LDKErrorAction_SendErrorMessage,
3652 * Must be last for serialization purposes
3654 LDKErrorAction_Sentinel,
3655 } LDKErrorAction_Tag;
3657 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
3659 * An error message which we should make an effort to send before we disconnect.
3661 struct LDKErrorMessage msg;
3662 } LDKErrorAction_LDKDisconnectPeer_Body;
3664 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
3666 * The message to send.
3668 struct LDKErrorMessage msg;
3669 } LDKErrorAction_LDKSendErrorMessage_Body;
3671 typedef struct MUST_USE_STRUCT LDKErrorAction {
3672 LDKErrorAction_Tag tag;
3674 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
3675 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
3680 * The information we received from a peer along the route of a payment we originated. This is
3681 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
3682 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
3684 typedef enum LDKHTLCFailChannelUpdate_Tag {
3686 * We received an error which included a full ChannelUpdate message.
3688 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
3690 * We received an error which indicated only that a channel has been closed
3692 LDKHTLCFailChannelUpdate_ChannelClosed,
3694 * We received an error which indicated only that a node has failed
3696 LDKHTLCFailChannelUpdate_NodeFailure,
3698 * Must be last for serialization purposes
3700 LDKHTLCFailChannelUpdate_Sentinel,
3701 } LDKHTLCFailChannelUpdate_Tag;
3703 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
3705 * The unwrapped message we received
3707 struct LDKChannelUpdate msg;
3708 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
3710 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
3712 * The short_channel_id which has now closed.
3714 uint64_t short_channel_id;
3716 * when this true, this channel should be permanently removed from the
3717 * consideration. Otherwise, this channel can be restored as new channel_update is received
3720 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
3722 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
3724 * The node_id that has failed.
3726 struct LDKPublicKey node_id;
3728 * when this true, node should be permanently removed from the
3729 * consideration. Otherwise, the channels connected to this node can be
3730 * restored as new channel_update is received
3733 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
3735 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
3736 LDKHTLCFailChannelUpdate_Tag tag;
3738 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
3739 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
3740 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
3742 } LDKHTLCFailChannelUpdate;
3747 * A query_channel_range message is used to query a peer for channel
3748 * UTXOs in a range of blocks. The recipient of a query makes a best
3749 * effort to reply to the query using one or more reply_channel_range
3752 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
3754 * A pointer to the opaque Rust object.
3755 * Nearly everywhere, inner must be non-null, however in places where
3756 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3758 LDKnativeQueryChannelRange *inner;
3760 * Indicates that this is the only struct which contains the same pointer.
3761 * Rust functions which take ownership of an object provided via an argument require
3762 * this to be true and invalidate the object pointed to by inner.
3765 } LDKQueryChannelRange;
3770 * A query_short_channel_ids message is used to query a peer for
3771 * routing gossip messages related to one or more short_channel_ids.
3772 * The query recipient will reply with the latest, if available,
3773 * channel_announcement, channel_update and node_announcement messages
3774 * it maintains for the requested short_channel_ids followed by a
3775 * reply_short_channel_ids_end message. The short_channel_ids sent in
3776 * this query are encoded. We only support encoding_type=0 uncompressed
3777 * serialization and do not support encoding_type=1 zlib serialization.
3779 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
3781 * A pointer to the opaque Rust object.
3782 * Nearly everywhere, inner must be non-null, however in places where
3783 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3785 LDKnativeQueryShortChannelIds *inner;
3787 * Indicates that this is the only struct which contains the same pointer.
3788 * Rust functions which take ownership of an object provided via an argument require
3789 * this to be true and invalidate the object pointed to by inner.
3792 } LDKQueryShortChannelIds;
3797 * A reply_channel_range message is a reply to a query_channel_range
3798 * message. Multiple reply_channel_range messages can be sent in reply
3799 * to a single query_channel_range message. The query recipient makes a
3800 * best effort to respond based on their local network view which may
3801 * not be a perfect view of the network. The short_channel_ids in the
3802 * reply are encoded. We only support encoding_type=0 uncompressed
3803 * serialization and do not support encoding_type=1 zlib serialization.
3805 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3807 * A pointer to the opaque Rust object.
3808 * Nearly everywhere, inner must be non-null, however in places where
3809 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3811 LDKnativeReplyChannelRange *inner;
3813 * Indicates that this is the only struct which contains the same pointer.
3814 * Rust functions which take ownership of an object provided via an argument require
3815 * this to be true and invalidate the object pointed to by inner.
3818 } LDKReplyChannelRange;
3821 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
3822 * broadcast to most peers).
3823 * These events are handled by PeerManager::process_events if you are using a PeerManager.
3825 typedef enum LDKMessageSendEvent_Tag {
3827 * Used to indicate that we've accepted a channel open and should send the accept_channel
3828 * message provided to the given peer.
3830 LDKMessageSendEvent_SendAcceptChannel,
3832 * Used to indicate that we've initiated a channel open and should send the open_channel
3833 * message provided to the given peer.
3835 LDKMessageSendEvent_SendOpenChannel,
3837 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
3839 LDKMessageSendEvent_SendFundingCreated,
3841 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
3843 LDKMessageSendEvent_SendFundingSigned,
3845 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
3847 LDKMessageSendEvent_SendFundingLocked,
3849 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
3851 LDKMessageSendEvent_SendAnnouncementSignatures,
3853 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
3854 * message should be sent to the peer with the given node_id.
3856 LDKMessageSendEvent_UpdateHTLCs,
3858 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
3860 LDKMessageSendEvent_SendRevokeAndACK,
3862 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
3864 LDKMessageSendEvent_SendClosingSigned,
3866 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
3868 LDKMessageSendEvent_SendShutdown,
3870 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
3872 LDKMessageSendEvent_SendChannelReestablish,
3874 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
3875 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
3877 * Note that after doing so, you very likely (unless you did so very recently) want to call
3878 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
3879 * This ensures that any nodes which see our channel_announcement also have a relevant
3880 * node_announcement, including relevant feature flags which may be important for routing
3883 LDKMessageSendEvent_BroadcastChannelAnnouncement,
3885 * Used to indicate that a node_announcement should be broadcast to all peers.
3887 LDKMessageSendEvent_BroadcastNodeAnnouncement,
3889 * Used to indicate that a channel_update should be broadcast to all peers.
3891 LDKMessageSendEvent_BroadcastChannelUpdate,
3893 * Broadcast an error downstream to be handled
3895 LDKMessageSendEvent_HandleError,
3897 * When a payment fails we may receive updates back from the hop where it failed. In such
3898 * cases this event is generated so that we can inform the network graph of this information.
3900 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
3902 * Query a peer for channels with funding transaction UTXOs in a block range.
3904 LDKMessageSendEvent_SendChannelRangeQuery,
3906 * Request routing gossip messages from a peer for a list of channels identified by
3907 * their short_channel_ids.
3909 LDKMessageSendEvent_SendShortIdsQuery,
3911 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
3912 * emitted during processing of the query.
3914 LDKMessageSendEvent_SendReplyChannelRange,
3916 * Must be last for serialization purposes
3918 LDKMessageSendEvent_Sentinel,
3919 } LDKMessageSendEvent_Tag;
3921 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
3923 * The node_id of the node which should receive this message
3925 struct LDKPublicKey node_id;
3927 * The message which should be sent.
3929 struct LDKAcceptChannel msg;
3930 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
3932 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
3934 * The node_id of the node which should receive this message
3936 struct LDKPublicKey node_id;
3938 * The message which should be sent.
3940 struct LDKOpenChannel msg;
3941 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
3943 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
3945 * The node_id of the node which should receive this message
3947 struct LDKPublicKey node_id;
3949 * The message which should be sent.
3951 struct LDKFundingCreated msg;
3952 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
3954 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
3956 * The node_id of the node which should receive this message
3958 struct LDKPublicKey node_id;
3960 * The message which should be sent.
3962 struct LDKFundingSigned msg;
3963 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
3965 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
3967 * The node_id of the node which should receive these message(s)
3969 struct LDKPublicKey node_id;
3971 * The funding_locked message which should be sent.
3973 struct LDKFundingLocked msg;
3974 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
3976 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
3978 * The node_id of the node which should receive these message(s)
3980 struct LDKPublicKey node_id;
3982 * The announcement_signatures message which should be sent.
3984 struct LDKAnnouncementSignatures msg;
3985 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
3987 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
3989 * The node_id of the node which should receive these message(s)
3991 struct LDKPublicKey node_id;
3993 * The update messages which should be sent. ALL messages in the struct should be sent!
3995 struct LDKCommitmentUpdate updates;
3996 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
3998 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
4000 * The node_id of the node which should receive this message
4002 struct LDKPublicKey node_id;
4004 * The message which should be sent.
4006 struct LDKRevokeAndACK msg;
4007 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
4009 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
4011 * The node_id of the node which should receive this message
4013 struct LDKPublicKey node_id;
4015 * The message which should be sent.
4017 struct LDKClosingSigned msg;
4018 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
4020 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
4022 * The node_id of the node which should receive this message
4024 struct LDKPublicKey node_id;
4026 * The message which should be sent.
4028 struct LDKShutdown msg;
4029 } LDKMessageSendEvent_LDKSendShutdown_Body;
4031 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
4033 * The node_id of the node which should receive this message
4035 struct LDKPublicKey node_id;
4037 * The message which should be sent.
4039 struct LDKChannelReestablish msg;
4040 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
4042 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
4044 * The channel_announcement which should be sent.
4046 struct LDKChannelAnnouncement msg;
4048 * The followup channel_update which should be sent.
4050 struct LDKChannelUpdate update_msg;
4051 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
4053 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
4055 * The node_announcement which should be sent.
4057 struct LDKNodeAnnouncement msg;
4058 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
4060 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
4062 * The channel_update which should be sent.
4064 struct LDKChannelUpdate msg;
4065 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
4067 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
4069 * The node_id of the node which should receive this message
4071 struct LDKPublicKey node_id;
4073 * The action which should be taken.
4075 struct LDKErrorAction action;
4076 } LDKMessageSendEvent_LDKHandleError_Body;
4078 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
4080 * The channel/node update which should be sent to NetGraphMsgHandler
4082 struct LDKHTLCFailChannelUpdate update;
4083 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
4085 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
4087 * The node_id of this message recipient
4089 struct LDKPublicKey node_id;
4091 * The query_channel_range which should be sent.
4093 struct LDKQueryChannelRange msg;
4094 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
4096 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
4098 * The node_id of this message recipient
4100 struct LDKPublicKey node_id;
4102 * The query_short_channel_ids which should be sent.
4104 struct LDKQueryShortChannelIds msg;
4105 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
4107 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
4109 * The node_id of this message recipient
4111 struct LDKPublicKey node_id;
4113 * The reply_channel_range which should be sent.
4115 struct LDKReplyChannelRange msg;
4116 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
4118 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
4119 LDKMessageSendEvent_Tag tag;
4121 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
4122 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
4123 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
4124 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
4125 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
4126 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
4127 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
4128 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
4129 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
4130 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
4131 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
4132 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
4133 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
4134 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
4135 LDKMessageSendEvent_LDKHandleError_Body handle_error;
4136 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
4137 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
4138 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
4139 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
4141 } LDKMessageSendEvent;
4144 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
4145 * This corresponds to std::vector in C++
4147 typedef struct LDKCVec_MessageSendEventZ {
4149 * The elements in the array.
4150 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4152 struct LDKMessageSendEvent *data;
4154 * The number of elements pointed to by `data`.
4157 } LDKCVec_MessageSendEventZ;
4160 * The contents of CResult_boolLightningErrorZ
4162 typedef union LDKCResult_boolLightningErrorZPtr {
4164 * A pointer to the contents in the success state.
4165 * Reading from this pointer when `result_ok` is not set is undefined.
4169 * A pointer to the contents in the error state.
4170 * Reading from this pointer when `result_ok` is set is undefined.
4172 struct LDKLightningError *err;
4173 } LDKCResult_boolLightningErrorZPtr;
4176 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
4177 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
4178 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4180 typedef struct LDKCResult_boolLightningErrorZ {
4182 * The contents of this CResult_boolLightningErrorZ, accessible via either
4183 * `err` or `result` depending on the state of `result_ok`.
4185 union LDKCResult_boolLightningErrorZPtr contents;
4187 * Whether this CResult_boolLightningErrorZ represents a success state.
4190 } LDKCResult_boolLightningErrorZ;
4193 * A tuple of 3 elements. See the individual fields for the types contained.
4195 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
4197 * The element at position 0
4199 struct LDKChannelAnnouncement a;
4201 * The element at position 1
4203 struct LDKChannelUpdate b;
4205 * The element at position 2
4207 struct LDKChannelUpdate c;
4208 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
4211 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
4212 * This corresponds to std::vector in C++
4214 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
4216 * The elements in the array.
4217 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4219 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
4221 * The number of elements pointed to by `data`.
4224 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
4227 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
4228 * This corresponds to std::vector in C++
4230 typedef struct LDKCVec_NodeAnnouncementZ {
4232 * The elements in the array.
4233 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4235 struct LDKNodeAnnouncement *data;
4237 * The number of elements pointed to by `data`.
4240 } LDKCVec_NodeAnnouncementZ;
4243 * The contents of CResult_NoneLightningErrorZ
4245 typedef union LDKCResult_NoneLightningErrorZPtr {
4247 * Note that this value is always NULL, as there are no contents in the OK variant
4251 * A pointer to the contents in the error state.
4252 * Reading from this pointer when `result_ok` is set is undefined.
4254 struct LDKLightningError *err;
4255 } LDKCResult_NoneLightningErrorZPtr;
4258 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
4259 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
4260 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4262 typedef struct LDKCResult_NoneLightningErrorZ {
4264 * The contents of this CResult_NoneLightningErrorZ, accessible via either
4265 * `err` or `result` depending on the state of `result_ok`.
4267 union LDKCResult_NoneLightningErrorZPtr contents;
4269 * Whether this CResult_NoneLightningErrorZ represents a success state.
4272 } LDKCResult_NoneLightningErrorZ;
4275 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
4276 * This corresponds to std::vector in C++
4278 typedef struct LDKCVec_PublicKeyZ {
4280 * The elements in the array.
4281 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4283 struct LDKPublicKey *data;
4285 * The number of elements pointed to by `data`.
4288 } LDKCVec_PublicKeyZ;
4293 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
4294 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
4297 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
4299 * A pointer to the opaque Rust object.
4300 * Nearly everywhere, inner must be non-null, however in places where
4301 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4303 LDKnativePeerHandleError *inner;
4305 * Indicates that this is the only struct which contains the same pointer.
4306 * Rust functions which take ownership of an object provided via an argument require
4307 * this to be true and invalidate the object pointed to by inner.
4310 } LDKPeerHandleError;
4313 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
4315 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
4317 * A pointer to the contents in the success state.
4318 * Reading from this pointer when `result_ok` is not set is undefined.
4320 struct LDKCVec_u8Z *result;
4322 * A pointer to the contents in the error state.
4323 * Reading from this pointer when `result_ok` is set is undefined.
4325 struct LDKPeerHandleError *err;
4326 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
4329 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
4330 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
4331 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4333 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
4335 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
4336 * `err` or `result` depending on the state of `result_ok`.
4338 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
4340 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
4343 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
4346 * The contents of CResult_NonePeerHandleErrorZ
4348 typedef union LDKCResult_NonePeerHandleErrorZPtr {
4350 * Note that this value is always NULL, as there are no contents in the OK variant
4354 * A pointer to the contents in the error state.
4355 * Reading from this pointer when `result_ok` is set is undefined.
4357 struct LDKPeerHandleError *err;
4358 } LDKCResult_NonePeerHandleErrorZPtr;
4361 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
4362 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
4363 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4365 typedef struct LDKCResult_NonePeerHandleErrorZ {
4367 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
4368 * `err` or `result` depending on the state of `result_ok`.
4370 union LDKCResult_NonePeerHandleErrorZPtr contents;
4372 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
4375 } LDKCResult_NonePeerHandleErrorZ;
4378 * The contents of CResult_boolPeerHandleErrorZ
4380 typedef union LDKCResult_boolPeerHandleErrorZPtr {
4382 * A pointer to the contents in the success state.
4383 * Reading from this pointer when `result_ok` is not set is undefined.
4387 * A pointer to the contents in the error state.
4388 * Reading from this pointer when `result_ok` is set is undefined.
4390 struct LDKPeerHandleError *err;
4391 } LDKCResult_boolPeerHandleErrorZPtr;
4394 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
4395 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
4396 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4398 typedef struct LDKCResult_boolPeerHandleErrorZ {
4400 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
4401 * `err` or `result` depending on the state of `result_ok`.
4403 union LDKCResult_boolPeerHandleErrorZPtr contents;
4405 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
4408 } LDKCResult_boolPeerHandleErrorZ;
4411 * The contents of CResult_TxOutAccessErrorZ
4413 typedef union LDKCResult_TxOutAccessErrorZPtr {
4415 * A pointer to the contents in the success state.
4416 * Reading from this pointer when `result_ok` is not set is undefined.
4418 struct LDKTxOut *result;
4420 * A pointer to the contents in the error state.
4421 * Reading from this pointer when `result_ok` is set is undefined.
4423 enum LDKAccessError *err;
4424 } LDKCResult_TxOutAccessErrorZPtr;
4427 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
4428 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
4429 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4431 typedef struct LDKCResult_TxOutAccessErrorZ {
4433 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
4434 * `err` or `result` depending on the state of `result_ok`.
4436 union LDKCResult_TxOutAccessErrorZPtr contents;
4438 * Whether this CResult_TxOutAccessErrorZ represents a success state.
4441 } LDKCResult_TxOutAccessErrorZ;
4444 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
4446 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
4448 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
4450 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
4452 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
4454 LDKCOption_C2Tuple_usizeTransactionZZ_None,
4456 * Must be last for serialization purposes
4458 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
4459 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
4461 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
4462 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
4465 struct LDKC2Tuple_usizeTransactionZ some;
4468 } LDKCOption_C2Tuple_usizeTransactionZZ;
4473 * Details about one direction of a channel. Received
4474 * within a channel update.
4476 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
4478 * A pointer to the opaque Rust object.
4479 * Nearly everywhere, inner must be non-null, however in places where
4480 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4482 LDKnativeDirectionalChannelInfo *inner;
4484 * Indicates that this is the only struct which contains the same pointer.
4485 * Rust functions which take ownership of an object provided via an argument require
4486 * this to be true and invalidate the object pointed to by inner.
4489 } LDKDirectionalChannelInfo;
4492 * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
4494 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
4496 * A pointer to the contents in the success state.
4497 * Reading from this pointer when `result_ok` is not set is undefined.
4499 struct LDKDirectionalChannelInfo *result;
4501 * A pointer to the contents in the error state.
4502 * Reading from this pointer when `result_ok` is set is undefined.
4504 struct LDKDecodeError *err;
4505 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
4508 * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
4509 * containing a crate::lightning::routing::network_graph::DirectionalChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4510 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4512 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
4514 * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
4515 * `err` or `result` depending on the state of `result_ok`.
4517 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
4519 * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
4522 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
4527 * Details about a channel (both directions).
4528 * Received within a channel announcement.
4530 typedef struct MUST_USE_STRUCT LDKChannelInfo {
4532 * A pointer to the opaque Rust object.
4533 * Nearly everywhere, inner must be non-null, however in places where
4534 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4536 LDKnativeChannelInfo *inner;
4538 * Indicates that this is the only struct which contains the same pointer.
4539 * Rust functions which take ownership of an object provided via an argument require
4540 * this to be true and invalidate the object pointed to by inner.
4546 * The contents of CResult_ChannelInfoDecodeErrorZ
4548 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
4550 * A pointer to the contents in the success state.
4551 * Reading from this pointer when `result_ok` is not set is undefined.
4553 struct LDKChannelInfo *result;
4555 * A pointer to the contents in the error state.
4556 * Reading from this pointer when `result_ok` is set is undefined.
4558 struct LDKDecodeError *err;
4559 } LDKCResult_ChannelInfoDecodeErrorZPtr;
4562 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
4563 * containing a crate::lightning::routing::network_graph::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4564 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4566 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
4568 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
4569 * `err` or `result` depending on the state of `result_ok`.
4571 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
4573 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
4576 } LDKCResult_ChannelInfoDecodeErrorZ;
4581 * Fees for routing via a given channel or a node
4583 typedef struct MUST_USE_STRUCT LDKRoutingFees {
4585 * A pointer to the opaque Rust object.
4586 * Nearly everywhere, inner must be non-null, however in places where
4587 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4589 LDKnativeRoutingFees *inner;
4591 * Indicates that this is the only struct which contains the same pointer.
4592 * Rust functions which take ownership of an object provided via an argument require
4593 * this to be true and invalidate the object pointed to by inner.
4599 * The contents of CResult_RoutingFeesDecodeErrorZ
4601 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
4603 * A pointer to the contents in the success state.
4604 * Reading from this pointer when `result_ok` is not set is undefined.
4606 struct LDKRoutingFees *result;
4608 * A pointer to the contents in the error state.
4609 * Reading from this pointer when `result_ok` is set is undefined.
4611 struct LDKDecodeError *err;
4612 } LDKCResult_RoutingFeesDecodeErrorZPtr;
4615 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
4616 * containing a crate::lightning::routing::network_graph::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
4617 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4619 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
4621 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
4622 * `err` or `result` depending on the state of `result_ok`.
4624 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
4626 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
4629 } LDKCResult_RoutingFeesDecodeErrorZ;
4632 * A 4-byte byte array.
4634 typedef struct LDKFourBytes {
4642 * A 16-byte byte array.
4644 typedef struct LDKSixteenBytes {
4652 * A 10-byte byte array.
4654 typedef struct LDKTenBytes {
4662 * An address which can be used to connect to a remote peer
4664 typedef enum LDKNetAddress_Tag {
4666 * An IPv4 address/port on which the peer is listening.
4670 * An IPv6 address/port on which the peer is listening.
4674 * An old-style Tor onion address/port on which the peer is listening.
4676 LDKNetAddress_OnionV2,
4678 * A new-style Tor onion address/port on which the peer is listening.
4679 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
4680 * wrap as base32 and append \".onion\".
4682 LDKNetAddress_OnionV3,
4684 * Must be last for serialization purposes
4686 LDKNetAddress_Sentinel,
4687 } LDKNetAddress_Tag;
4689 typedef struct LDKNetAddress_LDKIPv4_Body {
4691 * The 4-byte IPv4 address
4693 struct LDKFourBytes addr;
4695 * The port on which the node is listening
4698 } LDKNetAddress_LDKIPv4_Body;
4700 typedef struct LDKNetAddress_LDKIPv6_Body {
4702 * The 16-byte IPv6 address
4704 struct LDKSixteenBytes addr;
4706 * The port on which the node is listening
4709 } LDKNetAddress_LDKIPv6_Body;
4711 typedef struct LDKNetAddress_LDKOnionV2_Body {
4713 * The bytes (usually encoded in base32 with \".onion\" appended)
4715 struct LDKTenBytes addr;
4717 * The port on which the node is listening
4720 } LDKNetAddress_LDKOnionV2_Body;
4722 typedef struct LDKNetAddress_LDKOnionV3_Body {
4724 * The ed25519 long-term public key of the peer
4726 struct LDKThirtyTwoBytes ed25519_pubkey;
4728 * The checksum of the pubkey and version, as included in the onion address
4732 * The version byte, as defined by the Tor Onion v3 spec.
4736 * The port on which the node is listening
4739 } LDKNetAddress_LDKOnionV3_Body;
4741 typedef struct MUST_USE_STRUCT LDKNetAddress {
4742 LDKNetAddress_Tag tag;
4744 LDKNetAddress_LDKIPv4_Body i_pv4;
4745 LDKNetAddress_LDKIPv6_Body i_pv6;
4746 LDKNetAddress_LDKOnionV2_Body onion_v2;
4747 LDKNetAddress_LDKOnionV3_Body onion_v3;
4752 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
4753 * This corresponds to std::vector in C++
4755 typedef struct LDKCVec_NetAddressZ {
4757 * The elements in the array.
4758 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4760 struct LDKNetAddress *data;
4762 * The number of elements pointed to by `data`.
4765 } LDKCVec_NetAddressZ;
4770 * Information received in the latest node_announcement from this node.
4772 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
4774 * A pointer to the opaque Rust object.
4775 * Nearly everywhere, inner must be non-null, however in places where
4776 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4778 LDKnativeNodeAnnouncementInfo *inner;
4780 * Indicates that this is the only struct which contains the same pointer.
4781 * Rust functions which take ownership of an object provided via an argument require
4782 * this to be true and invalidate the object pointed to by inner.
4785 } LDKNodeAnnouncementInfo;
4788 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
4790 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
4792 * A pointer to the contents in the success state.
4793 * Reading from this pointer when `result_ok` is not set is undefined.
4795 struct LDKNodeAnnouncementInfo *result;
4797 * A pointer to the contents in the error state.
4798 * Reading from this pointer when `result_ok` is set is undefined.
4800 struct LDKDecodeError *err;
4801 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
4804 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
4805 * containing a crate::lightning::routing::network_graph::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4806 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4808 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
4810 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
4811 * `err` or `result` depending on the state of `result_ok`.
4813 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
4815 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
4818 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
4821 * A dynamically-allocated array of u64s of arbitrary size.
4822 * This corresponds to std::vector in C++
4824 typedef struct LDKCVec_u64Z {
4826 * The elements in the array.
4827 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4831 * The number of elements pointed to by `data`.
4839 * Details about a node in the network, known from the network announcement.
4841 typedef struct MUST_USE_STRUCT LDKNodeInfo {
4843 * A pointer to the opaque Rust object.
4844 * Nearly everywhere, inner must be non-null, however in places where
4845 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4847 LDKnativeNodeInfo *inner;
4849 * Indicates that this is the only struct which contains the same pointer.
4850 * Rust functions which take ownership of an object provided via an argument require
4851 * this to be true and invalidate the object pointed to by inner.
4857 * The contents of CResult_NodeInfoDecodeErrorZ
4859 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
4861 * A pointer to the contents in the success state.
4862 * Reading from this pointer when `result_ok` is not set is undefined.
4864 struct LDKNodeInfo *result;
4866 * A pointer to the contents in the error state.
4867 * Reading from this pointer when `result_ok` is set is undefined.
4869 struct LDKDecodeError *err;
4870 } LDKCResult_NodeInfoDecodeErrorZPtr;
4873 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
4874 * containing a crate::lightning::routing::network_graph::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4875 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4877 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
4879 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
4880 * `err` or `result` depending on the state of `result_ok`.
4882 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
4884 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
4887 } LDKCResult_NodeInfoDecodeErrorZ;
4892 * Represents the network as nodes and channels between them
4894 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4896 * A pointer to the opaque Rust object.
4897 * Nearly everywhere, inner must be non-null, however in places where
4898 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4900 LDKnativeNetworkGraph *inner;
4902 * Indicates that this is the only struct which contains the same pointer.
4903 * Rust functions which take ownership of an object provided via an argument require
4904 * this to be true and invalidate the object pointed to by inner.
4910 * The contents of CResult_NetworkGraphDecodeErrorZ
4912 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
4914 * A pointer to the contents in the success state.
4915 * Reading from this pointer when `result_ok` is not set is undefined.
4917 struct LDKNetworkGraph *result;
4919 * A pointer to the contents in the error state.
4920 * Reading from this pointer when `result_ok` is set is undefined.
4922 struct LDKDecodeError *err;
4923 } LDKCResult_NetworkGraphDecodeErrorZPtr;
4926 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
4927 * containing a crate::lightning::routing::network_graph::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
4928 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4930 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
4932 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
4933 * `err` or `result` depending on the state of `result_ok`.
4935 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
4937 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
4940 } LDKCResult_NetworkGraphDecodeErrorZ;
4945 * Features used within an `init` message.
4947 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4949 * A pointer to the opaque Rust object.
4950 * Nearly everywhere, inner must be non-null, however in places where
4951 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4953 LDKnativeInitFeatures *inner;
4955 * Indicates that this is the only struct which contains the same pointer.
4956 * Rust functions which take ownership of an object provided via an argument require
4957 * this to be true and invalidate the object pointed to by inner.
4963 * The contents of CResult_InitFeaturesDecodeErrorZ
4965 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4967 * A pointer to the contents in the success state.
4968 * Reading from this pointer when `result_ok` is not set is undefined.
4970 struct LDKInitFeatures *result;
4972 * A pointer to the contents in the error state.
4973 * Reading from this pointer when `result_ok` is set is undefined.
4975 struct LDKDecodeError *err;
4976 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4979 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4980 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4981 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4983 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4985 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4986 * `err` or `result` depending on the state of `result_ok`.
4988 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4990 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4993 } LDKCResult_InitFeaturesDecodeErrorZ;
4998 * Features used within a `node_announcement` message.
5000 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
5002 * A pointer to the opaque Rust object.
5003 * Nearly everywhere, inner must be non-null, however in places where
5004 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5006 LDKnativeNodeFeatures *inner;
5008 * Indicates that this is the only struct which contains the same pointer.
5009 * Rust functions which take ownership of an object provided via an argument require
5010 * this to be true and invalidate the object pointed to by inner.
5016 * The contents of CResult_NodeFeaturesDecodeErrorZ
5018 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
5020 * A pointer to the contents in the success state.
5021 * Reading from this pointer when `result_ok` is not set is undefined.
5023 struct LDKNodeFeatures *result;
5025 * A pointer to the contents in the error state.
5026 * Reading from this pointer when `result_ok` is set is undefined.
5028 struct LDKDecodeError *err;
5029 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
5032 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
5033 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5034 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5036 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
5038 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
5039 * `err` or `result` depending on the state of `result_ok`.
5041 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
5043 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
5046 } LDKCResult_NodeFeaturesDecodeErrorZ;
5051 * Features used within a `channel_announcement` message.
5053 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
5055 * A pointer to the opaque Rust object.
5056 * Nearly everywhere, inner must be non-null, however in places where
5057 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5059 LDKnativeChannelFeatures *inner;
5061 * Indicates that this is the only struct which contains the same pointer.
5062 * Rust functions which take ownership of an object provided via an argument require
5063 * this to be true and invalidate the object pointed to by inner.
5066 } LDKChannelFeatures;
5069 * The contents of CResult_ChannelFeaturesDecodeErrorZ
5071 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
5073 * A pointer to the contents in the success state.
5074 * Reading from this pointer when `result_ok` is not set is undefined.
5076 struct LDKChannelFeatures *result;
5078 * A pointer to the contents in the error state.
5079 * Reading from this pointer when `result_ok` is set is undefined.
5081 struct LDKDecodeError *err;
5082 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
5085 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
5086 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5087 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5089 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
5091 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
5092 * `err` or `result` depending on the state of `result_ok`.
5094 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
5096 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
5099 } LDKCResult_ChannelFeaturesDecodeErrorZ;
5104 * Features used within an invoice.
5106 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
5108 * A pointer to the opaque Rust object.
5109 * Nearly everywhere, inner must be non-null, however in places where
5110 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5112 LDKnativeInvoiceFeatures *inner;
5114 * Indicates that this is the only struct which contains the same pointer.
5115 * Rust functions which take ownership of an object provided via an argument require
5116 * this to be true and invalidate the object pointed to by inner.
5119 } LDKInvoiceFeatures;
5122 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
5124 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
5126 * A pointer to the contents in the success state.
5127 * Reading from this pointer when `result_ok` is not set is undefined.
5129 struct LDKInvoiceFeatures *result;
5131 * A pointer to the contents in the error state.
5132 * Reading from this pointer when `result_ok` is set is undefined.
5134 struct LDKDecodeError *err;
5135 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
5138 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5139 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5140 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5142 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
5144 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
5145 * `err` or `result` depending on the state of `result_ok`.
5147 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
5149 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
5152 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
5155 * The contents of CResult_NetAddressu8Z
5157 typedef union LDKCResult_NetAddressu8ZPtr {
5159 * A pointer to the contents in the success state.
5160 * Reading from this pointer when `result_ok` is not set is undefined.
5162 struct LDKNetAddress *result;
5164 * A pointer to the contents in the error state.
5165 * Reading from this pointer when `result_ok` is set is undefined.
5168 } LDKCResult_NetAddressu8ZPtr;
5171 * A CResult_NetAddressu8Z represents the result of a fallible operation,
5172 * containing a crate::lightning::ln::msgs::NetAddress on success and a u8 on failure.
5173 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5175 typedef struct LDKCResult_NetAddressu8Z {
5177 * The contents of this CResult_NetAddressu8Z, accessible via either
5178 * `err` or `result` depending on the state of `result_ok`.
5180 union LDKCResult_NetAddressu8ZPtr contents;
5182 * Whether this CResult_NetAddressu8Z represents a success state.
5185 } LDKCResult_NetAddressu8Z;
5188 * The contents of CResult_CResult_NetAddressu8ZDecodeErrorZ
5190 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
5192 * A pointer to the contents in the success state.
5193 * Reading from this pointer when `result_ok` is not set is undefined.
5195 struct LDKCResult_NetAddressu8Z *result;
5197 * A pointer to the contents in the error state.
5198 * Reading from this pointer when `result_ok` is set is undefined.
5200 struct LDKDecodeError *err;
5201 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
5204 * A CResult_CResult_NetAddressu8ZDecodeErrorZ represents the result of a fallible operation,
5205 * containing a crate::c_types::derived::CResult_NetAddressu8Z on success and a crate::lightning::ln::msgs::DecodeError on failure.
5206 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5208 typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
5210 * The contents of this CResult_CResult_NetAddressu8ZDecodeErrorZ, accessible via either
5211 * `err` or `result` depending on the state of `result_ok`.
5213 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
5215 * Whether this CResult_CResult_NetAddressu8ZDecodeErrorZ represents a success state.
5218 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
5221 * The contents of CResult_NetAddressDecodeErrorZ
5223 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
5225 * A pointer to the contents in the success state.
5226 * Reading from this pointer when `result_ok` is not set is undefined.
5228 struct LDKNetAddress *result;
5230 * A pointer to the contents in the error state.
5231 * Reading from this pointer when `result_ok` is set is undefined.
5233 struct LDKDecodeError *err;
5234 } LDKCResult_NetAddressDecodeErrorZPtr;
5237 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
5238 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
5239 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5241 typedef struct LDKCResult_NetAddressDecodeErrorZ {
5243 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
5244 * `err` or `result` depending on the state of `result_ok`.
5246 union LDKCResult_NetAddressDecodeErrorZPtr contents;
5248 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
5251 } LDKCResult_NetAddressDecodeErrorZ;
5256 * An update_add_htlc message to be sent or received from a peer
5258 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
5260 * A pointer to the opaque Rust object.
5261 * Nearly everywhere, inner must be non-null, however in places where
5262 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5264 LDKnativeUpdateAddHTLC *inner;
5266 * Indicates that this is the only struct which contains the same pointer.
5267 * Rust functions which take ownership of an object provided via an argument require
5268 * this to be true and invalidate the object pointed to by inner.
5274 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
5275 * This corresponds to std::vector in C++
5277 typedef struct LDKCVec_UpdateAddHTLCZ {
5279 * The elements in the array.
5280 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5282 struct LDKUpdateAddHTLC *data;
5284 * The number of elements pointed to by `data`.
5287 } LDKCVec_UpdateAddHTLCZ;
5292 * An update_fulfill_htlc message to be sent or received from a peer
5294 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
5296 * A pointer to the opaque Rust object.
5297 * Nearly everywhere, inner must be non-null, however in places where
5298 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5300 LDKnativeUpdateFulfillHTLC *inner;
5302 * Indicates that this is the only struct which contains the same pointer.
5303 * Rust functions which take ownership of an object provided via an argument require
5304 * this to be true and invalidate the object pointed to by inner.
5307 } LDKUpdateFulfillHTLC;
5310 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
5311 * This corresponds to std::vector in C++
5313 typedef struct LDKCVec_UpdateFulfillHTLCZ {
5315 * The elements in the array.
5316 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5318 struct LDKUpdateFulfillHTLC *data;
5320 * The number of elements pointed to by `data`.
5323 } LDKCVec_UpdateFulfillHTLCZ;
5328 * An update_fail_htlc message to be sent or received from a peer
5330 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
5332 * A pointer to the opaque Rust object.
5333 * Nearly everywhere, inner must be non-null, however in places where
5334 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5336 LDKnativeUpdateFailHTLC *inner;
5338 * Indicates that this is the only struct which contains the same pointer.
5339 * Rust functions which take ownership of an object provided via an argument require
5340 * this to be true and invalidate the object pointed to by inner.
5343 } LDKUpdateFailHTLC;
5346 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
5347 * This corresponds to std::vector in C++
5349 typedef struct LDKCVec_UpdateFailHTLCZ {
5351 * The elements in the array.
5352 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5354 struct LDKUpdateFailHTLC *data;
5356 * The number of elements pointed to by `data`.
5359 } LDKCVec_UpdateFailHTLCZ;
5364 * An update_fail_malformed_htlc message to be sent or received from a peer
5366 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
5368 * A pointer to the opaque Rust object.
5369 * Nearly everywhere, inner must be non-null, however in places where
5370 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5372 LDKnativeUpdateFailMalformedHTLC *inner;
5374 * Indicates that this is the only struct which contains the same pointer.
5375 * Rust functions which take ownership of an object provided via an argument require
5376 * this to be true and invalidate the object pointed to by inner.
5379 } LDKUpdateFailMalformedHTLC;
5382 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
5383 * This corresponds to std::vector in C++
5385 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
5387 * The elements in the array.
5388 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5390 struct LDKUpdateFailMalformedHTLC *data;
5392 * The number of elements pointed to by `data`.
5395 } LDKCVec_UpdateFailMalformedHTLCZ;
5398 * The contents of CResult_AcceptChannelDecodeErrorZ
5400 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
5402 * A pointer to the contents in the success state.
5403 * Reading from this pointer when `result_ok` is not set is undefined.
5405 struct LDKAcceptChannel *result;
5407 * A pointer to the contents in the error state.
5408 * Reading from this pointer when `result_ok` is set is undefined.
5410 struct LDKDecodeError *err;
5411 } LDKCResult_AcceptChannelDecodeErrorZPtr;
5414 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
5415 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
5416 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5418 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
5420 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
5421 * `err` or `result` depending on the state of `result_ok`.
5423 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
5425 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
5428 } LDKCResult_AcceptChannelDecodeErrorZ;
5431 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
5433 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
5435 * A pointer to the contents in the success state.
5436 * Reading from this pointer when `result_ok` is not set is undefined.
5438 struct LDKAnnouncementSignatures *result;
5440 * A pointer to the contents in the error state.
5441 * Reading from this pointer when `result_ok` is set is undefined.
5443 struct LDKDecodeError *err;
5444 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
5447 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
5448 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5449 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5451 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
5453 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
5454 * `err` or `result` depending on the state of `result_ok`.
5456 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
5458 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
5461 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
5464 * The contents of CResult_ChannelReestablishDecodeErrorZ
5466 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
5468 * A pointer to the contents in the success state.
5469 * Reading from this pointer when `result_ok` is not set is undefined.
5471 struct LDKChannelReestablish *result;
5473 * A pointer to the contents in the error state.
5474 * Reading from this pointer when `result_ok` is set is undefined.
5476 struct LDKDecodeError *err;
5477 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
5480 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
5481 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
5482 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5484 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
5486 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
5487 * `err` or `result` depending on the state of `result_ok`.
5489 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
5491 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
5494 } LDKCResult_ChannelReestablishDecodeErrorZ;
5497 * The contents of CResult_ClosingSignedDecodeErrorZ
5499 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
5501 * A pointer to the contents in the success state.
5502 * Reading from this pointer when `result_ok` is not set is undefined.
5504 struct LDKClosingSigned *result;
5506 * A pointer to the contents in the error state.
5507 * Reading from this pointer when `result_ok` is set is undefined.
5509 struct LDKDecodeError *err;
5510 } LDKCResult_ClosingSignedDecodeErrorZPtr;
5513 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
5514 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
5515 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5517 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
5519 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
5520 * `err` or `result` depending on the state of `result_ok`.
5522 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
5524 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
5527 } LDKCResult_ClosingSignedDecodeErrorZ;
5532 * A commitment_signed message to be sent or received from a peer
5534 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
5536 * A pointer to the opaque Rust object.
5537 * Nearly everywhere, inner must be non-null, however in places where
5538 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5540 LDKnativeCommitmentSigned *inner;
5542 * Indicates that this is the only struct which contains the same pointer.
5543 * Rust functions which take ownership of an object provided via an argument require
5544 * this to be true and invalidate the object pointed to by inner.
5547 } LDKCommitmentSigned;
5550 * The contents of CResult_CommitmentSignedDecodeErrorZ
5552 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
5554 * A pointer to the contents in the success state.
5555 * Reading from this pointer when `result_ok` is not set is undefined.
5557 struct LDKCommitmentSigned *result;
5559 * A pointer to the contents in the error state.
5560 * Reading from this pointer when `result_ok` is set is undefined.
5562 struct LDKDecodeError *err;
5563 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
5566 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
5567 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
5568 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5570 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
5572 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
5573 * `err` or `result` depending on the state of `result_ok`.
5575 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
5577 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
5580 } LDKCResult_CommitmentSignedDecodeErrorZ;
5583 * The contents of CResult_FundingCreatedDecodeErrorZ
5585 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
5587 * A pointer to the contents in the success state.
5588 * Reading from this pointer when `result_ok` is not set is undefined.
5590 struct LDKFundingCreated *result;
5592 * A pointer to the contents in the error state.
5593 * Reading from this pointer when `result_ok` is set is undefined.
5595 struct LDKDecodeError *err;
5596 } LDKCResult_FundingCreatedDecodeErrorZPtr;
5599 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
5600 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
5601 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5603 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
5605 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
5606 * `err` or `result` depending on the state of `result_ok`.
5608 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
5610 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
5613 } LDKCResult_FundingCreatedDecodeErrorZ;
5616 * The contents of CResult_FundingSignedDecodeErrorZ
5618 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
5620 * A pointer to the contents in the success state.
5621 * Reading from this pointer when `result_ok` is not set is undefined.
5623 struct LDKFundingSigned *result;
5625 * A pointer to the contents in the error state.
5626 * Reading from this pointer when `result_ok` is set is undefined.
5628 struct LDKDecodeError *err;
5629 } LDKCResult_FundingSignedDecodeErrorZPtr;
5632 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
5633 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
5634 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5636 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
5638 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
5639 * `err` or `result` depending on the state of `result_ok`.
5641 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
5643 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
5646 } LDKCResult_FundingSignedDecodeErrorZ;
5649 * The contents of CResult_FundingLockedDecodeErrorZ
5651 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
5653 * A pointer to the contents in the success state.
5654 * Reading from this pointer when `result_ok` is not set is undefined.
5656 struct LDKFundingLocked *result;
5658 * A pointer to the contents in the error state.
5659 * Reading from this pointer when `result_ok` is set is undefined.
5661 struct LDKDecodeError *err;
5662 } LDKCResult_FundingLockedDecodeErrorZPtr;
5665 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
5666 * containing a crate::lightning::ln::msgs::FundingLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
5667 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5669 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
5671 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
5672 * `err` or `result` depending on the state of `result_ok`.
5674 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
5676 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
5679 } LDKCResult_FundingLockedDecodeErrorZ;
5684 * An init message to be sent or received from a peer
5686 typedef struct MUST_USE_STRUCT LDKInit {
5688 * A pointer to the opaque Rust object.
5689 * Nearly everywhere, inner must be non-null, however in places where
5690 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5692 LDKnativeInit *inner;
5694 * Indicates that this is the only struct which contains the same pointer.
5695 * Rust functions which take ownership of an object provided via an argument require
5696 * this to be true and invalidate the object pointed to by inner.
5702 * The contents of CResult_InitDecodeErrorZ
5704 typedef union LDKCResult_InitDecodeErrorZPtr {
5706 * A pointer to the contents in the success state.
5707 * Reading from this pointer when `result_ok` is not set is undefined.
5709 struct LDKInit *result;
5711 * A pointer to the contents in the error state.
5712 * Reading from this pointer when `result_ok` is set is undefined.
5714 struct LDKDecodeError *err;
5715 } LDKCResult_InitDecodeErrorZPtr;
5718 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
5719 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
5720 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5722 typedef struct LDKCResult_InitDecodeErrorZ {
5724 * The contents of this CResult_InitDecodeErrorZ, accessible via either
5725 * `err` or `result` depending on the state of `result_ok`.
5727 union LDKCResult_InitDecodeErrorZPtr contents;
5729 * Whether this CResult_InitDecodeErrorZ represents a success state.
5732 } LDKCResult_InitDecodeErrorZ;
5735 * The contents of CResult_OpenChannelDecodeErrorZ
5737 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
5739 * A pointer to the contents in the success state.
5740 * Reading from this pointer when `result_ok` is not set is undefined.
5742 struct LDKOpenChannel *result;
5744 * A pointer to the contents in the error state.
5745 * Reading from this pointer when `result_ok` is set is undefined.
5747 struct LDKDecodeError *err;
5748 } LDKCResult_OpenChannelDecodeErrorZPtr;
5751 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
5752 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
5753 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5755 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
5757 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
5758 * `err` or `result` depending on the state of `result_ok`.
5760 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
5762 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
5765 } LDKCResult_OpenChannelDecodeErrorZ;
5768 * The contents of CResult_RevokeAndACKDecodeErrorZ
5770 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
5772 * A pointer to the contents in the success state.
5773 * Reading from this pointer when `result_ok` is not set is undefined.
5775 struct LDKRevokeAndACK *result;
5777 * A pointer to the contents in the error state.
5778 * Reading from this pointer when `result_ok` is set is undefined.
5780 struct LDKDecodeError *err;
5781 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
5784 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
5785 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
5786 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5788 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
5790 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
5791 * `err` or `result` depending on the state of `result_ok`.
5793 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
5795 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
5798 } LDKCResult_RevokeAndACKDecodeErrorZ;
5801 * The contents of CResult_ShutdownDecodeErrorZ
5803 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
5805 * A pointer to the contents in the success state.
5806 * Reading from this pointer when `result_ok` is not set is undefined.
5808 struct LDKShutdown *result;
5810 * A pointer to the contents in the error state.
5811 * Reading from this pointer when `result_ok` is set is undefined.
5813 struct LDKDecodeError *err;
5814 } LDKCResult_ShutdownDecodeErrorZPtr;
5817 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
5818 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
5819 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5821 typedef struct LDKCResult_ShutdownDecodeErrorZ {
5823 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
5824 * `err` or `result` depending on the state of `result_ok`.
5826 union LDKCResult_ShutdownDecodeErrorZPtr contents;
5828 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
5831 } LDKCResult_ShutdownDecodeErrorZ;
5834 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
5836 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
5838 * A pointer to the contents in the success state.
5839 * Reading from this pointer when `result_ok` is not set is undefined.
5841 struct LDKUpdateFailHTLC *result;
5843 * A pointer to the contents in the error state.
5844 * Reading from this pointer when `result_ok` is set is undefined.
5846 struct LDKDecodeError *err;
5847 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
5850 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
5851 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5852 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5854 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
5856 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
5857 * `err` or `result` depending on the state of `result_ok`.
5859 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
5861 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
5864 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
5867 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
5869 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5871 * A pointer to the contents in the success state.
5872 * Reading from this pointer when `result_ok` is not set is undefined.
5874 struct LDKUpdateFailMalformedHTLC *result;
5876 * A pointer to the contents in the error state.
5877 * Reading from this pointer when `result_ok` is set is undefined.
5879 struct LDKDecodeError *err;
5880 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
5883 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
5884 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5885 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5887 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
5889 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
5890 * `err` or `result` depending on the state of `result_ok`.
5892 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
5894 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
5897 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
5902 * An update_fee message to be sent or received from a peer
5904 typedef struct MUST_USE_STRUCT LDKUpdateFee {
5906 * A pointer to the opaque Rust object.
5907 * Nearly everywhere, inner must be non-null, however in places where
5908 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5910 LDKnativeUpdateFee *inner;
5912 * Indicates that this is the only struct which contains the same pointer.
5913 * Rust functions which take ownership of an object provided via an argument require
5914 * this to be true and invalidate the object pointed to by inner.
5920 * The contents of CResult_UpdateFeeDecodeErrorZ
5922 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
5924 * A pointer to the contents in the success state.
5925 * Reading from this pointer when `result_ok` is not set is undefined.
5927 struct LDKUpdateFee *result;
5929 * A pointer to the contents in the error state.
5930 * Reading from this pointer when `result_ok` is set is undefined.
5932 struct LDKDecodeError *err;
5933 } LDKCResult_UpdateFeeDecodeErrorZPtr;
5936 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
5937 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
5938 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5940 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
5942 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
5943 * `err` or `result` depending on the state of `result_ok`.
5945 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
5947 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
5950 } LDKCResult_UpdateFeeDecodeErrorZ;
5953 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
5955 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
5957 * A pointer to the contents in the success state.
5958 * Reading from this pointer when `result_ok` is not set is undefined.
5960 struct LDKUpdateFulfillHTLC *result;
5962 * A pointer to the contents in the error state.
5963 * Reading from this pointer when `result_ok` is set is undefined.
5965 struct LDKDecodeError *err;
5966 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
5969 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
5970 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5971 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5973 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
5975 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
5976 * `err` or `result` depending on the state of `result_ok`.
5978 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
5980 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
5983 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
5986 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
5988 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
5990 * A pointer to the contents in the success state.
5991 * Reading from this pointer when `result_ok` is not set is undefined.
5993 struct LDKUpdateAddHTLC *result;
5995 * A pointer to the contents in the error state.
5996 * Reading from this pointer when `result_ok` is set is undefined.
5998 struct LDKDecodeError *err;
5999 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
6002 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
6003 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
6004 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6006 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
6008 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
6009 * `err` or `result` depending on the state of `result_ok`.
6011 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
6013 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
6016 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
6021 * A ping message to be sent or received from a peer
6023 typedef struct MUST_USE_STRUCT LDKPing {
6025 * A pointer to the opaque Rust object.
6026 * Nearly everywhere, inner must be non-null, however in places where
6027 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6029 LDKnativePing *inner;
6031 * Indicates that this is the only struct which contains the same pointer.
6032 * Rust functions which take ownership of an object provided via an argument require
6033 * this to be true and invalidate the object pointed to by inner.
6039 * The contents of CResult_PingDecodeErrorZ
6041 typedef union LDKCResult_PingDecodeErrorZPtr {
6043 * A pointer to the contents in the success state.
6044 * Reading from this pointer when `result_ok` is not set is undefined.
6046 struct LDKPing *result;
6048 * A pointer to the contents in the error state.
6049 * Reading from this pointer when `result_ok` is set is undefined.
6051 struct LDKDecodeError *err;
6052 } LDKCResult_PingDecodeErrorZPtr;
6055 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
6056 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
6057 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6059 typedef struct LDKCResult_PingDecodeErrorZ {
6061 * The contents of this CResult_PingDecodeErrorZ, accessible via either
6062 * `err` or `result` depending on the state of `result_ok`.
6064 union LDKCResult_PingDecodeErrorZPtr contents;
6066 * Whether this CResult_PingDecodeErrorZ represents a success state.
6069 } LDKCResult_PingDecodeErrorZ;
6074 * A pong message to be sent or received from a peer
6076 typedef struct MUST_USE_STRUCT LDKPong {
6078 * A pointer to the opaque Rust object.
6079 * Nearly everywhere, inner must be non-null, however in places where
6080 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6082 LDKnativePong *inner;
6084 * Indicates that this is the only struct which contains the same pointer.
6085 * Rust functions which take ownership of an object provided via an argument require
6086 * this to be true and invalidate the object pointed to by inner.
6092 * The contents of CResult_PongDecodeErrorZ
6094 typedef union LDKCResult_PongDecodeErrorZPtr {
6096 * A pointer to the contents in the success state.
6097 * Reading from this pointer when `result_ok` is not set is undefined.
6099 struct LDKPong *result;
6101 * A pointer to the contents in the error state.
6102 * Reading from this pointer when `result_ok` is set is undefined.
6104 struct LDKDecodeError *err;
6105 } LDKCResult_PongDecodeErrorZPtr;
6108 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
6109 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
6110 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6112 typedef struct LDKCResult_PongDecodeErrorZ {
6114 * The contents of this CResult_PongDecodeErrorZ, accessible via either
6115 * `err` or `result` depending on the state of `result_ok`.
6117 union LDKCResult_PongDecodeErrorZPtr contents;
6119 * Whether this CResult_PongDecodeErrorZ represents a success state.
6122 } LDKCResult_PongDecodeErrorZ;
6125 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
6127 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6129 * A pointer to the contents in the success state.
6130 * Reading from this pointer when `result_ok` is not set is undefined.
6132 struct LDKUnsignedChannelAnnouncement *result;
6134 * A pointer to the contents in the error state.
6135 * Reading from this pointer when `result_ok` is set is undefined.
6137 struct LDKDecodeError *err;
6138 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
6141 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
6142 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
6143 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6145 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
6147 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
6148 * `err` or `result` depending on the state of `result_ok`.
6150 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
6152 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
6155 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
6158 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
6160 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
6162 * A pointer to the contents in the success state.
6163 * Reading from this pointer when `result_ok` is not set is undefined.
6165 struct LDKChannelAnnouncement *result;
6167 * A pointer to the contents in the error state.
6168 * Reading from this pointer when `result_ok` is set is undefined.
6170 struct LDKDecodeError *err;
6171 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
6174 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
6175 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
6176 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6178 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
6180 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
6181 * `err` or `result` depending on the state of `result_ok`.
6183 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
6185 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
6188 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
6193 * The unsigned part of a channel_update
6195 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
6197 * A pointer to the opaque Rust object.
6198 * Nearly everywhere, inner must be non-null, however in places where
6199 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6201 LDKnativeUnsignedChannelUpdate *inner;
6203 * Indicates that this is the only struct which contains the same pointer.
6204 * Rust functions which take ownership of an object provided via an argument require
6205 * this to be true and invalidate the object pointed to by inner.
6208 } LDKUnsignedChannelUpdate;
6211 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
6213 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
6215 * A pointer to the contents in the success state.
6216 * Reading from this pointer when `result_ok` is not set is undefined.
6218 struct LDKUnsignedChannelUpdate *result;
6220 * A pointer to the contents in the error state.
6221 * Reading from this pointer when `result_ok` is set is undefined.
6223 struct LDKDecodeError *err;
6224 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
6227 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
6228 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
6229 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6231 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
6233 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
6234 * `err` or `result` depending on the state of `result_ok`.
6236 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
6238 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
6241 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
6244 * The contents of CResult_ChannelUpdateDecodeErrorZ
6246 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
6248 * A pointer to the contents in the success state.
6249 * Reading from this pointer when `result_ok` is not set is undefined.
6251 struct LDKChannelUpdate *result;
6253 * A pointer to the contents in the error state.
6254 * Reading from this pointer when `result_ok` is set is undefined.
6256 struct LDKDecodeError *err;
6257 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
6260 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
6261 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
6262 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6264 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
6266 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
6267 * `err` or `result` depending on the state of `result_ok`.
6269 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
6271 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
6274 } LDKCResult_ChannelUpdateDecodeErrorZ;
6277 * The contents of CResult_ErrorMessageDecodeErrorZ
6279 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
6281 * A pointer to the contents in the success state.
6282 * Reading from this pointer when `result_ok` is not set is undefined.
6284 struct LDKErrorMessage *result;
6286 * A pointer to the contents in the error state.
6287 * Reading from this pointer when `result_ok` is set is undefined.
6289 struct LDKDecodeError *err;
6290 } LDKCResult_ErrorMessageDecodeErrorZPtr;
6293 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
6294 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
6295 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6297 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
6299 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
6300 * `err` or `result` depending on the state of `result_ok`.
6302 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
6304 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
6307 } LDKCResult_ErrorMessageDecodeErrorZ;
6312 * The unsigned part of a node_announcement
6314 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
6316 * A pointer to the opaque Rust object.
6317 * Nearly everywhere, inner must be non-null, however in places where
6318 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6320 LDKnativeUnsignedNodeAnnouncement *inner;
6322 * Indicates that this is the only struct which contains the same pointer.
6323 * Rust functions which take ownership of an object provided via an argument require
6324 * this to be true and invalidate the object pointed to by inner.
6327 } LDKUnsignedNodeAnnouncement;
6330 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
6332 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6334 * A pointer to the contents in the success state.
6335 * Reading from this pointer when `result_ok` is not set is undefined.
6337 struct LDKUnsignedNodeAnnouncement *result;
6339 * A pointer to the contents in the error state.
6340 * Reading from this pointer when `result_ok` is set is undefined.
6342 struct LDKDecodeError *err;
6343 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
6346 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
6347 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
6348 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6350 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
6352 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
6353 * `err` or `result` depending on the state of `result_ok`.
6355 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
6357 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
6360 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
6363 * The contents of CResult_NodeAnnouncementDecodeErrorZ
6365 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
6367 * A pointer to the contents in the success state.
6368 * Reading from this pointer when `result_ok` is not set is undefined.
6370 struct LDKNodeAnnouncement *result;
6372 * A pointer to the contents in the error state.
6373 * Reading from this pointer when `result_ok` is set is undefined.
6375 struct LDKDecodeError *err;
6376 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
6379 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
6380 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
6381 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6383 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
6385 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
6386 * `err` or `result` depending on the state of `result_ok`.
6388 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
6390 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
6393 } LDKCResult_NodeAnnouncementDecodeErrorZ;
6396 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
6398 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
6400 * A pointer to the contents in the success state.
6401 * Reading from this pointer when `result_ok` is not set is undefined.
6403 struct LDKQueryShortChannelIds *result;
6405 * A pointer to the contents in the error state.
6406 * Reading from this pointer when `result_ok` is set is undefined.
6408 struct LDKDecodeError *err;
6409 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
6412 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
6413 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
6414 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6416 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
6418 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
6419 * `err` or `result` depending on the state of `result_ok`.
6421 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
6423 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
6426 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
6431 * A reply_short_channel_ids_end message is sent as a reply to a
6432 * query_short_channel_ids message. The query recipient makes a best
6433 * effort to respond based on their local network view which may not be
6434 * a perfect view of the network.
6436 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
6438 * A pointer to the opaque Rust object.
6439 * Nearly everywhere, inner must be non-null, however in places where
6440 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6442 LDKnativeReplyShortChannelIdsEnd *inner;
6444 * Indicates that this is the only struct which contains the same pointer.
6445 * Rust functions which take ownership of an object provided via an argument require
6446 * this to be true and invalidate the object pointed to by inner.
6449 } LDKReplyShortChannelIdsEnd;
6452 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
6454 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6456 * A pointer to the contents in the success state.
6457 * Reading from this pointer when `result_ok` is not set is undefined.
6459 struct LDKReplyShortChannelIdsEnd *result;
6461 * A pointer to the contents in the error state.
6462 * Reading from this pointer when `result_ok` is set is undefined.
6464 struct LDKDecodeError *err;
6465 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
6468 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
6469 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
6470 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6472 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
6474 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
6475 * `err` or `result` depending on the state of `result_ok`.
6477 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
6479 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
6482 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
6485 * The contents of CResult_QueryChannelRangeDecodeErrorZ
6487 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
6489 * A pointer to the contents in the success state.
6490 * Reading from this pointer when `result_ok` is not set is undefined.
6492 struct LDKQueryChannelRange *result;
6494 * A pointer to the contents in the error state.
6495 * Reading from this pointer when `result_ok` is set is undefined.
6497 struct LDKDecodeError *err;
6498 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
6501 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
6502 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
6503 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6505 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
6507 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
6508 * `err` or `result` depending on the state of `result_ok`.
6510 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
6512 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
6515 } LDKCResult_QueryChannelRangeDecodeErrorZ;
6518 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
6520 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
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 LDKReplyChannelRange *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_ReplyChannelRangeDecodeErrorZPtr;
6534 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
6535 * containing a crate::lightning::ln::msgs::ReplyChannelRange 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_ReplyChannelRangeDecodeErrorZ {
6540 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
6541 * `err` or `result` depending on the state of `result_ok`.
6543 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
6545 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
6548 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
6553 * A gossip_timestamp_filter message is used by a node to request
6554 * gossip relay for messages in the requested time range when the
6555 * gossip_queries feature has been negotiated.
6557 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
6559 * A pointer to the opaque Rust object.
6560 * Nearly everywhere, inner must be non-null, however in places where
6561 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6563 LDKnativeGossipTimestampFilter *inner;
6565 * Indicates that this is the only struct which contains the same pointer.
6566 * Rust functions which take ownership of an object provided via an argument require
6567 * this to be true and invalidate the object pointed to by inner.
6570 } LDKGossipTimestampFilter;
6573 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
6575 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
6577 * A pointer to the contents in the success state.
6578 * Reading from this pointer when `result_ok` is not set is undefined.
6580 struct LDKGossipTimestampFilter *result;
6582 * A pointer to the contents in the error state.
6583 * Reading from this pointer when `result_ok` is set is undefined.
6585 struct LDKDecodeError *err;
6586 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
6589 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
6590 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
6591 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6593 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
6595 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
6596 * `err` or `result` depending on the state of `result_ok`.
6598 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
6600 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
6603 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
6606 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
6609 typedef enum LDKSignOrCreationError_Tag {
6611 * An error occurred during signing
6613 LDKSignOrCreationError_SignError,
6615 * An error occurred while building the transaction
6617 LDKSignOrCreationError_CreationError,
6619 * Must be last for serialization purposes
6621 LDKSignOrCreationError_Sentinel,
6622 } LDKSignOrCreationError_Tag;
6624 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
6625 LDKSignOrCreationError_Tag tag;
6628 enum LDKCreationError creation_error;
6631 } LDKSignOrCreationError;
6634 * The contents of CResult_InvoiceSignOrCreationErrorZ
6636 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
6638 * A pointer to the contents in the success state.
6639 * Reading from this pointer when `result_ok` is not set is undefined.
6641 struct LDKInvoice *result;
6643 * A pointer to the contents in the error state.
6644 * Reading from this pointer when `result_ok` is set is undefined.
6646 struct LDKSignOrCreationError *err;
6647 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
6650 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
6651 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
6652 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6654 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
6656 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
6657 * `err` or `result` depending on the state of `result_ok`.
6659 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
6661 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
6664 } LDKCResult_InvoiceSignOrCreationErrorZ;
6667 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
6669 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
6671 * A pointer to the contents in the success state.
6672 * Reading from this pointer when `result_ok` is not set is undefined.
6674 struct LDKSpendableOutputDescriptor *result;
6676 * A pointer to the contents in the error state.
6677 * Reading from this pointer when `result_ok` is set is undefined.
6679 struct LDKDecodeError *err;
6680 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
6683 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
6684 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
6685 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6687 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
6689 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
6690 * `err` or `result` depending on the state of `result_ok`.
6692 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
6694 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
6697 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
6700 * The contents of CResult_SignDecodeErrorZ
6702 typedef union LDKCResult_SignDecodeErrorZPtr {
6704 * A pointer to the contents in the success state.
6705 * Reading from this pointer when `result_ok` is not set is undefined.
6707 struct LDKSign *result;
6709 * A pointer to the contents in the error state.
6710 * Reading from this pointer when `result_ok` is set is undefined.
6712 struct LDKDecodeError *err;
6713 } LDKCResult_SignDecodeErrorZPtr;
6716 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
6717 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
6718 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6720 typedef struct LDKCResult_SignDecodeErrorZ {
6722 * The contents of this CResult_SignDecodeErrorZ, accessible via either
6723 * `err` or `result` depending on the state of `result_ok`.
6725 union LDKCResult_SignDecodeErrorZPtr contents;
6727 * Whether this CResult_SignDecodeErrorZ represents a success state.
6730 } LDKCResult_SignDecodeErrorZ;
6733 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
6734 * allows recovering the exact public key which created the signature given the message.
6736 typedef struct LDKRecoverableSignature {
6738 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
6741 uint8_t serialized_form[68];
6742 } LDKRecoverableSignature;
6745 * The contents of CResult_RecoverableSignatureNoneZ
6747 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
6749 * A pointer to the contents in the success state.
6750 * Reading from this pointer when `result_ok` is not set is undefined.
6752 struct LDKRecoverableSignature *result;
6754 * Note that this value is always NULL, as there are no contents in the Err variant
6757 } LDKCResult_RecoverableSignatureNoneZPtr;
6760 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
6761 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
6762 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6764 typedef struct LDKCResult_RecoverableSignatureNoneZ {
6766 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
6767 * `err` or `result` depending on the state of `result_ok`.
6769 union LDKCResult_RecoverableSignatureNoneZPtr contents;
6771 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
6774 } LDKCResult_RecoverableSignatureNoneZ;
6777 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
6778 * This corresponds to std::vector in C++
6780 typedef struct LDKCVec_CVec_u8ZZ {
6782 * The elements in the array.
6783 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6785 struct LDKCVec_u8Z *data;
6787 * The number of elements pointed to by `data`.
6790 } LDKCVec_CVec_u8ZZ;
6793 * The contents of CResult_CVec_CVec_u8ZZNoneZ
6795 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
6797 * A pointer to the contents in the success state.
6798 * Reading from this pointer when `result_ok` is not set is undefined.
6800 struct LDKCVec_CVec_u8ZZ *result;
6802 * Note that this value is always NULL, as there are no contents in the Err variant
6805 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
6808 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
6809 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
6810 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6812 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
6814 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
6815 * `err` or `result` depending on the state of `result_ok`.
6817 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
6819 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
6822 } LDKCResult_CVec_CVec_u8ZZNoneZ;
6827 * A simple implementation of Sign that just keeps the private keys in memory.
6829 * This implementation performs no policy checks and is insufficient by itself as
6830 * a secure external signer.
6832 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
6834 * A pointer to the opaque Rust object.
6835 * Nearly everywhere, inner must be non-null, however in places where
6836 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6838 LDKnativeInMemorySigner *inner;
6840 * Indicates that this is the only struct which contains the same pointer.
6841 * Rust functions which take ownership of an object provided via an argument require
6842 * this to be true and invalidate the object pointed to by inner.
6845 } LDKInMemorySigner;
6848 * The contents of CResult_InMemorySignerDecodeErrorZ
6850 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
6852 * A pointer to the contents in the success state.
6853 * Reading from this pointer when `result_ok` is not set is undefined.
6855 struct LDKInMemorySigner *result;
6857 * A pointer to the contents in the error state.
6858 * Reading from this pointer when `result_ok` is set is undefined.
6860 struct LDKDecodeError *err;
6861 } LDKCResult_InMemorySignerDecodeErrorZPtr;
6864 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
6865 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
6866 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6868 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
6870 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
6871 * `err` or `result` depending on the state of `result_ok`.
6873 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
6875 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
6878 } LDKCResult_InMemorySignerDecodeErrorZ;
6881 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
6882 * This corresponds to std::vector in C++
6884 typedef struct LDKCVec_TxOutZ {
6886 * The elements in the array.
6887 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6889 struct LDKTxOut *data;
6891 * The number of elements pointed to by `data`.
6897 * The contents of CResult_TransactionNoneZ
6899 typedef union LDKCResult_TransactionNoneZPtr {
6901 * A pointer to the contents in the success state.
6902 * Reading from this pointer when `result_ok` is not set is undefined.
6904 struct LDKTransaction *result;
6906 * Note that this value is always NULL, as there are no contents in the Err variant
6909 } LDKCResult_TransactionNoneZPtr;
6912 * A CResult_TransactionNoneZ represents the result of a fallible operation,
6913 * containing a crate::c_types::Transaction on success and a () on failure.
6914 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6916 typedef struct LDKCResult_TransactionNoneZ {
6918 * The contents of this CResult_TransactionNoneZ, accessible via either
6919 * `err` or `result` depending on the state of `result_ok`.
6921 union LDKCResult_TransactionNoneZPtr contents;
6923 * Whether this CResult_TransactionNoneZ represents a success state.
6926 } LDKCResult_TransactionNoneZ;
6929 * The contents of CResult_NoneErrorZ
6931 typedef union LDKCResult_NoneErrorZPtr {
6933 * Note that this value is always NULL, as there are no contents in the OK variant
6937 * A pointer to the contents in the error state.
6938 * Reading from this pointer when `result_ok` is set is undefined.
6940 enum LDKIOError *err;
6941 } LDKCResult_NoneErrorZPtr;
6944 * A CResult_NoneErrorZ represents the result of a fallible operation,
6945 * containing a () on success and a crate::c_types::IOError on failure.
6946 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6948 typedef struct LDKCResult_NoneErrorZ {
6950 * The contents of this CResult_NoneErrorZ, accessible via either
6951 * `err` or `result` depending on the state of `result_ok`.
6953 union LDKCResult_NoneErrorZPtr contents;
6955 * Whether this CResult_NoneErrorZ represents a success state.
6958 } LDKCResult_NoneErrorZ;
6961 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
6962 * This corresponds to std::vector in C++
6964 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
6966 * The elements in the array.
6967 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6969 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
6971 * The number of elements pointed to by `data`.
6974 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
6977 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
6979 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
6981 * A pointer to the contents in the success state.
6982 * Reading from this pointer when `result_ok` is not set is undefined.
6984 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
6986 * A pointer to the contents in the error state.
6987 * Reading from this pointer when `result_ok` is set is undefined.
6989 enum LDKIOError *err;
6990 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
6993 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
6994 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
6995 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6997 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
6999 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
7000 * `err` or `result` depending on the state of `result_ok`.
7002 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
7004 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
7007 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
7010 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
7013 typedef enum LDKAPIError_Tag {
7015 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
7016 * are documented, but generally indicates some precondition of a function was violated.
7018 LDKAPIError_APIMisuseError,
7020 * Due to a high feerate, we were unable to complete the request.
7021 * For example, this may be returned if the feerate implies we cannot open a channel at the
7022 * requested value, but opening a larger channel would succeed.
7024 LDKAPIError_FeeRateTooHigh,
7026 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
7027 * too-many-hops, etc).
7029 LDKAPIError_RouteError,
7031 * We were unable to complete the request as the Channel required to do so is unable to
7032 * complete the request (or was not found). This can take many forms, including disconnected
7033 * peer, channel at capacity, channel shutting down, etc.
7035 LDKAPIError_ChannelUnavailable,
7037 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
7038 * attempted action to fail.
7040 LDKAPIError_MonitorUpdateFailed,
7042 * Must be last for serialization purposes
7044 LDKAPIError_Sentinel,
7047 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
7049 * A human-readable error message
7052 } LDKAPIError_LDKAPIMisuseError_Body;
7054 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
7056 * A human-readable error message
7060 * The feerate which was too high.
7063 } LDKAPIError_LDKFeeRateTooHigh_Body;
7065 typedef struct LDKAPIError_LDKRouteError_Body {
7067 * A human-readable error message
7070 } LDKAPIError_LDKRouteError_Body;
7072 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
7074 * A human-readable error message
7077 } LDKAPIError_LDKChannelUnavailable_Body;
7079 typedef struct MUST_USE_STRUCT LDKAPIError {
7080 LDKAPIError_Tag tag;
7082 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
7083 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
7084 LDKAPIError_LDKRouteError_Body route_error;
7085 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
7090 * The contents of CResult_NoneAPIErrorZ
7092 typedef union LDKCResult_NoneAPIErrorZPtr {
7094 * Note that this value is always NULL, as there are no contents in the OK variant
7098 * A pointer to the contents in the error state.
7099 * Reading from this pointer when `result_ok` is set is undefined.
7101 struct LDKAPIError *err;
7102 } LDKCResult_NoneAPIErrorZPtr;
7105 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
7106 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
7107 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7109 typedef struct LDKCResult_NoneAPIErrorZ {
7111 * The contents of this CResult_NoneAPIErrorZ, accessible via either
7112 * `err` or `result` depending on the state of `result_ok`.
7114 union LDKCResult_NoneAPIErrorZPtr contents;
7116 * Whether this CResult_NoneAPIErrorZ represents a success state.
7119 } LDKCResult_NoneAPIErrorZ;
7122 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
7123 * This corresponds to std::vector in C++
7125 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
7127 * The elements in the array.
7128 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7130 struct LDKCResult_NoneAPIErrorZ *data;
7132 * The number of elements pointed to by `data`.
7135 } LDKCVec_CResult_NoneAPIErrorZZ;
7138 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
7139 * This corresponds to std::vector in C++
7141 typedef struct LDKCVec_APIErrorZ {
7143 * The elements in the array.
7144 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7146 struct LDKAPIError *data;
7148 * The number of elements pointed to by `data`.
7151 } LDKCVec_APIErrorZ;
7154 * If a payment fails to send, it can be in one of several states. This enum is returned as the
7155 * Err() type describing which state the payment is in, see the description of individual enum
7158 typedef enum LDKPaymentSendFailure_Tag {
7160 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
7161 * send the payment at all. No channel state has been changed or messages sent to peers, and
7162 * once you've changed the parameter at error, you can freely retry the payment in full.
7164 LDKPaymentSendFailure_ParameterError,
7166 * A parameter in a single path which was passed to send_payment was invalid, preventing us
7167 * from attempting to send the payment at all. No channel state has been changed or messages
7168 * sent to peers, and once you've changed the parameter at error, you can freely retry the
7171 * The results here are ordered the same as the paths in the route object which was passed to
7174 LDKPaymentSendFailure_PathParameterError,
7176 * All paths which were attempted failed to send, with no channel state change taking place.
7177 * You can freely retry the payment in full (though you probably want to do so over different
7178 * paths than the ones selected).
7180 LDKPaymentSendFailure_AllFailedRetrySafe,
7182 * Some paths which were attempted failed to send, though possibly not all. At least some
7183 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
7184 * in over-/re-payment.
7186 * The results here are ordered the same as the paths in the route object which was passed to
7187 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
7188 * retried (though there is currently no API with which to do so).
7190 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
7191 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
7192 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
7193 * with the latest update_id.
7195 LDKPaymentSendFailure_PartialFailure,
7197 * Must be last for serialization purposes
7199 LDKPaymentSendFailure_Sentinel,
7200 } LDKPaymentSendFailure_Tag;
7202 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
7203 LDKPaymentSendFailure_Tag tag;
7206 struct LDKAPIError parameter_error;
7209 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
7212 struct LDKCVec_APIErrorZ all_failed_retry_safe;
7215 struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
7218 } LDKPaymentSendFailure;
7221 * The contents of CResult_NonePaymentSendFailureZ
7223 typedef union LDKCResult_NonePaymentSendFailureZPtr {
7225 * Note that this value is always NULL, as there are no contents in the OK variant
7229 * A pointer to the contents in the error state.
7230 * Reading from this pointer when `result_ok` is set is undefined.
7232 struct LDKPaymentSendFailure *err;
7233 } LDKCResult_NonePaymentSendFailureZPtr;
7236 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
7237 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7238 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7240 typedef struct LDKCResult_NonePaymentSendFailureZ {
7242 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
7243 * `err` or `result` depending on the state of `result_ok`.
7245 union LDKCResult_NonePaymentSendFailureZPtr contents;
7247 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
7250 } LDKCResult_NonePaymentSendFailureZ;
7253 * A tuple of 2 elements. See the individual fields for the types contained.
7255 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
7257 * The element at position 0
7259 struct LDKThirtyTwoBytes a;
7261 * The element at position 1
7263 struct LDKThirtyTwoBytes b;
7264 } LDKC2Tuple_PaymentHashPaymentSecretZ;
7267 * The contents of CResult_PaymentSecretAPIErrorZ
7269 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
7271 * A pointer to the contents in the success state.
7272 * Reading from this pointer when `result_ok` is not set is undefined.
7274 struct LDKThirtyTwoBytes *result;
7276 * A pointer to the contents in the error state.
7277 * Reading from this pointer when `result_ok` is set is undefined.
7279 struct LDKAPIError *err;
7280 } LDKCResult_PaymentSecretAPIErrorZPtr;
7283 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
7284 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7285 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7287 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
7289 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
7290 * `err` or `result` depending on the state of `result_ok`.
7292 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
7294 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
7297 } LDKCResult_PaymentSecretAPIErrorZ;
7300 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
7301 * This corresponds to std::vector in C++
7303 typedef struct LDKCVec_ChannelMonitorZ {
7305 * The elements in the array.
7306 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7308 struct LDKChannelMonitor *data;
7310 * The number of elements pointed to by `data`.
7313 } LDKCVec_ChannelMonitorZ;
7316 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
7317 * blocks are connected and disconnected.
7319 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
7320 * responsible for maintaining a set of monitors such that they can be updated accordingly as
7321 * channel state changes and HTLCs are resolved. See method documentation for specific
7324 * Implementations **must** ensure that updates are successfully applied and persisted upon method
7325 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
7326 * without taking any further action such as persisting the current state.
7328 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
7329 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
7330 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
7331 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
7332 * multiple instances.
7334 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
7335 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
7336 * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
7338 typedef struct LDKWatch {
7340 * An opaque pointer which is passed to your function implementations as an argument.
7341 * This has no meaning in the LDK, and can be NULL or any other value.
7345 * Watches a channel identified by `funding_txo` using `monitor`.
7347 * Implementations are responsible for watching the chain for the funding transaction along
7348 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
7349 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
7351 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
7352 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
7353 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
7355 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
7357 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
7359 * Implementations must call [`update_monitor`] with the given update. See
7360 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
7362 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
7363 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
7365 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
7367 * Returns any monitor events since the last call. Subsequent calls must only return new
7370 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
7372 * Frees any resources associated with this object given its this_arg pointer.
7373 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7375 void (*free)(void *this_arg);
7379 * An interface to send a transaction to the Bitcoin network.
7381 typedef struct LDKBroadcasterInterface {
7383 * An opaque pointer which is passed to your function implementations as an argument.
7384 * This has no meaning in the LDK, and can be NULL or any other value.
7388 * Sends a transaction out to (hopefully) be mined.
7390 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
7392 * Frees any resources associated with this object given its this_arg pointer.
7393 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7395 void (*free)(void *this_arg);
7396 } LDKBroadcasterInterface;
7399 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
7400 * own the memory pointed to by data.
7402 typedef struct LDKu8slice {
7404 * A pointer to the byte buffer
7406 const uint8_t *data;
7408 * The number of bytes pointed to by `data`.
7414 * A trait to describe an object which can get user secrets and key material.
7416 typedef struct LDKKeysInterface {
7418 * An opaque pointer which is passed to your function implementations as an argument.
7419 * This has no meaning in the LDK, and can be NULL or any other value.
7423 * Get node secret key (aka node_id or network_key).
7425 * This method must return the same value each time it is called.
7427 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
7429 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
7431 * This method should return a different value each time it is called, to avoid linking
7432 * on-chain funds across channels as controlled to the same user.
7434 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
7436 * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
7439 * This method should return a different value each time it is called, to avoid linking
7440 * on-chain funds across channels as controlled to the same user.
7442 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
7444 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
7445 * restarted with some stale data!
7447 * This method must return a different value each time it is called.
7449 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
7451 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
7452 * onion packets and for temporary channel IDs. There is no requirement that these be
7453 * persisted anywhere, though they must be unique across restarts.
7455 * This method must return a different value each time it is called.
7457 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
7459 * Reads a `Signer` for this `KeysInterface` from the given input stream.
7460 * This is only called during deserialization of other objects which contain
7461 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
7462 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
7463 * contain no versioning scheme. You may wish to include your own version prefix and ensure
7464 * you've read all of the provided bytes to ensure no corruption occurred.
7466 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
7468 * Sign an invoice's preimage (note that this is the preimage of the invoice, not the HTLC's
7469 * preimage). By parameterizing by the preimage instead of the hash, we allow implementors of
7470 * this trait to parse the invoice and make sure they're signing what they expect, rather than
7471 * blindly signing the hash.
7473 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKCVec_u8Z invoice_preimage);
7475 * Frees any resources associated with this object given its this_arg pointer.
7476 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7478 void (*free)(void *this_arg);
7482 * A trait which should be implemented to provide feerate information on a number of time
7485 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
7486 * called from inside the library in response to chain events, P2P events, or timer events).
7488 typedef struct LDKFeeEstimator {
7490 * An opaque pointer which is passed to your function implementations as an argument.
7491 * This has no meaning in the LDK, and can be NULL or any other value.
7495 * Gets estimated satoshis of fee required per 1000 Weight-Units.
7497 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
7498 * don't put us below 1 satoshi-per-byte).
7500 * This translates to:
7501 * * satoshis-per-byte * 250
7502 * * ceil(satoshis-per-kbyte / 4)
7504 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
7506 * Frees any resources associated with this object given its this_arg pointer.
7507 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7509 void (*free)(void *this_arg);
7513 * A trait encapsulating the operations required of a logger
7515 typedef struct LDKLogger {
7517 * An opaque pointer which is passed to your function implementations as an argument.
7518 * This has no meaning in the LDK, and can be NULL or any other value.
7524 void (*log)(const void *this_arg, const char *record);
7526 * Frees any resources associated with this object given its this_arg pointer.
7527 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7529 void (*free)(void *this_arg);
7535 * Manager which keeps track of a number of channels and sends messages to the appropriate
7536 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
7538 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
7539 * to individual Channels.
7541 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
7542 * all peers during write/read (though does not modify this instance, only the instance being
7543 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
7544 * called funding_transaction_generated for outbound channels).
7546 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
7547 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
7548 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
7549 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
7550 * the serialization process). If the deserialized version is out-of-date compared to the
7551 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
7552 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
7554 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
7555 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
7556 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
7557 * block_connected() to step towards your best block) upon deserialization before using the
7560 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
7561 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
7562 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
7563 * offline for a full minute. In order to track this, you must call
7564 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
7566 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
7567 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
7568 * essentially you should default to using a SimpleRefChannelManager, and use a
7569 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
7570 * you're using lightning-net-tokio.
7572 typedef struct MUST_USE_STRUCT LDKChannelManager {
7574 * A pointer to the opaque Rust object.
7575 * Nearly everywhere, inner must be non-null, however in places where
7576 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7578 LDKnativeChannelManager *inner;
7580 * Indicates that this is the only struct which contains the same pointer.
7581 * Rust functions which take ownership of an object provided via an argument require
7582 * this to be true and invalidate the object pointed to by inner.
7585 } LDKChannelManager;
7588 * A tuple of 2 elements. See the individual fields for the types contained.
7590 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
7592 * The element at position 0
7594 struct LDKThirtyTwoBytes a;
7596 * The element at position 1
7598 struct LDKChannelManager b;
7599 } LDKC2Tuple_BlockHashChannelManagerZ;
7602 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
7604 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
7606 * A pointer to the contents in the success state.
7607 * Reading from this pointer when `result_ok` is not set is undefined.
7609 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
7611 * A pointer to the contents in the error state.
7612 * Reading from this pointer when `result_ok` is set is undefined.
7614 struct LDKDecodeError *err;
7615 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
7618 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
7619 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7620 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7622 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
7624 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
7625 * `err` or `result` depending on the state of `result_ok`.
7627 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
7629 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
7632 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
7635 * A trait indicating an object may generate message send events
7637 typedef struct LDKMessageSendEventsProvider {
7639 * An opaque pointer which is passed to your function implementations as an argument.
7640 * This has no meaning in the LDK, and can be NULL or any other value.
7644 * Gets the list of pending events which were generated by previous actions, clearing the list
7647 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
7649 * Frees any resources associated with this object given its this_arg pointer.
7650 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7652 void (*free)(void *this_arg);
7653 } LDKMessageSendEventsProvider;
7656 * A trait implemented for objects handling events from [`EventsProvider`].
7658 typedef struct LDKEventHandler {
7660 * An opaque pointer which is passed to your function implementations as an argument.
7661 * This has no meaning in the LDK, and can be NULL or any other value.
7665 * Handles the given [`Event`].
7667 * See [`EventsProvider`] for details that must be considered when implementing this method.
7669 void (*handle_event)(const void *this_arg, struct LDKEvent event);
7671 * Frees any resources associated with this object given its this_arg pointer.
7672 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7674 void (*free)(void *this_arg);
7678 * A trait indicating an object may generate events.
7680 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
7684 * See [`process_pending_events`] for requirements around event processing.
7686 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
7687 * event since the last invocation. The handler must either act upon the event immediately
7688 * or preserve it for later handling.
7690 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
7691 * consult the provider's documentation on the implication of processing events and how a handler
7692 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
7693 * [`ChainMonitor::process_pending_events`]).
7695 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
7698 * [`process_pending_events`]: Self::process_pending_events
7699 * [`handle_event`]: EventHandler::handle_event
7700 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
7701 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
7703 typedef struct LDKEventsProvider {
7705 * An opaque pointer which is passed to your function implementations as an argument.
7706 * This has no meaning in the LDK, and can be NULL or any other value.
7710 * Processes any events generated since the last call using the given event handler.
7712 * Subsequent calls must only process new events. However, handlers must be capable of handling
7713 * duplicate events across process restarts. This may occur if the provider was recovered from
7714 * an old state (i.e., it hadn't been successfully persisted after processing pending events).
7716 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
7718 * Frees any resources associated with this object given its this_arg pointer.
7719 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7721 void (*free)(void *this_arg);
7722 } LDKEventsProvider;
7727 * Configuration we set when applicable.
7729 * Default::default() provides sane defaults.
7731 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
7733 * A pointer to the opaque Rust object.
7734 * Nearly everywhere, inner must be non-null, however in places where
7735 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7737 LDKnativeChannelHandshakeConfig *inner;
7739 * Indicates that this is the only struct which contains the same pointer.
7740 * Rust functions which take ownership of an object provided via an argument require
7741 * this to be true and invalidate the object pointed to by inner.
7744 } LDKChannelHandshakeConfig;
7749 * Optional channel limits which are applied during channel creation.
7751 * These limits are only applied to our counterparty's limits, not our own.
7753 * Use 0/<type>::max_value() as appropriate to skip checking.
7755 * Provides sane defaults for most configurations.
7757 * Most additional limits are disabled except those with which specify a default in individual
7758 * field documentation. Note that this may result in barely-usable channels, but since they
7759 * are applied mostly only to incoming channels that's not much of a problem.
7761 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
7763 * A pointer to the opaque Rust object.
7764 * Nearly everywhere, inner must be non-null, however in places where
7765 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7767 LDKnativeChannelHandshakeLimits *inner;
7769 * Indicates that this is the only struct which contains the same pointer.
7770 * Rust functions which take ownership of an object provided via an argument require
7771 * this to be true and invalidate the object pointed to by inner.
7774 } LDKChannelHandshakeLimits;
7779 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
7781 * Default::default() provides sane defaults for most configurations
7782 * (but currently with 0 relay fees!)
7784 typedef struct MUST_USE_STRUCT LDKUserConfig {
7786 * A pointer to the opaque Rust object.
7787 * Nearly everywhere, inner must be non-null, however in places where
7788 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7790 LDKnativeUserConfig *inner;
7792 * Indicates that this is the only struct which contains the same pointer.
7793 * Rust functions which take ownership of an object provided via an argument require
7794 * this to be true and invalidate the object pointed to by inner.
7800 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
7803 typedef struct LDKAccess {
7805 * An opaque pointer which is passed to your function implementations as an argument.
7806 * This has no meaning in the LDK, and can be NULL or any other value.
7810 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
7811 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
7814 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
7816 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
7818 * Frees any resources associated with this object given its this_arg pointer.
7819 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7821 void (*free)(void *this_arg);
7825 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
7828 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
7829 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
7830 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
7833 typedef struct LDKListen {
7835 * An opaque pointer which is passed to your function implementations as an argument.
7836 * This has no meaning in the LDK, and can be NULL or any other value.
7840 * Notifies the listener that a block was added at the given height.
7842 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
7844 * Notifies the listener that a block was removed at the given height.
7846 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
7848 * Frees any resources associated with this object given its this_arg pointer.
7849 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7851 void (*free)(void *this_arg);
7855 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
7856 * unconfirmed during a chain reorganization.
7858 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
7859 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
7860 * related to registered transactions and outputs. Upon notification, it would pass along the
7861 * matching transactions using this interface.
7865 * The intended use is as follows:
7866 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
7867 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
7868 * that has been reorganized out of the chain.
7869 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
7873 * Clients must call these methods in chain order. Specifically:
7874 * - Transactions confirmed in a block must be given before transactions confirmed in a later
7876 * - Dependent transactions within the same block must be given in topological order, possibly in
7878 * - Unconfirmed transactions must be given after the original confirmations and before any
7881 * See individual method documentation for further details.
7883 * [`transactions_confirmed`]: Self::transactions_confirmed
7884 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
7885 * [`best_block_updated`]: Self::best_block_updated
7886 * [`get_relevant_txids`]: Self::get_relevant_txids
7888 typedef struct LDKConfirm {
7890 * An opaque pointer which is passed to your function implementations as an argument.
7891 * This has no meaning in the LDK, and can be NULL or any other value.
7895 * Processes transactions confirmed in a block with a given header and height.
7897 * Should be called for any transactions registered by [`Filter::register_tx`] or any
7898 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
7899 * appearing in the same block do not need to be included in the same call; instead, multiple
7900 * calls with additional transactions may be made so long as they are made in [chain order].
7902 * May be called before or after [`best_block_updated`] for the corresponding block. However,
7903 * in the event of a chain reorganization, it must not be called with a `header` that is no
7904 * longer in the chain as of the last call to [`best_block_updated`].
7906 * [chain order]: Confirm#Order
7907 * [`best_block_updated`]: Self::best_block_updated
7909 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
7911 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
7913 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
7914 * reorganized out of the best chain. Once called, the given transaction should not be returned
7915 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
7917 * [`get_relevant_txids`]: Self::get_relevant_txids
7918 * [`transactions_confirmed`]: Self::transactions_confirmed
7920 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
7922 * Processes an update to the best header connected at the given height.
7924 * Should be called when a new header is available but may be skipped for intermediary blocks
7925 * if they become available at the same time.
7927 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
7929 * Returns transactions that should be monitored for reorganization out of the chain.
7931 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
7932 * confirmations to be safe from a chain reorganization. Should not include any transactions
7933 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
7935 * May be called to determine the subset of transactions that must still be monitored for
7936 * reorganization. Will be idempotent between calls but may change as a result of calls to the
7937 * other interface methods. Thus, this is useful to determine which transactions may need to be
7938 * given to [`transaction_unconfirmed`].
7940 * [`transactions_confirmed`]: Self::transactions_confirmed
7941 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
7943 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
7945 * Frees any resources associated with this object given its this_arg pointer.
7946 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7948 void (*free)(void *this_arg);
7954 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
7956 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
7957 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
7958 * the return value of [`Filter::register_output`].
7960 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
7961 * may have been spent there. See [`Filter::register_output`] for details.
7963 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
7964 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
7966 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
7968 * A pointer to the opaque Rust object.
7969 * Nearly everywhere, inner must be non-null, however in places where
7970 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7972 LDKnativeWatchedOutput *inner;
7974 * Indicates that this is the only struct which contains the same pointer.
7975 * Rust functions which take ownership of an object provided via an argument require
7976 * this to be true and invalidate the object pointed to by inner.
7982 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
7985 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
7986 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
7987 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
7988 * receiving full blocks from a chain source, any further filtering is unnecessary.
7990 * After an output has been registered, subsequent block retrievals from the chain source must not
7991 * exclude any transactions matching the new criteria nor any in-block descendants of such
7994 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
7995 * should not block on I/O. Implementations should instead queue the newly monitored data to be
7996 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
7997 * invocation that has called the `Filter` must return [`TemporaryFailure`].
7999 * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
8000 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
8001 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
8003 typedef struct LDKFilter {
8005 * An opaque pointer which is passed to your function implementations as an argument.
8006 * This has no meaning in the LDK, and can be NULL or any other value.
8010 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
8011 * a spending condition.
8013 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
8015 * Registers interest in spends of a transaction output.
8017 * Optionally, when `output.block_hash` is set, should return any transaction spending the
8018 * output that is found in the corresponding block along with its index.
8020 * This return value is useful for Electrum clients in order to supply in-block descendant
8021 * transactions which otherwise were not included. This is not necessary for other clients if
8022 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
8025 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
8027 * Frees any resources associated with this object given its this_arg pointer.
8028 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8030 void (*free)(void *this_arg);
8034 * `Persist` defines behavior for persisting channel monitors: this could mean
8035 * writing once to disk, and/or uploading to one or more backup services.
8037 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
8038 * to disk/backups. And, on every update, you **must** persist either the
8039 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
8040 * of situations such as revoking a transaction, then crashing before this
8041 * revocation can be persisted, then unintentionally broadcasting a revoked
8042 * transaction and losing money. This is a risk because previous channel states
8043 * are toxic, so it's important that whatever channel state is persisted is
8046 typedef struct LDKPersist {
8048 * An opaque pointer which is passed to your function implementations as an argument.
8049 * This has no meaning in the LDK, and can be NULL or any other value.
8053 * Persist a new channel's data. The data can be stored any way you want, but
8054 * the identifier provided by Rust-Lightning is the channel's outpoint (and
8055 * it is up to you to maintain a correct mapping between the outpoint and the
8056 * stored channel data). Note that you **must** persist every new monitor to
8057 * disk. See the `Persist` trait documentation for more details.
8059 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
8060 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
8062 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
8064 * Update one channel's data. The provided `ChannelMonitor` has already
8065 * applied the given update.
8067 * Note that on every update, you **must** persist either the
8068 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
8069 * the `Persist` trait documentation for more details.
8071 * If an implementer chooses to persist the updates only, they need to make
8072 * sure that all the updates are applied to the `ChannelMonitors` *before*
8073 * the set of channel monitors is given to the `ChannelManager`
8074 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
8075 * applying a monitor update to a monitor. If full `ChannelMonitors` are
8076 * persisted, then there is no need to persist individual updates.
8078 * Note that there could be a performance tradeoff between persisting complete
8079 * channel monitors on every update vs. persisting only updates and applying
8080 * them in batches. The size of each monitor grows `O(number of state updates)`
8081 * whereas updates are small and `O(1)`.
8083 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
8084 * [`ChannelMonitorUpdate::write`] for writing out an update, and
8085 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
8087 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);
8089 * Frees any resources associated with this object given its this_arg pointer.
8090 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8092 void (*free)(void *this_arg);
8098 * An implementation of [`chain::Watch`] for monitoring channels.
8100 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
8101 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
8102 * or used independently to monitor channels remotely. See the [module-level documentation] for
8105 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
8106 * [module-level documentation]: crate::chain::chainmonitor
8108 typedef struct MUST_USE_STRUCT LDKChainMonitor {
8110 * A pointer to the opaque Rust object.
8111 * Nearly everywhere, inner must be non-null, however in places where
8112 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8114 LDKnativeChainMonitor *inner;
8116 * Indicates that this is the only struct which contains the same pointer.
8117 * Rust functions which take ownership of an object provided via an argument require
8118 * this to be true and invalidate the object pointed to by inner.
8126 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
8127 * and derives keys from that.
8129 * Your node_id is seed/0'
8130 * ChannelMonitor closes may use seed/1'
8131 * Cooperative closes may use seed/2'
8132 * The two close keys may be needed to claim on-chain funds!
8134 typedef struct MUST_USE_STRUCT LDKKeysManager {
8136 * A pointer to the opaque Rust object.
8137 * Nearly everywhere, inner must be non-null, however in places where
8138 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8140 LDKnativeKeysManager *inner;
8142 * Indicates that this is the only struct which contains the same pointer.
8143 * Rust functions which take ownership of an object provided via an argument require
8144 * this to be true and invalidate the object pointed to by inner.
8152 * Chain-related parameters used to construct a new `ChannelManager`.
8154 * Typically, the block-specific parameters are derived from the best block hash for the network,
8155 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
8156 * are not needed when deserializing a previously constructed `ChannelManager`.
8158 typedef struct MUST_USE_STRUCT LDKChainParameters {
8160 * A pointer to the opaque Rust object.
8161 * Nearly everywhere, inner must be non-null, however in places where
8162 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8164 LDKnativeChainParameters *inner;
8166 * Indicates that this is the only struct which contains the same pointer.
8167 * Rust functions which take ownership of an object provided via an argument require
8168 * this to be true and invalidate the object pointed to by inner.
8171 } LDKChainParameters;
8176 * The best known block as identified by its hash and height.
8178 typedef struct MUST_USE_STRUCT LDKBestBlock {
8180 * A pointer to the opaque Rust object.
8181 * Nearly everywhere, inner must be non-null, however in places where
8182 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8184 LDKnativeBestBlock *inner;
8186 * Indicates that this is the only struct which contains the same pointer.
8187 * Rust functions which take ownership of an object provided via an argument require
8188 * this to be true and invalidate the object pointed to by inner.
8194 * A 3-byte byte array.
8196 typedef struct LDKThreeBytes {
8204 * A trait to describe an object which can receive channel messages.
8206 * Messages MAY be called in parallel when they originate from different their_node_ids, however
8207 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
8209 typedef struct LDKChannelMessageHandler {
8211 * An opaque pointer which is passed to your function implementations as an argument.
8212 * This has no meaning in the LDK, and can be NULL or any other value.
8216 * Handle an incoming open_channel message from the given peer.
8218 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
8220 * Handle an incoming accept_channel message from the given peer.
8222 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
8224 * Handle an incoming funding_created message from the given peer.
8226 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
8228 * Handle an incoming funding_signed message from the given peer.
8230 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
8232 * Handle an incoming funding_locked message from the given peer.
8234 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
8236 * Handle an incoming shutdown message from the given peer.
8238 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);
8240 * Handle an incoming closing_signed message from the given peer.
8242 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
8244 * Handle an incoming update_add_htlc message from the given peer.
8246 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
8248 * Handle an incoming update_fulfill_htlc message from the given peer.
8250 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
8252 * Handle an incoming update_fail_htlc message from the given peer.
8254 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
8256 * Handle an incoming update_fail_malformed_htlc message from the given peer.
8258 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
8260 * Handle an incoming commitment_signed message from the given peer.
8262 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
8264 * Handle an incoming revoke_and_ack message from the given peer.
8266 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
8268 * Handle an incoming update_fee message from the given peer.
8270 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
8272 * Handle an incoming announcement_signatures message from the given peer.
8274 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
8276 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
8277 * is believed to be possible in the future (eg they're sending us messages we don't
8278 * understand or indicate they require unknown feature bits), no_connection_possible is set
8279 * and any outstanding channels should be failed.
8281 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
8283 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
8285 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
8287 * Handle an incoming channel_reestablish message from the given peer.
8289 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
8291 * Handle an incoming channel update from the given peer.
8293 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
8295 * Handle an incoming error message from the given peer.
8297 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
8299 * Implementation of MessageSendEventsProvider for this object.
8301 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8303 * Frees any resources associated with this object given its this_arg pointer.
8304 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8306 void (*free)(void *this_arg);
8307 } LDKChannelMessageHandler;
8312 * Arguments for the creation of a ChannelManager that are not deserialized.
8314 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
8316 * 1) Deserialize all stored ChannelMonitors.
8317 * 2) Deserialize the ChannelManager by filling in this struct and calling:
8318 * <(BlockHash, ChannelManager)>::read(reader, args)
8319 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
8320 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
8321 * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
8322 * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
8323 * ChannelMonitor::get_funding_txo().
8324 * 4) Reconnect blocks on your ChannelMonitors.
8325 * 5) Disconnect/connect blocks on the ChannelManager.
8326 * 6) Move the ChannelMonitors into your local chain::Watch.
8328 * Note that the ordering of #4-6 is not of importance, however all three must occur before you
8329 * call any other methods on the newly-deserialized ChannelManager.
8331 * Note that because some channels may be closed during deserialization, it is critical that you
8332 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
8333 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
8334 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
8335 * not force-close the same channels but consider them live), you may end up revoking a state for
8336 * which you've already broadcasted the transaction.
8338 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
8340 * A pointer to the opaque Rust object.
8341 * Nearly everywhere, inner must be non-null, however in places where
8342 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8344 LDKnativeChannelManagerReadArgs *inner;
8346 * Indicates that this is the only struct which contains the same pointer.
8347 * Rust functions which take ownership of an object provided via an argument require
8348 * this to be true and invalidate the object pointed to by inner.
8351 } LDKChannelManagerReadArgs;
8356 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
8357 * This is used to convince the recipient that the channel is at a certain commitment
8358 * number even if they lost that data due to a local failure. Of course, the peer may lie
8359 * and even later commitments may have been revoked.
8361 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
8363 * A pointer to the opaque Rust object.
8364 * Nearly everywhere, inner must be non-null, however in places where
8365 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8367 LDKnativeDataLossProtect *inner;
8369 * Indicates that this is the only struct which contains the same pointer.
8370 * Rust functions which take ownership of an object provided via an argument require
8371 * this to be true and invalidate the object pointed to by inner.
8374 } LDKDataLossProtect;
8377 * A trait to describe an object which can receive routing messages.
8379 * # Implementor DoS Warnings
8381 * For `gossip_queries` messages there are potential DoS vectors when handling
8382 * inbound queries. Implementors using an on-disk network graph should be aware of
8383 * repeated disk I/O for queries accessing different parts of the network graph.
8385 typedef struct LDKRoutingMessageHandler {
8387 * An opaque pointer which is passed to your function implementations as an argument.
8388 * This has no meaning in the LDK, and can be NULL or any other value.
8392 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
8393 * false or returning an Err otherwise.
8395 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
8397 * Handle a channel_announcement message, returning true if it should be forwarded on, false
8398 * or returning an Err otherwise.
8400 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
8402 * Handle an incoming channel_update message, returning true if it should be forwarded on,
8403 * false or returning an Err otherwise.
8405 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
8407 * Handle some updates to the route graph that we learned due to an outbound failed payment.
8409 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
8411 * Gets a subset of the channel announcements and updates required to dump our routing table
8412 * to a remote node, starting at the short_channel_id indicated by starting_point and
8413 * including the batch_amount entries immediately higher in numerical value than starting_point.
8415 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
8417 * Gets a subset of the node announcements required to dump our routing table to a remote node,
8418 * starting at the node *after* the provided publickey and including batch_amount entries
8419 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
8420 * If None is provided for starting_point, we start at the first node.
8422 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
8424 * Called when a connection is established with a peer. This can be used to
8425 * perform routing table synchronization using a strategy defined by the
8428 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
8430 * Handles the reply of a query we initiated to learn about channels
8431 * for a given range of blocks. We can expect to receive one or more
8432 * replies to a single query.
8434 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
8436 * Handles the reply of a query we initiated asking for routing gossip
8437 * messages for a list of channels. We should receive this message when
8438 * a node has completed its best effort to send us the pertaining routing
8441 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
8443 * Handles when a peer asks us to send a list of short_channel_ids
8444 * for the requested range of blocks.
8446 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
8448 * Handles when a peer asks us to send routing gossip messages for a
8449 * list of short_channel_ids.
8451 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
8453 * Implementation of MessageSendEventsProvider for this object.
8455 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8457 * Frees any resources associated with this object given its this_arg pointer.
8458 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8460 void (*free)(void *this_arg);
8461 } LDKRoutingMessageHandler;
8466 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
8467 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
8469 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
8471 * A pointer to the opaque Rust object.
8472 * Nearly everywhere, inner must be non-null, however in places where
8473 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8475 LDKnativeIgnoringMessageHandler *inner;
8477 * Indicates that this is the only struct which contains the same pointer.
8478 * Rust functions which take ownership of an object provided via an argument require
8479 * this to be true and invalidate the object pointed to by inner.
8482 } LDKIgnoringMessageHandler;
8487 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
8488 * You can provide one of these as the route_handler in a MessageHandler.
8490 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
8492 * A pointer to the opaque Rust object.
8493 * Nearly everywhere, inner must be non-null, however in places where
8494 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8496 LDKnativeErroringMessageHandler *inner;
8498 * Indicates that this is the only struct which contains the same pointer.
8499 * Rust functions which take ownership of an object provided via an argument require
8500 * this to be true and invalidate the object pointed to by inner.
8503 } LDKErroringMessageHandler;
8508 * Provides references to trait impls which handle different types of messages.
8510 typedef struct MUST_USE_STRUCT LDKMessageHandler {
8512 * A pointer to the opaque Rust object.
8513 * Nearly everywhere, inner must be non-null, however in places where
8514 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8516 LDKnativeMessageHandler *inner;
8518 * Indicates that this is the only struct which contains the same pointer.
8519 * Rust functions which take ownership of an object provided via an argument require
8520 * this to be true and invalidate the object pointed to by inner.
8523 } LDKMessageHandler;
8526 * Provides an object which can be used to send data to and which uniquely identifies a connection
8527 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
8528 * implement Hash to meet the PeerManager API.
8530 * For efficiency, Clone should be relatively cheap for this type.
8532 * You probably want to just extend an int and put a file descriptor in a struct and implement
8533 * send_data. Note that if you are using a higher-level net library that may call close() itself,
8534 * be careful to ensure you don't have races whereby you might register a new connection with an
8535 * fd which is the same as a previous one which has yet to be removed via
8536 * PeerManager::socket_disconnected().
8538 typedef struct LDKSocketDescriptor {
8540 * An opaque pointer which is passed to your function implementations as an argument.
8541 * This has no meaning in the LDK, and can be NULL or any other value.
8545 * Attempts to send some data from the given slice to the peer.
8547 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
8548 * Note that in the disconnected case, socket_disconnected must still fire and further write
8549 * attempts may occur until that time.
8551 * If the returned size is smaller than data.len(), a write_available event must
8552 * trigger the next time more data can be written. Additionally, until the a send_data event
8553 * completes fully, no further read_events should trigger on the same peer!
8555 * If a read_event on this descriptor had previously returned true (indicating that read
8556 * events should be paused to prevent DoS in the send buffer), resume_read may be set
8557 * indicating that read events on this descriptor should resume. A resume_read of false does
8558 * *not* imply that further read events should be paused.
8560 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
8562 * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no
8563 * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with
8564 * this descriptor. No socket_disconnected call should be generated as a result of this call,
8565 * though races may occur whereby disconnect_socket is called after a call to
8566 * socket_disconnected but prior to socket_disconnected returning.
8568 void (*disconnect_socket)(void *this_arg);
8570 * Checks if two objects are equal given this object's this_arg pointer and another object.
8572 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
8574 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
8575 * This is used, for example, for inclusion of this object in a hash map.
8577 uint64_t (*hash)(const void *this_arg);
8579 * Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
8580 * Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
8581 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
8583 void *(*clone)(const void *this_arg);
8585 * Frees any resources associated with this object given its this_arg pointer.
8586 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8588 void (*free)(void *this_arg);
8589 } LDKSocketDescriptor;
8594 * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket
8595 * events into messages which it passes on to its MessageHandlers.
8597 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
8598 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
8599 * essentially you should default to using a SimpleRefPeerManager, and use a
8600 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
8601 * you're using lightning-net-tokio.
8603 typedef struct MUST_USE_STRUCT LDKPeerManager {
8605 * A pointer to the opaque Rust object.
8606 * Nearly everywhere, inner must be non-null, however in places where
8607 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8609 LDKnativePeerManager *inner;
8611 * Indicates that this is the only struct which contains the same pointer.
8612 * Rust functions which take ownership of an object provided via an argument require
8613 * this to be true and invalidate the object pointed to by inner.
8621 * Static channel fields used to build transactions given per-commitment fields, organized by
8622 * broadcaster/countersignatory.
8624 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
8625 * as_holder_broadcastable and as_counterparty_broadcastable functions.
8627 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
8629 * A pointer to the opaque Rust object.
8630 * Nearly everywhere, inner must be non-null, however in places where
8631 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8633 LDKnativeDirectedChannelTransactionParameters *inner;
8635 * Indicates that this is the only struct which contains the same pointer.
8636 * Rust functions which take ownership of an object provided via an argument require
8637 * this to be true and invalidate the object pointed to by inner.
8640 } LDKDirectedChannelTransactionParameters;
8645 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
8646 * This exists only to make accessing a RwLock<NetworkGraph> possible from
8647 * the C bindings, as it can be done directly in Rust code.
8649 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
8651 * A pointer to the opaque Rust object.
8652 * Nearly everywhere, inner must be non-null, however in places where
8653 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8655 LDKnativeLockedNetworkGraph *inner;
8657 * Indicates that this is the only struct which contains the same pointer.
8658 * Rust functions which take ownership of an object provided via an argument require
8659 * this to be true and invalidate the object pointed to by inner.
8662 } LDKLockedNetworkGraph;
8667 * Receives and validates network updates from peers,
8668 * stores authentic and relevant data as a network graph.
8669 * This network graph is then used for routing payments.
8670 * Provides interface to help with initial routing sync by
8671 * serving historical announcements.
8673 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
8675 * A pointer to the opaque Rust object.
8676 * Nearly everywhere, inner must be non-null, however in places where
8677 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8679 LDKnativeNetGraphMsgHandler *inner;
8681 * Indicates that this is the only struct which contains the same pointer.
8682 * Rust functions which take ownership of an object provided via an argument require
8683 * this to be true and invalidate the object pointed to by inner.
8686 } LDKNetGraphMsgHandler;
8691 * FilesystemPersister persists channel data on disk, where each channel's
8692 * data is stored in a file named after its funding outpoint.
8694 * Warning: this module does the best it can with calls to persist data, but it
8695 * can only guarantee that the data is passed to the drive. It is up to the
8696 * drive manufacturers to do the actual persistence properly, which they often
8697 * don't (especially on consumer-grade hardware). Therefore, it is up to the
8698 * user to validate their entire storage stack, to ensure the writes are
8700 * Corollary: especially when dealing with larger amounts of money, it is best
8701 * practice to have multiple channel data backups and not rely only on one
8702 * FilesystemPersister.
8704 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
8706 * A pointer to the opaque Rust object.
8707 * Nearly everywhere, inner must be non-null, however in places where
8708 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8710 LDKnativeFilesystemPersister *inner;
8712 * Indicates that this is the only struct which contains the same pointer.
8713 * Rust functions which take ownership of an object provided via an argument require
8714 * this to be true and invalidate the object pointed to by inner.
8717 } LDKFilesystemPersister;
8722 * Data of the `RawInvoice` that is encoded in the data part
8724 typedef struct MUST_USE_STRUCT LDKRawDataPart {
8726 * A pointer to the opaque Rust object.
8727 * Nearly everywhere, inner must be non-null, however in places where
8728 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8730 LDKnativeRawDataPart *inner;
8732 * Indicates that this is the only struct which contains the same pointer.
8733 * Rust functions which take ownership of an object provided via an argument require
8734 * this to be true and invalidate the object pointed to by inner.
8744 typedef struct MUST_USE_STRUCT LDKSha256 {
8746 * A pointer to the opaque Rust object.
8747 * Nearly everywhere, inner must be non-null, however in places where
8748 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8750 LDKnativeSha256 *inner;
8752 * Indicates that this is the only struct which contains the same pointer.
8753 * Rust functions which take ownership of an object provided via an argument require
8754 * this to be true and invalidate the object pointed to by inner.
8762 * `min_final_cltv_expiry` to use for the last HTLC in the route
8764 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
8766 * A pointer to the opaque Rust object.
8767 * Nearly everywhere, inner must be non-null, however in places where
8768 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8770 LDKnativeMinFinalCltvExpiry *inner;
8772 * Indicates that this is the only struct which contains the same pointer.
8773 * Rust functions which take ownership of an object provided via an argument require
8774 * this to be true and invalidate the object pointed to by inner.
8777 } LDKMinFinalCltvExpiry;
8780 * Integer in the range `0..32`
8782 typedef struct LDKu5 {
8787 * A 20-byte byte array.
8789 typedef struct LDKTwentyBytes {
8797 * Fallback address in case no LN payment is possible
8799 typedef enum LDKFallback_Tag {
8800 LDKFallback_SegWitProgram,
8801 LDKFallback_PubKeyHash,
8802 LDKFallback_ScriptHash,
8804 * Must be last for serialization purposes
8806 LDKFallback_Sentinel,
8809 typedef struct LDKFallback_LDKSegWitProgram_Body {
8810 struct LDKu5 version;
8811 struct LDKCVec_u8Z program;
8812 } LDKFallback_LDKSegWitProgram_Body;
8814 typedef struct MUST_USE_STRUCT LDKFallback {
8815 LDKFallback_Tag tag;
8817 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
8819 struct LDKTwentyBytes pub_key_hash;
8822 struct LDKTwentyBytes script_hash;
8827 extern const uintptr_t MAX_BUF_SIZE;
8829 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
8831 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
8833 extern const uint32_t ANTI_REORG_DELAY;
8835 extern const uint16_t BREAKDOWN_TIMEOUT;
8837 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
8839 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
8841 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
8843 extern const uint8_t TAG_PAYMENT_HASH;
8845 extern const uint8_t TAG_DESCRIPTION;
8847 extern const uint8_t TAG_PAYEE_PUB_KEY;
8849 extern const uint8_t TAG_DESCRIPTION_HASH;
8851 extern const uint8_t TAG_EXPIRY_TIME;
8853 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
8855 extern const uint8_t TAG_FALLBACK;
8857 extern const uint8_t TAG_ROUTE;
8859 extern const uint8_t TAG_PAYMENT_SECRET;
8861 extern const uint8_t TAG_FEATURES;
8863 struct LDKStr _ldk_get_compiled_version(void);
8865 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
8868 * Frees the data buffer, if data_is_owned is set and datalen > 0.
8870 void Transaction_free(struct LDKTransaction _res);
8873 * Frees the data pointed to by script_pubkey.
8875 void TxOut_free(struct LDKTxOut _res);
8878 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
8880 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
8883 * Frees the data buffer, if chars_is_owned is set and len > 0.
8885 void Str_free(struct LDKStr _res);
8888 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
8890 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
8893 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
8895 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
8898 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
8900 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
8903 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
8904 * but with all dynamically-allocated buffers duplicated in new buffers.
8906 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
8909 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
8911 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
8914 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
8916 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
8919 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
8921 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
8924 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
8925 * but with all dynamically-allocated buffers duplicated in new buffers.
8927 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
8930 * Creates a new CResult_SecretKeyErrorZ in the success state.
8932 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
8935 * Creates a new CResult_SecretKeyErrorZ in the error state.
8937 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
8940 * Frees any resources used by the CResult_SecretKeyErrorZ.
8942 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
8945 * Creates a new CResult_PublicKeyErrorZ in the success state.
8947 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
8950 * Creates a new CResult_PublicKeyErrorZ in the error state.
8952 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
8955 * Frees any resources used by the CResult_PublicKeyErrorZ.
8957 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
8960 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
8962 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
8965 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
8967 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
8970 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
8972 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
8975 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
8976 * but with all dynamically-allocated buffers duplicated in new buffers.
8978 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
8981 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
8983 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
8986 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
8988 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
8991 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
8993 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
8996 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
8997 * but with all dynamically-allocated buffers duplicated in new buffers.
8999 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
9002 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
9004 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
9007 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
9009 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
9012 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
9014 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
9017 * Constructs a new COption_u32Z containing a u32
9019 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
9022 * Constructs a new COption_u32Z containing nothing
9024 struct LDKCOption_u32Z COption_u32Z_none(void);
9027 * Frees any resources associated with the u32, if we are in the Some state
9029 void COption_u32Z_free(struct LDKCOption_u32Z _res);
9032 * Creates a new COption_u32Z which has the same data as `orig`
9033 * but with all dynamically-allocated buffers duplicated in new buffers.
9035 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
9038 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
9040 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
9043 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
9045 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
9048 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
9050 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
9053 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
9054 * but with all dynamically-allocated buffers duplicated in new buffers.
9056 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
9059 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
9061 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
9064 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
9066 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
9069 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
9071 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
9074 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
9075 * but with all dynamically-allocated buffers duplicated in new buffers.
9077 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
9080 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
9082 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
9085 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
9087 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
9090 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
9092 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
9095 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
9096 * but with all dynamically-allocated buffers duplicated in new buffers.
9098 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
9101 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9103 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
9106 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
9108 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
9111 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
9113 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9116 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
9118 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
9121 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
9122 * but with all dynamically-allocated buffers duplicated in new buffers.
9124 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9127 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
9129 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
9132 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
9134 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9137 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
9139 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
9142 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
9143 * but with all dynamically-allocated buffers duplicated in new buffers.
9145 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9148 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
9150 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
9153 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
9155 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9158 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
9160 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
9163 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
9164 * but with all dynamically-allocated buffers duplicated in new buffers.
9166 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9169 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
9171 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
9174 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
9176 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
9179 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
9181 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
9184 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
9186 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
9189 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
9191 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
9194 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
9196 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
9199 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
9200 * but with all dynamically-allocated buffers duplicated in new buffers.
9202 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
9205 * Creates a new CResult_SiPrefixNoneZ in the success state.
9207 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_ok(enum LDKSiPrefix o);
9210 * Creates a new CResult_SiPrefixNoneZ in the error state.
9212 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_err(void);
9215 * Frees any resources used by the CResult_SiPrefixNoneZ.
9217 void CResult_SiPrefixNoneZ_free(struct LDKCResult_SiPrefixNoneZ _res);
9220 * Creates a new CResult_SiPrefixNoneZ which has the same data as `orig`
9221 * but with all dynamically-allocated buffers duplicated in new buffers.
9223 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_clone(const struct LDKCResult_SiPrefixNoneZ *NONNULL_PTR orig);
9226 * Creates a new CResult_InvoiceNoneZ in the success state.
9228 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_ok(struct LDKInvoice o);
9231 * Creates a new CResult_InvoiceNoneZ in the error state.
9233 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_err(void);
9236 * Frees any resources used by the CResult_InvoiceNoneZ.
9238 void CResult_InvoiceNoneZ_free(struct LDKCResult_InvoiceNoneZ _res);
9241 * Creates a new CResult_InvoiceNoneZ which has the same data as `orig`
9242 * but with all dynamically-allocated buffers duplicated in new buffers.
9244 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_clone(const struct LDKCResult_InvoiceNoneZ *NONNULL_PTR orig);
9247 * Creates a new CResult_SignedRawInvoiceNoneZ in the success state.
9249 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_ok(struct LDKSignedRawInvoice o);
9252 * Creates a new CResult_SignedRawInvoiceNoneZ in the error state.
9254 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_err(void);
9257 * Frees any resources used by the CResult_SignedRawInvoiceNoneZ.
9259 void CResult_SignedRawInvoiceNoneZ_free(struct LDKCResult_SignedRawInvoiceNoneZ _res);
9262 * Creates a new CResult_SignedRawInvoiceNoneZ which has the same data as `orig`
9263 * but with all dynamically-allocated buffers duplicated in new buffers.
9265 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_clone(const struct LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR orig);
9268 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9270 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
9273 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
9275 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
9278 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
9280 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
9283 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
9285 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
9288 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
9290 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
9293 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
9295 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
9298 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9300 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
9303 * Constructs a new COption_u64Z containing a u64
9305 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
9308 * Constructs a new COption_u64Z containing nothing
9310 struct LDKCOption_u64Z COption_u64Z_none(void);
9313 * Frees any resources associated with the u64, if we are in the Some state
9315 void COption_u64Z_free(struct LDKCOption_u64Z _res);
9318 * Creates a new COption_u64Z which has the same data as `orig`
9319 * but with all dynamically-allocated buffers duplicated in new buffers.
9321 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
9324 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
9326 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
9329 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
9331 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
9334 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
9336 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
9339 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
9340 * but with all dynamically-allocated buffers duplicated in new buffers.
9342 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
9345 * Creates a new CResult_NoneSemanticErrorZ in the success state.
9347 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
9350 * Creates a new CResult_NoneSemanticErrorZ in the error state.
9352 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
9355 * Frees any resources used by the CResult_NoneSemanticErrorZ.
9357 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
9360 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
9361 * but with all dynamically-allocated buffers duplicated in new buffers.
9363 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
9366 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
9368 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
9371 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
9373 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
9376 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
9378 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
9381 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
9382 * but with all dynamically-allocated buffers duplicated in new buffers.
9384 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
9387 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
9389 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
9392 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
9394 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
9397 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
9399 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
9402 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
9403 * but with all dynamically-allocated buffers duplicated in new buffers.
9405 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
9408 * Creates a new CResult_ExpiryTimeCreationErrorZ in the success state.
9410 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_ok(struct LDKExpiryTime o);
9413 * Creates a new CResult_ExpiryTimeCreationErrorZ in the error state.
9415 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_err(enum LDKCreationError e);
9418 * Frees any resources used by the CResult_ExpiryTimeCreationErrorZ.
9420 void CResult_ExpiryTimeCreationErrorZ_free(struct LDKCResult_ExpiryTimeCreationErrorZ _res);
9423 * Creates a new CResult_ExpiryTimeCreationErrorZ which has the same data as `orig`
9424 * but with all dynamically-allocated buffers duplicated in new buffers.
9426 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_clone(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR orig);
9429 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9431 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
9434 * Creates a new CResult_RouteHintCreationErrorZ in the success state.
9436 struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_ok(struct LDKRouteHint o);
9439 * Creates a new CResult_RouteHintCreationErrorZ in the error state.
9441 struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_err(enum LDKCreationError e);
9444 * Frees any resources used by the CResult_RouteHintCreationErrorZ.
9446 void CResult_RouteHintCreationErrorZ_free(struct LDKCResult_RouteHintCreationErrorZ _res);
9449 * Creates a new CResult_RouteHintCreationErrorZ which has the same data as `orig`
9450 * but with all dynamically-allocated buffers duplicated in new buffers.
9452 struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_clone(const struct LDKCResult_RouteHintCreationErrorZ *NONNULL_PTR orig);
9455 * Creates a new CResult_StringErrorZ in the success state.
9457 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
9460 * Creates a new CResult_StringErrorZ in the error state.
9462 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
9465 * Frees any resources used by the CResult_StringErrorZ.
9467 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
9470 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
9472 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
9475 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
9477 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9480 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
9482 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
9485 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
9486 * but with all dynamically-allocated buffers duplicated in new buffers.
9488 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
9491 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
9493 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
9496 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
9498 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9501 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
9503 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
9506 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
9507 * but with all dynamically-allocated buffers duplicated in new buffers.
9509 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
9512 * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
9514 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
9517 * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
9519 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
9522 * Frees any resources used by the CResult_NoneMonitorUpdateErrorZ.
9524 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
9527 * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
9528 * but with all dynamically-allocated buffers duplicated in new buffers.
9530 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
9533 * Creates a new tuple which has the same data as `orig`
9534 * but with all dynamically-allocated buffers duplicated in new buffers.
9536 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
9539 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
9541 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
9544 * Frees any resources used by the C2Tuple_OutPointScriptZ.
9546 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
9549 * Creates a new tuple which has the same data as `orig`
9550 * but with all dynamically-allocated buffers duplicated in new buffers.
9552 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
9555 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
9557 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
9560 * Frees any resources used by the C2Tuple_u32ScriptZ.
9562 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
9565 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9567 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
9570 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
9572 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
9575 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
9577 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
9580 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9582 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
9585 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9587 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
9590 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9592 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
9595 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9597 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
9600 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
9602 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
9605 * Frees any resources used by the C2Tuple_usizeTransactionZ.
9607 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
9610 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9612 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
9615 * Creates a new tuple which has the same data as `orig`
9616 * but with all dynamically-allocated buffers duplicated in new buffers.
9618 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
9621 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
9623 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
9626 * Frees any resources used by the C2Tuple_u32TxOutZ.
9628 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
9631 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9633 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
9636 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
9638 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
9641 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
9643 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
9646 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9648 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
9651 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9653 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
9656 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
9658 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
9661 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
9663 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
9666 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
9668 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
9671 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
9672 * but with all dynamically-allocated buffers duplicated in new buffers.
9674 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
9677 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
9679 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
9682 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
9684 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
9687 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
9689 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
9692 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
9694 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
9697 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
9699 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
9702 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9704 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
9707 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9709 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
9712 * Creates a new CResult_RouteDecodeErrorZ in the success state.
9714 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
9717 * Creates a new CResult_RouteDecodeErrorZ in the error state.
9719 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
9722 * Frees any resources used by the CResult_RouteDecodeErrorZ.
9724 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
9727 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
9728 * but with all dynamically-allocated buffers duplicated in new buffers.
9730 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
9733 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9735 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
9738 * Creates a new CResult_RouteLightningErrorZ in the success state.
9740 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
9743 * Creates a new CResult_RouteLightningErrorZ in the error state.
9745 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
9748 * Frees any resources used by the CResult_RouteLightningErrorZ.
9750 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
9753 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
9754 * but with all dynamically-allocated buffers duplicated in new buffers.
9756 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
9759 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9761 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
9764 * Creates a new CResult_boolLightningErrorZ in the success state.
9766 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
9769 * Creates a new CResult_boolLightningErrorZ in the error state.
9771 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
9774 * Frees any resources used by the CResult_boolLightningErrorZ.
9776 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
9779 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
9780 * but with all dynamically-allocated buffers duplicated in new buffers.
9782 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
9785 * Creates a new tuple which has the same data as `orig`
9786 * but with all dynamically-allocated buffers duplicated in new buffers.
9788 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
9791 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
9793 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
9796 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
9798 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
9801 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9803 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
9806 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9808 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
9811 * Creates a new CResult_NoneLightningErrorZ in the success state.
9813 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
9816 * Creates a new CResult_NoneLightningErrorZ in the error state.
9818 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
9821 * Frees any resources used by the CResult_NoneLightningErrorZ.
9823 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
9826 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
9827 * but with all dynamically-allocated buffers duplicated in new buffers.
9829 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
9832 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9834 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
9837 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
9839 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
9842 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
9844 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
9847 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
9849 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
9852 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
9853 * but with all dynamically-allocated buffers duplicated in new buffers.
9855 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
9858 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
9860 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
9863 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
9865 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
9868 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
9870 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
9873 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
9874 * but with all dynamically-allocated buffers duplicated in new buffers.
9876 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
9879 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
9881 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
9884 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
9886 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
9889 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
9891 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
9894 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
9895 * but with all dynamically-allocated buffers duplicated in new buffers.
9897 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
9900 * Creates a new CResult_TxOutAccessErrorZ in the success state.
9902 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
9905 * Creates a new CResult_TxOutAccessErrorZ in the error state.
9907 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
9910 * Frees any resources used by the CResult_TxOutAccessErrorZ.
9912 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
9915 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
9916 * but with all dynamically-allocated buffers duplicated in new buffers.
9918 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
9921 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
9923 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
9926 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
9928 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
9931 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
9933 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
9936 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9938 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
9941 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
9943 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
9946 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
9948 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
9951 * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
9953 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
9956 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
9957 * but with all dynamically-allocated buffers duplicated in new buffers.
9959 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
9962 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
9964 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
9967 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
9969 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
9972 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
9974 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
9977 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
9978 * but with all dynamically-allocated buffers duplicated in new buffers.
9980 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
9983 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
9985 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
9988 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
9990 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
9993 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
9995 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
9998 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
9999 * but with all dynamically-allocated buffers duplicated in new buffers.
10001 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
10004 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10006 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
10009 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
10011 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
10014 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
10016 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
10019 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
10021 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
10024 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
10025 * but with all dynamically-allocated buffers duplicated in new buffers.
10027 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
10030 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10032 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
10035 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
10037 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
10040 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
10042 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
10045 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
10047 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
10050 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
10051 * but with all dynamically-allocated buffers duplicated in new buffers.
10053 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
10056 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
10058 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
10061 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
10063 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
10066 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
10068 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
10071 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
10072 * but with all dynamically-allocated buffers duplicated in new buffers.
10074 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
10077 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
10079 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
10082 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
10084 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
10087 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
10089 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
10092 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
10094 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
10097 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
10099 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
10102 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
10104 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
10107 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
10109 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
10112 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
10114 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
10117 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
10119 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
10122 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
10124 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
10127 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
10129 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
10132 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
10134 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
10137 * Creates a new CResult_NetAddressu8Z in the success state.
10139 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
10142 * Creates a new CResult_NetAddressu8Z in the error state.
10144 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
10147 * Frees any resources used by the CResult_NetAddressu8Z.
10149 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
10152 * Creates a new CResult_NetAddressu8Z which has the same data as `orig`
10153 * but with all dynamically-allocated buffers duplicated in new buffers.
10155 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
10158 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state.
10160 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
10163 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state.
10165 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
10168 * Frees any resources used by the CResult_CResult_NetAddressu8ZDecodeErrorZ.
10170 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
10173 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig`
10174 * but with all dynamically-allocated buffers duplicated in new buffers.
10176 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
10179 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
10181 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
10184 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
10186 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
10189 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
10191 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
10194 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
10195 * but with all dynamically-allocated buffers duplicated in new buffers.
10197 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
10200 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10202 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
10205 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10207 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
10210 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10212 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
10215 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10217 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
10220 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
10222 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
10225 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
10227 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
10230 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
10232 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
10235 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
10236 * but with all dynamically-allocated buffers duplicated in new buffers.
10238 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
10241 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
10243 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
10246 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
10248 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
10251 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
10253 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
10256 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
10257 * but with all dynamically-allocated buffers duplicated in new buffers.
10259 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
10262 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
10264 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
10267 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
10269 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
10272 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
10274 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
10277 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
10278 * but with all dynamically-allocated buffers duplicated in new buffers.
10280 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
10283 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
10285 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
10288 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
10290 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
10293 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
10295 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
10298 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
10299 * but with all dynamically-allocated buffers duplicated in new buffers.
10301 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
10304 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
10306 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
10309 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
10311 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
10314 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
10316 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
10319 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
10320 * but with all dynamically-allocated buffers duplicated in new buffers.
10322 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
10325 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
10327 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
10330 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
10332 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
10335 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
10337 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
10340 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
10341 * but with all dynamically-allocated buffers duplicated in new buffers.
10343 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
10346 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
10348 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
10351 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
10353 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
10356 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
10358 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
10361 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
10362 * but with all dynamically-allocated buffers duplicated in new buffers.
10364 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
10367 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
10369 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
10372 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
10374 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
10377 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
10379 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
10382 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
10383 * but with all dynamically-allocated buffers duplicated in new buffers.
10385 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
10388 * Creates a new CResult_InitDecodeErrorZ in the success state.
10390 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
10393 * Creates a new CResult_InitDecodeErrorZ in the error state.
10395 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
10398 * Frees any resources used by the CResult_InitDecodeErrorZ.
10400 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
10403 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
10404 * but with all dynamically-allocated buffers duplicated in new buffers.
10406 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
10409 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
10411 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
10414 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
10416 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
10419 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
10421 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
10424 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
10425 * but with all dynamically-allocated buffers duplicated in new buffers.
10427 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
10430 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
10432 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
10435 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
10437 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
10440 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
10442 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
10445 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
10446 * but with all dynamically-allocated buffers duplicated in new buffers.
10448 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
10451 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
10453 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
10456 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
10458 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
10461 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
10463 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
10466 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
10467 * but with all dynamically-allocated buffers duplicated in new buffers.
10469 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
10472 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
10474 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
10477 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
10479 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10482 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
10484 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
10487 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
10488 * but with all dynamically-allocated buffers duplicated in new buffers.
10490 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
10493 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
10495 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
10498 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
10500 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10503 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
10505 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
10508 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
10509 * but with all dynamically-allocated buffers duplicated in new buffers.
10511 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
10514 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
10516 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
10519 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
10521 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
10524 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
10526 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
10529 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
10530 * but with all dynamically-allocated buffers duplicated in new buffers.
10532 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
10535 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
10537 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
10540 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
10542 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10545 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
10547 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
10550 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
10551 * but with all dynamically-allocated buffers duplicated in new buffers.
10553 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
10556 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
10558 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
10561 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
10563 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10566 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
10568 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
10571 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
10572 * but with all dynamically-allocated buffers duplicated in new buffers.
10574 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
10577 * Creates a new CResult_PingDecodeErrorZ in the success state.
10579 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
10582 * Creates a new CResult_PingDecodeErrorZ in the error state.
10584 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
10587 * Frees any resources used by the CResult_PingDecodeErrorZ.
10589 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
10592 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
10593 * but with all dynamically-allocated buffers duplicated in new buffers.
10595 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
10598 * Creates a new CResult_PongDecodeErrorZ in the success state.
10600 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
10603 * Creates a new CResult_PongDecodeErrorZ in the error state.
10605 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
10608 * Frees any resources used by the CResult_PongDecodeErrorZ.
10610 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
10613 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
10614 * but with all dynamically-allocated buffers duplicated in new buffers.
10616 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
10619 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
10621 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
10624 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
10626 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10629 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
10631 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
10634 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
10635 * but with all dynamically-allocated buffers duplicated in new buffers.
10637 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10640 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
10642 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
10645 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
10647 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10650 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
10652 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
10655 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
10656 * but with all dynamically-allocated buffers duplicated in new buffers.
10658 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10661 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
10663 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
10666 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
10668 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10671 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
10673 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
10676 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
10677 * but with all dynamically-allocated buffers duplicated in new buffers.
10679 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
10682 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
10684 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
10687 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
10689 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10692 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
10694 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
10697 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
10698 * but with all dynamically-allocated buffers duplicated in new buffers.
10700 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
10703 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
10705 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
10708 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
10710 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
10713 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
10715 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
10718 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
10719 * but with all dynamically-allocated buffers duplicated in new buffers.
10721 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
10724 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
10726 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
10729 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
10731 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10734 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
10736 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
10739 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
10740 * but with all dynamically-allocated buffers duplicated in new buffers.
10742 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10745 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
10747 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
10750 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
10752 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10755 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
10757 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
10760 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
10761 * but with all dynamically-allocated buffers duplicated in new buffers.
10763 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10766 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
10768 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
10771 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
10773 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
10776 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
10778 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
10781 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
10782 * but with all dynamically-allocated buffers duplicated in new buffers.
10784 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
10787 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
10789 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
10792 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
10794 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
10797 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
10799 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
10802 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
10803 * but with all dynamically-allocated buffers duplicated in new buffers.
10805 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
10808 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
10810 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
10813 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
10815 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
10818 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
10820 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
10823 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
10824 * but with all dynamically-allocated buffers duplicated in new buffers.
10826 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
10829 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
10831 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
10834 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
10836 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
10839 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
10841 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
10844 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
10845 * but with all dynamically-allocated buffers duplicated in new buffers.
10847 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
10850 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
10852 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
10855 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
10857 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
10860 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
10862 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
10865 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
10866 * but with all dynamically-allocated buffers duplicated in new buffers.
10868 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
10871 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
10873 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
10876 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
10878 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
10881 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
10883 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
10886 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
10887 * but with all dynamically-allocated buffers duplicated in new buffers.
10889 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
10892 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
10894 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
10897 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
10899 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
10902 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
10904 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
10907 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
10908 * but with all dynamically-allocated buffers duplicated in new buffers.
10910 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
10913 * Creates a new tuple which has the same data as `orig`
10914 * but with all dynamically-allocated buffers duplicated in new buffers.
10916 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
10919 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
10921 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
10924 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
10926 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
10929 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
10931 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
10934 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
10936 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
10939 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
10941 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
10944 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
10945 * but with all dynamically-allocated buffers duplicated in new buffers.
10947 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
10950 * Creates a new CResult_SignatureNoneZ in the success state.
10952 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
10955 * Creates a new CResult_SignatureNoneZ in the error state.
10957 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
10960 * Frees any resources used by the CResult_SignatureNoneZ.
10962 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
10965 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
10966 * but with all dynamically-allocated buffers duplicated in new buffers.
10968 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
10971 * Creates a new CResult_SignDecodeErrorZ in the success state.
10973 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
10976 * Creates a new CResult_SignDecodeErrorZ in the error state.
10978 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
10981 * Frees any resources used by the CResult_SignDecodeErrorZ.
10983 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
10986 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
10987 * but with all dynamically-allocated buffers duplicated in new buffers.
10989 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
10992 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
10994 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
10997 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
10999 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
11002 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
11004 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
11007 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
11008 * but with all dynamically-allocated buffers duplicated in new buffers.
11010 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
11013 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11015 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
11018 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
11020 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
11023 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
11025 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
11028 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
11030 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
11033 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
11034 * but with all dynamically-allocated buffers duplicated in new buffers.
11036 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
11039 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
11041 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
11044 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
11046 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
11049 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
11051 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
11054 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
11055 * but with all dynamically-allocated buffers duplicated in new buffers.
11057 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
11060 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11062 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
11065 * Creates a new CResult_TransactionNoneZ in the success state.
11067 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
11070 * Creates a new CResult_TransactionNoneZ in the error state.
11072 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
11075 * Frees any resources used by the CResult_TransactionNoneZ.
11077 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
11080 * Creates a new CResult_NoneErrorZ in the success state.
11082 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
11085 * Creates a new CResult_NoneErrorZ in the error state.
11087 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
11090 * Frees any resources used by the CResult_NoneErrorZ.
11092 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
11095 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11097 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
11100 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
11102 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
11105 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
11107 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
11110 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
11112 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
11115 * Creates a new CResult_NoneAPIErrorZ in the success state.
11117 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
11120 * Creates a new CResult_NoneAPIErrorZ in the error state.
11122 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
11125 * Frees any resources used by the CResult_NoneAPIErrorZ.
11127 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
11130 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
11131 * but with all dynamically-allocated buffers duplicated in new buffers.
11133 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
11136 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11138 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
11141 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11143 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
11146 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
11148 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
11151 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
11153 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
11156 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
11158 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
11161 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
11162 * but with all dynamically-allocated buffers duplicated in new buffers.
11164 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
11167 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
11169 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
11172 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
11174 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
11177 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
11179 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
11182 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
11184 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
11187 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
11189 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
11192 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11194 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
11197 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
11199 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
11202 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
11204 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
11207 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
11209 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
11212 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
11214 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
11217 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
11219 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
11222 * Frees any resources used by the Event
11224 void Event_free(struct LDKEvent this_ptr);
11227 * Creates a copy of the Event
11229 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
11232 * Serialize the Event object into a byte array which can be read by Event_read
11234 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
11237 * Frees any resources used by the MessageSendEvent
11239 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
11242 * Creates a copy of the MessageSendEvent
11244 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
11247 * Calls the free function if one is set
11249 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
11252 * Calls the free function if one is set
11254 void EventsProvider_free(struct LDKEventsProvider this_ptr);
11257 * Calls the free function if one is set
11259 void EventHandler_free(struct LDKEventHandler this_ptr);
11262 * Frees any resources used by the APIError
11264 void APIError_free(struct LDKAPIError this_ptr);
11267 * Creates a copy of the APIError
11269 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
11272 * Creates a digital signature of a message given a SecretKey, like the node's secret.
11273 * 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.
11274 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
11276 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, struct LDKSecretKey sk);
11279 * Recovers the PublicKey of the signer of the message given the message and the signature.
11281 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
11284 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
11285 * and the PublicKey.
11287 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
11290 * Creates a copy of the Level
11292 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
11295 * Checks if two Levels contain equal inner contents.
11296 * This ignores pointers and is_owned flags and looks at the values in fields.
11298 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
11301 * Checks if two Levels contain equal inner contents.
11303 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
11306 * Returns the most verbose logging level.
11308 MUST_USE_RES enum LDKLevel Level_max(void);
11311 * Calls the free function if one is set
11313 void Logger_free(struct LDKLogger this_ptr);
11316 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
11318 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
11321 * Confirmations we will wait for before considering the channel locked in.
11322 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
11323 * equivalent limit applied to outbound channels).
11325 * Default value: 6.
11327 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11330 * Confirmations we will wait for before considering the channel locked in.
11331 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
11332 * equivalent limit applied to outbound channels).
11334 * Default value: 6.
11336 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
11339 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
11340 * the number of blocks we have to punish our counterparty if they broadcast a revoked
11343 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
11344 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
11345 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
11346 * possibly with time in between to RBF the spending transaction).
11348 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
11349 * case of an honest unilateral channel close, which implicitly decrease the economic value of
11352 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
11353 * can tweak config to ask for more security, not less.
11355 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11358 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
11359 * the number of blocks we have to punish our counterparty if they broadcast a revoked
11362 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
11363 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
11364 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
11365 * possibly with time in between to RBF the spending transaction).
11367 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
11368 * case of an honest unilateral channel close, which implicitly decrease the economic value of
11371 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
11372 * can tweak config to ask for more security, not less.
11374 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
11377 * Set to the smallest value HTLC we will accept to process.
11379 * This value is sent to our counterparty on channel-open and we close the channel any time
11380 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
11382 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
11385 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11388 * Set to the smallest value HTLC we will accept to process.
11390 * This value is sent to our counterparty on channel-open and we close the channel any time
11391 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
11393 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
11396 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
11399 * Constructs a new ChannelHandshakeConfig given each field
11401 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);
11404 * Creates a copy of the ChannelHandshakeConfig
11406 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
11409 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
11411 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
11414 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
11416 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
11419 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
11420 * only applies to inbound channels.
11422 * Default value: 0.
11424 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11427 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
11428 * only applies to inbound channels.
11430 * Default value: 0.
11432 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11435 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
11436 * you to limit the maximum minimum-size they can require.
11438 * Default value: u64::max_value.
11440 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11443 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
11444 * you to limit the maximum minimum-size they can require.
11446 * Default value: u64::max_value.
11448 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11451 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
11452 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
11454 * Default value: 0.
11456 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11459 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
11460 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
11462 * Default value: 0.
11464 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11467 * The remote node will require we keep a certain amount in direct payment to ourselves at all
11468 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
11469 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
11471 * Default value: u64::max_value.
11473 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11476 * The remote node will require we keep a certain amount in direct payment to ourselves at all
11477 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
11478 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
11480 * Default value: u64::max_value.
11482 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11485 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
11486 * time. This allows you to set a minimum such value.
11488 * Default value: 0.
11490 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11493 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
11494 * time. This allows you to set a minimum such value.
11496 * Default value: 0.
11498 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
11501 * Before a channel is usable the funding transaction will need to be confirmed by at least a
11502 * certain number of blocks, specified by the node which is not the funder (as the funder can
11503 * assume they aren't going to double-spend themselves).
11504 * This config allows you to set a limit on the maximum amount of time to wait.
11506 * Default value: 144, or roughly one day and only applies to outbound channels.
11508 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11511 * Before a channel is usable the funding transaction will need to be confirmed by at least a
11512 * certain number of blocks, specified by the node which is not the funder (as the funder can
11513 * assume they aren't going to double-spend themselves).
11514 * This config allows you to set a limit on the maximum amount of time to wait.
11516 * Default value: 144, or roughly one day and only applies to outbound channels.
11518 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
11521 * Set to force the incoming channel to match our announced channel preference in
11524 * Default value: true, to make the default that no announced channels are possible (which is
11525 * appropriate for any nodes which are not online very reliably).
11527 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11530 * Set to force the incoming channel to match our announced channel preference in
11533 * Default value: true, to make the default that no announced channels are possible (which is
11534 * appropriate for any nodes which are not online very reliably).
11536 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
11539 * Set to the amount of time we're willing to wait to claim money back to us.
11541 * Not checking this value would be a security issue, as our peer would be able to set it to
11542 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
11544 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
11545 * reduce the loss of having useless locked funds (if your peer accepts)
11547 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11550 * Set to the amount of time we're willing to wait to claim money back to us.
11552 * Not checking this value would be a security issue, as our peer would be able to set it to
11553 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
11555 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
11556 * reduce the loss of having useless locked funds (if your peer accepts)
11558 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
11561 * Constructs a new ChannelHandshakeLimits given each field
11563 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);
11566 * Creates a copy of the ChannelHandshakeLimits
11568 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
11571 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
11573 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
11576 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
11578 void ChannelConfig_free(struct LDKChannelConfig this_obj);
11581 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
11582 * This may be allowed to change at runtime in a later update, however doing so must result in
11583 * update messages sent to notify all nodes of our updated relay fee.
11585 * Default value: 0.
11587 uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11590 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
11591 * This may be allowed to change at runtime in a later update, however doing so must result in
11592 * update messages sent to notify all nodes of our updated relay fee.
11594 * Default value: 0.
11596 void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
11599 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
11600 * the channel this config applies to.
11602 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
11603 * HTLC balance when a channel appears on-chain whereas
11604 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
11605 * (non-HTLC-encumbered) balance.
11607 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
11608 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
11609 * commitment transaction at least once per this many blocks (minus some margin to allow us
11610 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
11611 * the spending transaction).
11613 * Default value: 72 (12 hours at an average of 6 blocks/hour).
11614 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
11615 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
11617 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
11619 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11622 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
11623 * the channel this config applies to.
11625 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
11626 * HTLC balance when a channel appears on-chain whereas
11627 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
11628 * (non-HTLC-encumbered) balance.
11630 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
11631 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
11632 * commitment transaction at least once per this many blocks (minus some margin to allow us
11633 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
11634 * the spending transaction).
11636 * Default value: 72 (12 hours at an average of 6 blocks/hour).
11637 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
11638 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
11640 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
11642 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
11645 * Set to announce the channel publicly and notify all nodes that they can route via this
11648 * This should only be set to true for nodes which expect to be online reliably.
11650 * As the node which funds a channel picks this value this will only apply for new outbound
11651 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
11653 * This cannot be changed after the initial channel handshake.
11655 * Default value: false.
11657 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11660 * Set to announce the channel publicly and notify all nodes that they can route via this
11663 * This should only be set to true for nodes which expect to be online reliably.
11665 * As the node which funds a channel picks this value this will only apply for new outbound
11666 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
11668 * This cannot be changed after the initial channel handshake.
11670 * Default value: false.
11672 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
11675 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
11676 * supports it, they will then enforce the mutual-close output to us matches what we provided
11677 * at intialization, preventing us from closing to an alternate pubkey.
11679 * This is set to true by default to provide a slight increase in security, though ultimately
11680 * any attacker who is able to take control of a channel can just as easily send the funds via
11681 * lightning payments, so we never require that our counterparties support this option.
11683 * This cannot be changed after a channel has been initialized.
11685 * Default value: true.
11687 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11690 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
11691 * supports it, they will then enforce the mutual-close output to us matches what we provided
11692 * at intialization, preventing us from closing to an alternate pubkey.
11694 * This is set to true by default to provide a slight increase in security, though ultimately
11695 * any attacker who is able to take control of a channel can just as easily send the funds via
11696 * lightning payments, so we never require that our counterparties support this option.
11698 * This cannot be changed after a channel has been initialized.
11700 * Default value: true.
11702 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
11705 * Constructs a new ChannelConfig given each field
11707 MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
11710 * Creates a copy of the ChannelConfig
11712 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
11715 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
11717 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
11720 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
11722 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
11725 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
11727 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
11730 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
11732 void UserConfig_free(struct LDKUserConfig this_obj);
11735 * Channel config that we propose to our counterparty.
11737 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
11740 * Channel config that we propose to our counterparty.
11742 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
11745 * Limits applied to our counterparty's proposed channel config settings.
11747 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
11750 * Limits applied to our counterparty's proposed channel config settings.
11752 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
11755 * Channel config which affects behavior during channel lifetime.
11757 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
11760 * Channel config which affects behavior during channel lifetime.
11762 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
11765 * Constructs a new UserConfig given each field
11767 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);
11770 * Creates a copy of the UserConfig
11772 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
11775 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
11777 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
11780 * Creates a copy of the AccessError
11782 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
11785 * Calls the free function if one is set
11787 void Access_free(struct LDKAccess this_ptr);
11790 * Calls the free function if one is set
11792 void Listen_free(struct LDKListen this_ptr);
11795 * Calls the free function if one is set
11797 void Confirm_free(struct LDKConfirm this_ptr);
11800 * Calls the free function if one is set
11802 void Watch_free(struct LDKWatch this_ptr);
11805 * Calls the free function if one is set
11807 void Filter_free(struct LDKFilter this_ptr);
11810 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
11812 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
11815 * First block where the transaction output may have been spent.
11817 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
11820 * First block where the transaction output may have been spent.
11822 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11825 * Outpoint identifying the transaction output.
11827 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
11830 * Outpoint identifying the transaction output.
11832 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
11835 * Spending condition of the transaction output.
11837 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
11840 * Spending condition of the transaction output.
11842 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
11845 * Constructs a new WatchedOutput given each field
11847 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
11850 * Calls the free function if one is set
11852 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
11855 * Creates a copy of the ConfirmationTarget
11857 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
11860 * Calls the free function if one is set
11862 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
11865 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
11867 void ChainMonitor_free(struct LDKChainMonitor this_obj);
11870 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
11872 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
11873 * will call back to it indicating transactions and outputs of interest. This allows clients to
11874 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
11875 * always need to fetch full blocks absent another means for determining which blocks contain
11876 * transactions relevant to the watched channels.
11878 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
11881 * Constructs a new Listen which calls the relevant methods on this_arg.
11882 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
11884 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
11887 * Constructs a new Confirm which calls the relevant methods on this_arg.
11888 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
11890 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
11893 * Constructs a new Watch which calls the relevant methods on this_arg.
11894 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
11896 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
11899 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
11900 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
11902 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
11905 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
11907 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
11910 * The sequence number of this update. Updates *must* be replayed in-order according to this
11911 * sequence number (and updates may panic if they are not). The update_id values are strictly
11912 * increasing and increase by one for each new update, with one exception specified below.
11914 * This sequence number is also used to track up to which points updates which returned
11915 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
11916 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
11918 * The only instance where update_id values are not strictly increasing is the case where we
11919 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
11920 * its docs for more details.
11922 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
11925 * The sequence number of this update. Updates *must* be replayed in-order according to this
11926 * sequence number (and updates may panic if they are not). The update_id values are strictly
11927 * increasing and increase by one for each new update, with one exception specified below.
11929 * This sequence number is also used to track up to which points updates which returned
11930 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
11931 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
11933 * The only instance where update_id values are not strictly increasing is the case where we
11934 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
11935 * its docs for more details.
11937 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
11940 * Creates a copy of the ChannelMonitorUpdate
11942 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
11945 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
11947 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
11950 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
11952 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
11955 * Creates a copy of the ChannelMonitorUpdateErr
11957 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
11960 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
11962 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
11965 * Creates a copy of the MonitorUpdateError
11967 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
11970 * Frees any resources used by the MonitorEvent
11972 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
11975 * Creates a copy of the MonitorEvent
11977 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
11980 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
11982 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
11985 * Creates a copy of the HTLCUpdate
11987 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
11990 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
11992 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
11995 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
11997 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
12000 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
12002 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
12005 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
12007 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
12010 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
12013 * panics if the given update is not the next update by update_id.
12015 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);
12018 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
12021 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12024 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
12026 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12029 * Gets a list of txids, with their output scripts (in the order they appear in the
12030 * transaction), which we must learn about spends of via block_connected().
12032 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12035 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
12036 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
12037 * have been registered.
12039 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
12042 * Get the list of HTLCs who's status has been updated on chain. This should be called by
12043 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
12045 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12048 * Gets the list of pending events which were generated by previous actions, clearing the list
12051 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
12052 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
12053 * no internal locking in ChannelMonitors.
12055 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12058 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
12059 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
12060 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
12061 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
12062 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
12063 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
12064 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
12065 * out-of-band the other node operator to coordinate with him if option is available to you.
12066 * In any-case, choice is up to the user.
12068 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);
12071 * Processes transactions in a newly connected block, which may result in any of the following:
12072 * - update the monitor's state against resolved HTLCs
12073 * - punish the counterparty in the case of seeing a revoked commitment transaction
12074 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
12075 * - detect settled outputs for later spending
12076 * - schedule and bump any in-flight claims
12078 * Returns any new outputs to watch from `txdata`; after called, these are also included in
12079 * [`get_outputs_to_watch`].
12081 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
12083 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);
12086 * Determines if the disconnected block contained any transactions of interest and updates
12089 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);
12092 * Processes transactions confirmed in a block with the given header and height, returning new
12093 * outputs to watch. See [`block_connected`] for details.
12095 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
12096 * blocks. See [`chain::Confirm`] for calling expectations.
12098 * [`block_connected`]: Self::block_connected
12100 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);
12103 * Processes a transaction that was reorganized out of the chain.
12105 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
12106 * than blocks. See [`chain::Confirm`] for calling expectations.
12108 * [`block_disconnected`]: Self::block_disconnected
12110 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);
12113 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
12114 * [`block_connected`] for details.
12116 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
12117 * blocks. See [`chain::Confirm`] for calling expectations.
12119 * [`block_connected`]: Self::block_connected
12121 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);
12124 * Returns the set of txids that should be monitored for re-organization out of the chain.
12126 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12129 * Calls the free function if one is set
12131 void Persist_free(struct LDKPersist this_ptr);
12134 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
12136 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
12139 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
12141 void OutPoint_free(struct LDKOutPoint this_obj);
12144 * The referenced transaction's txid.
12146 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
12149 * The referenced transaction's txid.
12151 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12154 * The index of the referenced output in its transaction's vout.
12156 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
12159 * The index of the referenced output in its transaction's vout.
12161 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
12164 * Constructs a new OutPoint given each field
12166 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
12169 * Creates a copy of the OutPoint
12171 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
12174 * Checks if two OutPoints contain equal inner contents.
12175 * This ignores pointers and is_owned flags and looks at the values in fields.
12176 * Two objects with NULL inner values will be considered "equal" here.
12178 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
12181 * Checks if two OutPoints contain equal inner contents.
12183 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
12186 * Convert an `OutPoint` to a lightning channel id.
12188 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
12191 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
12193 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
12196 * Read a OutPoint from a byte array, created by OutPoint_write
12198 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
12201 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
12203 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
12206 * The outpoint which is spendable
12208 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12211 * The outpoint which is spendable
12213 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12216 * Per commitment point to derive delayed_payment_key by key holder
12218 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12221 * Per commitment point to derive delayed_payment_key by key holder
12223 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12226 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
12227 * the witness_script.
12229 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12232 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
12233 * the witness_script.
12235 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
12238 * The output which is referenced by the given outpoint
12240 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
12243 * The revocation point specific to the commitment transaction which was broadcast. Used to
12244 * derive the witnessScript for this output.
12246 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12249 * The revocation point specific to the commitment transaction which was broadcast. Used to
12250 * derive the witnessScript for this output.
12252 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12255 * Arbitrary identification information returned by a call to
12256 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12257 * the channel to spend the output.
12259 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
12262 * Arbitrary identification information returned by a call to
12263 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12264 * the channel to spend the output.
12266 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12269 * The value of the channel which this output originated from, possibly indirectly.
12271 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12274 * The value of the channel which this output originated from, possibly indirectly.
12276 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
12279 * Constructs a new DelayedPaymentOutputDescriptor given each field
12281 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);
12284 * Creates a copy of the DelayedPaymentOutputDescriptor
12286 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
12289 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
12291 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
12294 * The outpoint which is spendable
12296 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12299 * The outpoint which is spendable
12301 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12304 * The output which is referenced by the given outpoint
12306 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
12309 * Arbitrary identification information returned by a call to
12310 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12311 * the channel to spend the output.
12313 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
12316 * Arbitrary identification information returned by a call to
12317 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12318 * the channel to spend the output.
12320 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12323 * The value of the channel which this transactions spends.
12325 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12328 * The value of the channel which this transactions spends.
12330 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
12333 * Constructs a new StaticPaymentOutputDescriptor given each field
12335 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);
12338 * Creates a copy of the StaticPaymentOutputDescriptor
12340 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
12343 * Frees any resources used by the SpendableOutputDescriptor
12345 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
12348 * Creates a copy of the SpendableOutputDescriptor
12350 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
12353 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
12355 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
12358 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
12360 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
12363 * Calls the free function if one is set
12365 void BaseSign_free(struct LDKBaseSign this_ptr);
12368 * Creates a copy of a Sign
12370 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
12373 * Calls the free function if one is set
12375 void Sign_free(struct LDKSign this_ptr);
12378 * Calls the free function if one is set
12380 void KeysInterface_free(struct LDKKeysInterface this_ptr);
12383 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
12385 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
12388 * Private key of anchor tx
12390 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12393 * Private key of anchor tx
12395 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12398 * Holder secret key for blinded revocation pubkey
12400 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12403 * Holder secret key for blinded revocation pubkey
12405 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12408 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
12410 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12413 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
12415 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12418 * Holder secret key used in HTLC tx
12420 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12423 * Holder secret key used in HTLC tx
12425 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12428 * Holder htlc secret key used in commitment tx htlc outputs
12430 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12433 * Holder htlc secret key used in commitment tx htlc outputs
12435 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12440 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12445 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12448 * Creates a copy of the InMemorySigner
12450 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
12453 * Create a new InMemorySigner
12455 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);
12458 * Counterparty pubkeys.
12459 * Will panic if ready_channel wasn't called.
12461 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12464 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
12465 * transactions, ie the amount of time that we have to wait to recover our funds if we
12466 * broadcast a transaction.
12467 * Will panic if ready_channel wasn't called.
12469 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12472 * The contest_delay value specified by us and applied on transactions broadcastable
12473 * by our counterparty, ie the amount of time that they have to wait to recover their funds
12474 * if they broadcast a transaction.
12475 * Will panic if ready_channel wasn't called.
12477 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12480 * Whether the holder is the initiator
12481 * Will panic if ready_channel wasn't called.
12483 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12487 * Will panic if ready_channel wasn't called.
12489 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12492 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
12493 * building transactions.
12495 * Will panic if ready_channel wasn't called.
12497 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12500 * Sign the single input of spend_tx at index `input_idx` which spends the output
12501 * described by descriptor, returning the witness stack for the input.
12503 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
12504 * or is not spending the outpoint described by `descriptor.outpoint`.
12506 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);
12509 * Sign the single input of spend_tx at index `input_idx` which spends the output
12510 * described by descriptor, returning the witness stack for the input.
12512 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
12513 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
12514 * sequence set to `descriptor.to_self_delay`.
12516 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);
12519 * Constructs a new BaseSign which calls the relevant methods on this_arg.
12520 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
12522 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12525 * Constructs a new Sign which calls the relevant methods on this_arg.
12526 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
12528 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12531 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
12533 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
12536 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
12538 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
12541 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
12543 void KeysManager_free(struct LDKKeysManager this_obj);
12546 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
12547 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
12548 * starting_time isn't strictly required to actually be a time, but it must absolutely,
12549 * without a doubt, be unique to this instance. ie if you start multiple times with the same
12550 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
12551 * simply use the current time (with very high precision).
12553 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
12554 * obviously, starting_time should be unique every time you reload the library - it is only
12555 * used to generate new ephemeral key data (which will be stored by the individual channel if
12558 * Note that the seed is required to recover certain on-chain funds independent of
12559 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
12560 * channel, and some on-chain during-closing funds.
12562 * Note that until the 0.1 release there is no guarantee of backward compatibility between
12563 * versions. Once the library is more fully supported, the docs will be updated to include a
12564 * detailed description of the guarantee.
12566 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
12569 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
12571 * Key derivation parameters are accessible through a per-channel secrets
12572 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
12573 * onchain output detection for which a corresponding delayed_payment_key must be derived.
12575 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]);
12578 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
12579 * output to the given change destination (if sufficient change value remains). The
12580 * transaction will have a feerate, at least, of the given value.
12582 * Returns `Err(())` if the output value is greater than the input value minus required fee or
12583 * if a descriptor was duplicated.
12585 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
12587 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
12588 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
12590 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);
12593 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
12594 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
12596 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
12599 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
12601 void ChannelManager_free(struct LDKChannelManager this_obj);
12604 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
12606 void ChainParameters_free(struct LDKChainParameters this_obj);
12609 * The network for determining the `chain_hash` in Lightning messages.
12611 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
12614 * The network for determining the `chain_hash` in Lightning messages.
12616 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
12619 * The hash and height of the latest block successfully connected.
12621 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
12623 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
12626 * The hash and height of the latest block successfully connected.
12628 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
12630 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
12633 * Constructs a new ChainParameters given each field
12635 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
12638 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
12640 void BestBlock_free(struct LDKBestBlock this_obj);
12643 * Creates a copy of the BestBlock
12645 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
12648 * Returns the best block from the genesis of the given network.
12650 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
12653 * Returns the best block as identified by the given block hash and height.
12655 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
12658 * Returns the best block hash.
12660 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
12663 * Returns the best block height.
12665 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
12668 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
12670 void ChannelDetails_free(struct LDKChannelDetails this_obj);
12673 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
12674 * thereafter this is the txid of the funding transaction xor the funding transaction output).
12675 * Note that this means this value is *not* persistent - it can change once during the
12676 * lifetime of the channel.
12678 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
12681 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
12682 * thereafter this is the txid of the funding transaction xor the funding transaction output).
12683 * Note that this means this value is *not* persistent - it can change once during the
12684 * lifetime of the channel.
12686 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12689 * The Channel's funding transaction output, if we've negotiated the funding transaction with
12690 * our counterparty already.
12692 * Note that, if this has been set, `channel_id` will be equivalent to
12693 * `funding_txo.unwrap().to_channel_id()`.
12695 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12698 * The Channel's funding transaction output, if we've negotiated the funding transaction with
12699 * our counterparty already.
12701 * Note that, if this has been set, `channel_id` will be equivalent to
12702 * `funding_txo.unwrap().to_channel_id()`.
12704 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12707 * The position of the funding transaction in the chain. None if the funding transaction has
12708 * not yet been confirmed and the channel fully opened.
12710 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12713 * The position of the funding transaction in the chain. None if the funding transaction has
12714 * not yet been confirmed and the channel fully opened.
12716 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
12719 * The node_id of our counterparty
12721 struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12724 * The node_id of our counterparty
12726 void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12729 * The Features the channel counterparty provided upon last connection.
12730 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
12731 * many routing-relevant features are present in the init context.
12733 struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12736 * The Features the channel counterparty provided upon last connection.
12737 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
12738 * many routing-relevant features are present in the init context.
12740 void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
12743 * The value, in satoshis, of this channel as appears in the funding output
12745 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12748 * The value, in satoshis, of this channel as appears in the funding output
12750 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12753 * The user_id passed in to create_channel, or 0 if the channel was inbound.
12755 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12758 * The user_id passed in to create_channel, or 0 if the channel was inbound.
12760 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12763 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
12764 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12765 * available for inclusion in new outbound HTLCs). This further does not include any pending
12766 * outgoing HTLCs which are awaiting some other resolution to be sent.
12768 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12771 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
12772 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12773 * available for inclusion in new outbound HTLCs). This further does not include any pending
12774 * outgoing HTLCs which are awaiting some other resolution to be sent.
12776 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12779 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
12780 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12781 * available for inclusion in new inbound HTLCs).
12782 * Note that there are some corner cases not fully handled here, so the actual available
12783 * inbound capacity may be slightly higher than this.
12785 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12788 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
12789 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12790 * available for inclusion in new inbound HTLCs).
12791 * Note that there are some corner cases not fully handled here, so the actual available
12792 * inbound capacity may be slightly higher than this.
12794 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12797 * True if the channel was initiated (and thus funded) by us.
12799 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12802 * True if the channel was initiated (and thus funded) by us.
12804 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
12807 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
12808 * channel is not currently being shut down. `funding_locked` message exchange implies the
12809 * required confirmation count has been reached (and we were connected to the peer at some
12810 * point after the funding transaction received enough confirmations).
12812 bool ChannelDetails_get_is_funding_locked(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12815 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
12816 * channel is not currently being shut down. `funding_locked` message exchange implies the
12817 * required confirmation count has been reached (and we were connected to the peer at some
12818 * point after the funding transaction received enough confirmations).
12820 void ChannelDetails_set_is_funding_locked(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
12823 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
12824 * the peer is connected, (c) no monitor update failure is pending resolution, and (d) the
12825 * channel is not currently negotiating a shutdown.
12827 * This is a strict superset of `is_funding_locked`.
12829 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12832 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
12833 * the peer is connected, (c) no monitor update failure is pending resolution, and (d) the
12834 * channel is not currently negotiating a shutdown.
12836 * This is a strict superset of `is_funding_locked`.
12838 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
12841 * True if this channel is (or will be) publicly-announced.
12843 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12846 * True if this channel is (or will be) publicly-announced.
12848 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
12851 * Creates a copy of the ChannelDetails
12853 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
12856 * Frees any resources used by the PaymentSendFailure
12858 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
12861 * Creates a copy of the PaymentSendFailure
12863 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
12866 * Constructs a new ChannelManager to hold several channels and route between them.
12868 * This is the main \"logic hub\" for all channel-related actions, and implements
12869 * ChannelMessageHandler.
12871 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
12873 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
12875 * Users need to notify the new ChannelManager when a new block is connected or
12876 * disconnected using its `block_connected` and `block_disconnected` methods, starting
12877 * from after `params.latest_hash`.
12879 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);
12882 * Gets the current configuration applied to all new channels, as
12884 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
12887 * Creates a new outbound channel to the given remote node and with the given value.
12889 * user_id will be provided back as user_channel_id in FundingGenerationReady events to allow
12890 * tracking of which events correspond with which create_channel call. Note that the
12891 * user_channel_id defaults to 0 for inbound channels, so you may wish to avoid using 0 for
12892 * user_id here. user_id has no meaning inside of LDK, it is simply copied to events and
12893 * otherwise ignored.
12895 * If successful, will generate a SendOpenChannel message event, so you should probably poll
12896 * PeerManager::process_events afterwards.
12898 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
12899 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
12901 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);
12904 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
12905 * more information.
12907 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
12910 * Gets the list of usable channels, in random order. Useful as an argument to
12911 * get_route to ensure non-announced channels are used.
12913 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
12914 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
12917 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
12920 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
12921 * will be accepted on the given channel, and after additional timeout/the closing of all
12922 * pending HTLCs, the channel will be closed on chain.
12924 * May generate a SendShutdown message event on success, which should be relayed.
12926 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
12929 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
12930 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
12932 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
12935 * Force close all channels, immediately broadcasting the latest local commitment transaction
12936 * for each to the chain and rejecting new HTLCs on each.
12938 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
12941 * Sends a payment along a given route.
12943 * Value parameters are provided via the last hop in route, see documentation for RouteHop
12944 * fields for more info.
12946 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
12947 * payment), we don't do anything to stop you! We always try to ensure that if the provided
12948 * next hop knows the preimage to payment_hash they can claim an additional amount as
12949 * specified in the last hop in the route! Thus, you should probably do your own
12950 * payment_preimage tracking (which you should already be doing as they represent \"proof of
12951 * payment\") and prevent double-sends yourself.
12953 * May generate SendHTLCs message(s) event on success, which should be relayed.
12955 * Each path may have a different return value, and PaymentSendValue may return a Vec with
12956 * each entry matching the corresponding-index entry in the route paths, see
12957 * PaymentSendFailure for more info.
12959 * In general, a path may raise:
12960 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
12961 * node public key) is specified.
12962 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
12963 * (including due to previous monitor update failure or new permanent monitor update
12965 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
12966 * relevant updates.
12968 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
12969 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
12970 * different route unless you intend to pay twice!
12972 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
12973 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
12974 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
12975 * must not contain multiple paths as multi-path payments require a recipient-provided
12977 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
12978 * bit set (either as required or as available). If multiple paths are present in the Route,
12979 * we assume the invoice had the basic_mpp feature set.
12981 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);
12984 * Call this upon creation of a funding transaction for the given channel.
12986 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
12987 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
12989 * Panics if a funding transaction has already been provided for this channel.
12991 * May panic if the output found in the funding transaction is duplicative with some other
12992 * channel (note that this should be trivially prevented by using unique funding transaction
12993 * keys per-channel).
12995 * Do NOT broadcast the funding transaction yourself. When we have safely received our
12996 * counterparty's signature the funding transaction will automatically be broadcast via the
12997 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
12999 * Note that this includes RBF or similar transaction replacement strategies - lightning does
13000 * not currently support replacing a funding transaction on an existing channel. Instead,
13001 * create a new channel with a conflicting funding transaction.
13003 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
13005 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);
13008 * Regenerates channel_announcements and generates a signed node_announcement from the given
13009 * arguments, providing them in corresponding events via
13010 * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed
13011 * on-chain. This effectively re-broadcasts all channel announcements and sends our node
13012 * announcement to ensure that the lightning P2P network is aware of the channels we have and
13013 * our network addresses.
13015 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
13016 * node to humans. They carry no in-protocol meaning.
13018 * `addresses` represent the set (possibly empty) of socket addresses on which this node
13019 * accepts incoming connections. These will be included in the node_announcement, publicly
13020 * tying these addresses together and to this node. If you wish to preserve user privacy,
13021 * addresses should likely contain only Tor Onion addresses.
13023 * Panics if `addresses` is absurdly large (more than 500).
13025 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
13027 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
13030 * Processes HTLCs which are pending waiting on random forward delay.
13032 * Should only really ever be called in response to a PendingHTLCsForwardable event.
13033 * Will likely generate further events.
13035 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
13038 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
13039 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
13040 * to inform the network about the uselessness of these channels.
13042 * This method handles all the details, and must be called roughly once per minute.
13044 * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
13046 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
13049 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
13050 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
13051 * along the path (including in our own channel on which we received it).
13052 * Returns false if no payment was found to fail backwards, true if the process of failing the
13053 * HTLC backwards has been started.
13055 MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
13058 * Provides a payment preimage in response to a PaymentReceived event, returning true and
13059 * generating message events for the net layer to claim the payment, if possible. Thus, you
13060 * should probably kick the net layer to go send messages if this returns true!
13062 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
13063 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
13064 * event matches your expectation. If you fail to do so and call this method, you may provide
13065 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
13067 * May panic if called except in response to a PaymentReceived event.
13069 * [`create_inbound_payment`]: Self::create_inbound_payment
13070 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
13072 MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
13075 * Gets the node_id held by this ChannelManager
13077 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
13080 * Restores a single, given channel to normal operation after a
13081 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
13084 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
13085 * fully committed in every copy of the given channels' ChannelMonitors.
13087 * Note that there is no effect to calling with a highest_applied_update_id other than the
13088 * current latest ChannelMonitorUpdate and one call to this function after multiple
13089 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
13090 * exists largely only to prevent races between this and concurrent update_monitor calls.
13092 * Thus, the anticipated use is, at a high level:
13093 * 1) You register a chain::Watch with this ChannelManager,
13094 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
13095 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
13096 * any time it cannot do so instantly,
13097 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
13098 * 4) once all remote copies are updated, you call this function with the update_id that
13099 * completed, and once it is the latest the Channel will be re-enabled.
13101 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);
13104 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
13107 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
13108 * [`PaymentHash`] and [`PaymentPreimage`] for you, returning the first and storing the second.
13110 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
13111 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
13112 * passed directly to [`claim_funds`].
13114 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
13116 * [`claim_funds`]: Self::claim_funds
13117 * [`PaymentReceived`]: events::Event::PaymentReceived
13118 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
13119 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
13121 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);
13124 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
13125 * stored external to LDK.
13127 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
13128 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
13129 * the `min_value_msat` provided here, if one is provided.
13131 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) must be globally unique. This
13132 * method may return an Err if another payment with the same payment_hash is still pending.
13134 * `user_payment_id` will be provided back in [`PaymentReceived::user_payment_id`] events to
13135 * allow tracking of which events correspond with which calls to this and
13136 * [`create_inbound_payment`]. `user_payment_id` has no meaning inside of LDK, it is simply
13137 * copied to events and otherwise ignored. It may be used to correlate PaymentReceived events
13138 * with invoice metadata stored elsewhere.
13140 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
13141 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
13142 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
13143 * sender \"proof-of-payment\" unless they have paid the required amount.
13145 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
13146 * in excess of the current time. This should roughly match the expiry time set in the invoice.
13147 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
13148 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
13149 * invoices when no timeout is set.
13151 * Note that we use block header time to time-out pending inbound payments (with some margin
13152 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
13153 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
13154 * If you need exact expiry semantics, you should enforce them upon receipt of
13155 * [`PaymentReceived`].
13157 * Pending inbound payments are stored in memory and in serialized versions of this
13158 * [`ChannelManager`]. If potentially unbounded numbers of inbound payments may exist and
13159 * space is limited, you may wish to rate-limit inbound payment creation.
13161 * May panic if `invoice_expiry_delta_secs` is greater than one year.
13163 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
13164 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
13166 * [`create_inbound_payment`]: Self::create_inbound_payment
13167 * [`PaymentReceived`]: events::Event::PaymentReceived
13168 * [`PaymentReceived::user_payment_id`]: events::Event::PaymentReceived::user_payment_id
13170 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);
13173 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
13174 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
13176 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
13179 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
13180 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
13182 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
13185 * Constructs a new Listen which calls the relevant methods on this_arg.
13186 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
13188 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
13191 * Constructs a new Confirm which calls the relevant methods on this_arg.
13192 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
13194 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
13197 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
13198 * indicating whether persistence is necessary. Only one listener on
13199 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
13201 * Note that the feature `allow_wallclock_use` must be enabled to use this function.
13203 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
13206 * Blocks until ChannelManager needs to be persisted. Only one listener on
13207 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
13210 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
13213 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
13214 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
13216 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
13219 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
13221 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
13224 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
13226 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
13229 * The keys provider which will give us relevant keys. Some keys will be loaded during
13230 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
13233 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13236 * The keys provider which will give us relevant keys. Some keys will be loaded during
13237 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
13240 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
13243 * The fee_estimator for use in the ChannelManager in the future.
13245 * No calls to the FeeEstimator will be made during deserialization.
13247 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13250 * The fee_estimator for use in the ChannelManager in the future.
13252 * No calls to the FeeEstimator will be made during deserialization.
13254 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
13257 * The chain::Watch for use in the ChannelManager in the future.
13259 * No calls to the chain::Watch will be made during deserialization. It is assumed that
13260 * you have deserialized ChannelMonitors separately and will add them to your
13261 * chain::Watch after deserializing this ChannelManager.
13263 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13266 * The chain::Watch for use in the ChannelManager in the future.
13268 * No calls to the chain::Watch will be made during deserialization. It is assumed that
13269 * you have deserialized ChannelMonitors separately and will add them to your
13270 * chain::Watch after deserializing this ChannelManager.
13272 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
13275 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
13276 * used to broadcast the latest local commitment transactions of channels which must be
13277 * force-closed during deserialization.
13279 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13282 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
13283 * used to broadcast the latest local commitment transactions of channels which must be
13284 * force-closed during deserialization.
13286 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
13289 * The Logger for use in the ChannelManager and which may be used to log information during
13292 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13295 * The Logger for use in the ChannelManager and which may be used to log information during
13298 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
13301 * Default settings used for new channels. Any existing channels will continue to use the
13302 * runtime settings which were stored when the ChannelManager was serialized.
13304 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13307 * Default settings used for new channels. Any existing channels will continue to use the
13308 * runtime settings which were stored when the ChannelManager was serialized.
13310 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
13313 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
13314 * HashMap for you. This is primarily useful for C bindings where it is not practical to
13315 * populate a HashMap directly from C.
13317 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);
13320 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
13322 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
13325 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
13327 void DecodeError_free(struct LDKDecodeError this_obj);
13330 * Creates a copy of the DecodeError
13332 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
13335 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
13337 void Init_free(struct LDKInit this_obj);
13340 * The relevant features which the sender supports
13342 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
13345 * The relevant features which the sender supports
13347 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
13350 * Constructs a new Init given each field
13352 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
13355 * Creates a copy of the Init
13357 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
13360 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
13362 void ErrorMessage_free(struct LDKErrorMessage this_obj);
13365 * The channel ID involved in the error
13367 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
13370 * The channel ID involved in the error
13372 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13375 * A possibly human-readable error description.
13376 * The string should be sanitized before it is used (e.g. emitted to logs
13377 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
13378 * vulnerability in the terminal emulator or the logging subsystem.
13380 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
13383 * A possibly human-readable error description.
13384 * The string should be sanitized before it is used (e.g. emitted to logs
13385 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
13386 * vulnerability in the terminal emulator or the logging subsystem.
13388 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
13391 * Constructs a new ErrorMessage given each field
13393 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
13396 * Creates a copy of the ErrorMessage
13398 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
13401 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
13403 void Ping_free(struct LDKPing this_obj);
13406 * The desired response length
13408 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
13411 * The desired response length
13413 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
13416 * The ping packet size.
13417 * This field is not sent on the wire. byteslen zeros are sent.
13419 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
13422 * The ping packet size.
13423 * This field is not sent on the wire. byteslen zeros are sent.
13425 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
13428 * Constructs a new Ping given each field
13430 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
13433 * Creates a copy of the Ping
13435 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
13438 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
13440 void Pong_free(struct LDKPong this_obj);
13443 * The pong packet size.
13444 * This field is not sent on the wire. byteslen zeros are sent.
13446 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
13449 * The pong packet size.
13450 * This field is not sent on the wire. byteslen zeros are sent.
13452 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
13455 * Constructs a new Pong given each field
13457 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
13460 * Creates a copy of the Pong
13462 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
13465 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
13467 void OpenChannel_free(struct LDKOpenChannel this_obj);
13470 * The genesis hash of the blockchain where the channel is to be opened
13472 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
13475 * The genesis hash of the blockchain where the channel is to be opened
13477 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13480 * A temporary channel ID, until the funding outpoint is announced
13482 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
13485 * A temporary channel ID, until the funding outpoint is announced
13487 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13490 * The channel value
13492 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13495 * The channel value
13497 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13500 * The amount to push to the counterparty as part of the open, in milli-satoshi
13502 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13505 * The amount to push to the counterparty as part of the open, in milli-satoshi
13507 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13510 * The threshold below which outputs on transactions broadcast by sender will be omitted
13512 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13515 * The threshold below which outputs on transactions broadcast by sender will be omitted
13517 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13520 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13522 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13525 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13527 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13530 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13532 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13535 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13537 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13540 * The minimum HTLC size incoming to sender, in milli-satoshi
13542 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13545 * The minimum HTLC size incoming to sender, in milli-satoshi
13547 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13550 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
13552 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13555 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
13557 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
13560 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13562 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13565 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13567 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
13570 * The maximum number of inbound HTLCs towards sender
13572 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13575 * The maximum number of inbound HTLCs towards sender
13577 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
13580 * The sender's key controlling the funding transaction
13582 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13585 * The sender's key controlling the funding transaction
13587 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13590 * Used to derive a revocation key for transactions broadcast by counterparty
13592 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13595 * Used to derive a revocation key for transactions broadcast by counterparty
13597 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13600 * A payment key to sender for transactions broadcast by counterparty
13602 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13605 * A payment key to sender for transactions broadcast by counterparty
13607 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13610 * Used to derive a payment key to sender for transactions broadcast by sender
13612 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13615 * Used to derive a payment key to sender for transactions broadcast by sender
13617 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13620 * Used to derive an HTLC payment key to sender
13622 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13625 * Used to derive an HTLC payment key to sender
13627 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13630 * The first to-be-broadcast-by-sender transaction's per commitment point
13632 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13635 * The first to-be-broadcast-by-sender transaction's per commitment point
13637 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13642 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13647 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
13650 * Creates a copy of the OpenChannel
13652 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
13655 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
13657 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
13660 * A temporary channel ID, until the funding outpoint is announced
13662 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
13665 * A temporary channel ID, until the funding outpoint is announced
13667 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13670 * The threshold below which outputs on transactions broadcast by sender will be omitted
13672 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13675 * The threshold below which outputs on transactions broadcast by sender will be omitted
13677 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13680 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13682 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13685 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13687 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13690 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13692 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13695 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13697 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13700 * The minimum HTLC size incoming to sender, in milli-satoshi
13702 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13705 * The minimum HTLC size incoming to sender, in milli-satoshi
13707 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13710 * Minimum depth of the funding transaction before the channel is considered open
13712 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13715 * Minimum depth of the funding transaction before the channel is considered open
13717 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
13720 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13722 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13725 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13727 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
13730 * The maximum number of inbound HTLCs towards sender
13732 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13735 * The maximum number of inbound HTLCs towards sender
13737 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
13740 * The sender's key controlling the funding transaction
13742 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13745 * The sender's key controlling the funding transaction
13747 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13750 * Used to derive a revocation key for transactions broadcast by counterparty
13752 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13755 * Used to derive a revocation key for transactions broadcast by counterparty
13757 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13760 * A payment key to sender for transactions broadcast by counterparty
13762 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13765 * A payment key to sender for transactions broadcast by counterparty
13767 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13770 * Used to derive a payment key to sender for transactions broadcast by sender
13772 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13775 * Used to derive a payment key to sender for transactions broadcast by sender
13777 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13780 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
13782 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13785 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
13787 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13790 * The first to-be-broadcast-by-sender transaction's per commitment point
13792 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13795 * The first to-be-broadcast-by-sender transaction's per commitment point
13797 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13800 * Creates a copy of the AcceptChannel
13802 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
13805 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
13807 void FundingCreated_free(struct LDKFundingCreated this_obj);
13810 * A temporary channel ID, until the funding is established
13812 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
13815 * A temporary channel ID, until the funding is established
13817 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13820 * The funding transaction ID
13822 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
13825 * The funding transaction ID
13827 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13830 * The specific output index funding this channel
13832 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
13835 * The specific output index funding this channel
13837 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
13840 * The signature of the channel initiator (funder) on the funding transaction
13842 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
13845 * The signature of the channel initiator (funder) on the funding transaction
13847 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
13850 * Constructs a new FundingCreated given each field
13852 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);
13855 * Creates a copy of the FundingCreated
13857 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
13860 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
13862 void FundingSigned_free(struct LDKFundingSigned this_obj);
13867 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
13872 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13875 * The signature of the channel acceptor (fundee) on the funding transaction
13877 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
13880 * The signature of the channel acceptor (fundee) on the funding transaction
13882 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
13885 * Constructs a new FundingSigned given each field
13887 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
13890 * Creates a copy of the FundingSigned
13892 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
13895 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
13897 void FundingLocked_free(struct LDKFundingLocked this_obj);
13902 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
13907 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13910 * The per-commitment point of the second commitment transaction
13912 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
13915 * The per-commitment point of the second commitment transaction
13917 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13920 * Constructs a new FundingLocked given each field
13922 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
13925 * Creates a copy of the FundingLocked
13927 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
13930 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
13932 void Shutdown_free(struct LDKShutdown this_obj);
13937 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
13942 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13945 * The destination of this peer's funds on closing.
13946 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
13948 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
13951 * The destination of this peer's funds on closing.
13952 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
13954 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
13957 * Constructs a new Shutdown given each field
13959 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
13962 * Creates a copy of the Shutdown
13964 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
13967 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
13969 void ClosingSigned_free(struct LDKClosingSigned this_obj);
13974 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
13979 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13982 * The proposed total fee for the closing transaction
13984 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
13987 * The proposed total fee for the closing transaction
13989 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
13992 * A signature on the closing transaction
13994 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
13997 * A signature on the closing transaction
13999 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
14002 * Constructs a new ClosingSigned given each field
14004 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
14007 * Creates a copy of the ClosingSigned
14009 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
14012 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
14014 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
14019 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
14024 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14029 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
14034 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
14037 * The HTLC value in milli-satoshi
14039 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
14042 * The HTLC value in milli-satoshi
14044 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
14047 * The payment hash, the pre-image of which controls HTLC redemption
14049 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
14052 * The payment hash, the pre-image of which controls HTLC redemption
14054 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14057 * The expiry height of the HTLC
14059 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
14062 * The expiry height of the HTLC
14064 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
14067 * Creates a copy of the UpdateAddHTLC
14069 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
14072 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
14074 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
14079 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
14084 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14089 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
14094 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
14097 * The pre-image of the payment hash, allowing HTLC redemption
14099 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
14102 * The pre-image of the payment hash, allowing HTLC redemption
14104 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14107 * Constructs a new UpdateFulfillHTLC given each field
14109 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
14112 * Creates a copy of the UpdateFulfillHTLC
14114 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
14117 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
14119 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
14124 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
14129 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14134 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
14139 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
14142 * Creates a copy of the UpdateFailHTLC
14144 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
14147 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
14149 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
14154 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
14159 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14164 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
14169 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
14174 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
14179 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
14182 * Creates a copy of the UpdateFailMalformedHTLC
14184 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
14187 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
14189 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
14194 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
14199 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14202 * A signature on the commitment transaction
14204 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
14207 * A signature on the commitment transaction
14209 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
14212 * Signatures on the HTLC transactions
14214 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
14217 * Constructs a new CommitmentSigned given each field
14219 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
14222 * Creates a copy of the CommitmentSigned
14224 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
14227 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
14229 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
14234 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
14239 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14242 * The secret corresponding to the per-commitment point
14244 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
14247 * The secret corresponding to the per-commitment point
14249 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14252 * The next sender-broadcast commitment transaction's per-commitment point
14254 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
14257 * The next sender-broadcast commitment transaction's per-commitment point
14259 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14262 * Constructs a new RevokeAndACK given each field
14264 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);
14267 * Creates a copy of the RevokeAndACK
14269 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
14272 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
14274 void UpdateFee_free(struct LDKUpdateFee this_obj);
14279 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
14284 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14287 * Fee rate per 1000-weight of the transaction
14289 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
14292 * Fee rate per 1000-weight of the transaction
14294 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
14297 * Constructs a new UpdateFee given each field
14299 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
14302 * Creates a copy of the UpdateFee
14304 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
14307 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
14309 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
14312 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
14313 * belonging to the recipient
14315 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
14318 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
14319 * belonging to the recipient
14321 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14324 * The sender's per-commitment point for their current commitment transaction
14326 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
14329 * The sender's per-commitment point for their current commitment transaction
14331 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14334 * Constructs a new DataLossProtect given each field
14336 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
14339 * Creates a copy of the DataLossProtect
14341 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
14344 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
14346 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
14351 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
14356 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14359 * The next commitment number for the sender
14361 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
14364 * The next commitment number for the sender
14366 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
14369 * The next commitment number for the recipient
14371 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
14374 * The next commitment number for the recipient
14376 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
14379 * Creates a copy of the ChannelReestablish
14381 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
14384 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
14386 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
14391 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
14396 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14399 * The short channel ID
14401 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
14404 * The short channel ID
14406 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
14409 * A signature by the node key
14411 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
14414 * A signature by the node key
14416 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
14419 * A signature by the funding key
14421 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
14424 * A signature by the funding key
14426 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
14429 * Constructs a new AnnouncementSignatures given each field
14431 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);
14434 * Creates a copy of the AnnouncementSignatures
14436 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
14439 * Frees any resources used by the NetAddress
14441 void NetAddress_free(struct LDKNetAddress this_ptr);
14444 * Creates a copy of the NetAddress
14446 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
14449 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
14451 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
14454 * Read a Result from a byte array, created by Result_write
14456 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
14459 * Read a NetAddress from a byte array, created by NetAddress_write
14461 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
14464 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
14466 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
14469 * The advertised features
14471 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
14474 * The advertised features
14476 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
14479 * A strictly monotonic announcement counter, with gaps allowed
14481 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
14484 * A strictly monotonic announcement counter, with gaps allowed
14486 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
14489 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
14492 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
14495 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
14498 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14501 * An RGB color for UI purposes
14503 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
14506 * An RGB color for UI purposes
14508 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
14511 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
14514 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
14517 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
14520 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14523 * List of addresses on which this node is reachable
14525 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
14528 * Creates a copy of the UnsignedNodeAnnouncement
14530 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
14533 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
14535 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
14538 * The signature by the node key
14540 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
14543 * The signature by the node key
14545 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14548 * The actual content of the announcement
14550 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
14553 * The actual content of the announcement
14555 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
14558 * Constructs a new NodeAnnouncement given each field
14560 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
14563 * Creates a copy of the NodeAnnouncement
14565 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
14568 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
14570 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
14573 * The advertised channel features
14575 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14578 * The advertised channel features
14580 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
14583 * The genesis hash of the blockchain where the channel is to be opened
14585 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
14588 * The genesis hash of the blockchain where the channel is to be opened
14590 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14593 * The short channel ID
14595 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14598 * The short channel ID
14600 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
14603 * One of the two node_ids which are endpoints of this channel
14605 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14608 * One of the two node_ids which are endpoints of this channel
14610 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14613 * The other of the two node_ids which are endpoints of this channel
14615 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14618 * The other of the two node_ids which are endpoints of this channel
14620 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14623 * The funding key for the first node
14625 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14628 * The funding key for the first node
14630 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14633 * The funding key for the second node
14635 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14638 * The funding key for the second node
14640 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14643 * Creates a copy of the UnsignedChannelAnnouncement
14645 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
14648 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
14650 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
14653 * Authentication of the announcement by the first public node
14655 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14658 * Authentication of the announcement by the first public node
14660 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14663 * Authentication of the announcement by the second public node
14665 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14668 * Authentication of the announcement by the second public node
14670 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14673 * Proof of funding UTXO ownership by the first public node
14675 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14678 * Proof of funding UTXO ownership by the first public node
14680 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14683 * Proof of funding UTXO ownership by the second public node
14685 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14688 * Proof of funding UTXO ownership by the second public node
14690 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14693 * The actual announcement
14695 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14698 * The actual announcement
14700 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
14703 * Constructs a new ChannelAnnouncement given each field
14705 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);
14708 * Creates a copy of the ChannelAnnouncement
14710 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
14713 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
14715 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
14718 * The genesis hash of the blockchain where the channel is to be opened
14720 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
14723 * The genesis hash of the blockchain where the channel is to be opened
14725 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14728 * The short channel ID
14730 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14733 * The short channel ID
14735 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
14738 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
14740 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14743 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
14745 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
14750 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14755 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
14758 * The number of blocks such that if:
14759 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
14760 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
14761 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
14762 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
14763 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
14764 * forwarding. Note that the HTLC sender is the one who originally sets this value when
14765 * constructing the route.
14767 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14770 * The number of blocks such that if:
14771 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
14772 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
14773 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
14774 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
14775 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
14776 * forwarding. Note that the HTLC sender is the one who originally sets this value when
14777 * constructing the route.
14779 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
14782 * The minimum HTLC size incoming to sender, in milli-satoshi
14784 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14787 * The minimum HTLC size incoming to sender, in milli-satoshi
14789 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
14792 * The base HTLC fee charged by sender, in milli-satoshi
14794 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14797 * The base HTLC fee charged by sender, in milli-satoshi
14799 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
14802 * The amount to fee multiplier, in micro-satoshi
14804 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14807 * The amount to fee multiplier, in micro-satoshi
14809 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
14812 * Creates a copy of the UnsignedChannelUpdate
14814 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
14817 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
14819 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
14822 * A signature of the channel update
14824 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
14827 * A signature of the channel update
14829 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
14832 * The actual channel update
14834 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
14837 * The actual channel update
14839 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
14842 * Constructs a new ChannelUpdate given each field
14844 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
14847 * Creates a copy of the ChannelUpdate
14849 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
14852 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
14854 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
14857 * The genesis hash of the blockchain being queried
14859 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
14862 * The genesis hash of the blockchain being queried
14864 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14867 * The height of the first block for the channel UTXOs being queried
14869 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
14872 * The height of the first block for the channel UTXOs being queried
14874 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
14877 * The number of blocks to include in the query results
14879 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
14882 * The number of blocks to include in the query results
14884 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
14887 * Constructs a new QueryChannelRange given each field
14889 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
14892 * Creates a copy of the QueryChannelRange
14894 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
14897 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
14899 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
14902 * The genesis hash of the blockchain being queried
14904 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
14907 * The genesis hash of the blockchain being queried
14909 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14912 * The height of the first block in the range of the reply
14914 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
14917 * The height of the first block in the range of the reply
14919 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
14922 * The number of blocks included in the range of the reply
14924 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
14927 * The number of blocks included in the range of the reply
14929 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
14932 * True when this is the final reply for a query
14934 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
14937 * True when this is the final reply for a query
14939 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
14942 * The short_channel_ids in the channel range
14944 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
14947 * Constructs a new ReplyChannelRange given each field
14949 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);
14952 * Creates a copy of the ReplyChannelRange
14954 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
14957 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
14959 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
14962 * The genesis hash of the blockchain being queried
14964 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
14967 * The genesis hash of the blockchain being queried
14969 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14972 * The short_channel_ids that are being queried
14974 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
14977 * Constructs a new QueryShortChannelIds given each field
14979 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
14982 * Creates a copy of the QueryShortChannelIds
14984 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
14987 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
14989 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
14992 * The genesis hash of the blockchain that was queried
14994 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
14997 * The genesis hash of the blockchain that was queried
14999 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15002 * Indicates if the query recipient maintains up-to-date channel
15003 * information for the chain_hash
15005 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
15008 * Indicates if the query recipient maintains up-to-date channel
15009 * information for the chain_hash
15011 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
15014 * Constructs a new ReplyShortChannelIdsEnd given each field
15016 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
15019 * Creates a copy of the ReplyShortChannelIdsEnd
15021 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
15024 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
15026 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
15029 * The genesis hash of the blockchain for channel and node information
15031 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
15034 * The genesis hash of the blockchain for channel and node information
15036 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15039 * The starting unix timestamp
15041 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
15044 * The starting unix timestamp
15046 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
15049 * The range of information in seconds
15051 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
15054 * The range of information in seconds
15056 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
15059 * Constructs a new GossipTimestampFilter given each field
15061 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
15064 * Creates a copy of the GossipTimestampFilter
15066 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
15069 * Frees any resources used by the ErrorAction
15071 void ErrorAction_free(struct LDKErrorAction this_ptr);
15074 * Creates a copy of the ErrorAction
15076 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
15079 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
15081 void LightningError_free(struct LDKLightningError this_obj);
15084 * A human-readable message describing the error
15086 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
15089 * A human-readable message describing the error
15091 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
15094 * The action which should be taken against the offending peer.
15096 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
15099 * The action which should be taken against the offending peer.
15101 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
15104 * Constructs a new LightningError given each field
15106 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
15109 * Creates a copy of the LightningError
15111 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
15114 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
15116 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
15119 * update_add_htlc messages which should be sent
15121 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
15124 * update_fulfill_htlc messages which should be sent
15126 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
15129 * update_fail_htlc messages which should be sent
15131 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
15134 * update_fail_malformed_htlc messages which should be sent
15136 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
15139 * An update_fee message which should be sent
15141 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
15144 * An update_fee message which should be sent
15146 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
15149 * Finally, the commitment_signed message which should be sent
15151 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
15154 * Finally, the commitment_signed message which should be sent
15156 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
15159 * Constructs a new CommitmentUpdate given each field
15161 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);
15164 * Creates a copy of the CommitmentUpdate
15166 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
15169 * Frees any resources used by the HTLCFailChannelUpdate
15171 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
15174 * Creates a copy of the HTLCFailChannelUpdate
15176 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
15179 * Calls the free function if one is set
15181 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
15184 * Calls the free function if one is set
15186 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
15189 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
15191 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
15194 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
15196 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
15199 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
15201 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
15204 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
15206 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
15209 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
15211 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
15214 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
15216 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
15219 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
15221 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
15224 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
15226 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
15229 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
15231 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
15234 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
15236 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
15239 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
15241 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
15244 * Read a FundingCreated from a byte array, created by FundingCreated_write
15246 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
15249 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
15251 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
15254 * Read a FundingSigned from a byte array, created by FundingSigned_write
15256 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
15259 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
15261 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
15264 * Read a FundingLocked from a byte array, created by FundingLocked_write
15266 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
15269 * Serialize the Init object into a byte array which can be read by Init_read
15271 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
15274 * Read a Init from a byte array, created by Init_write
15276 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
15279 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
15281 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
15284 * Read a OpenChannel from a byte array, created by OpenChannel_write
15286 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
15289 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
15291 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
15294 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
15296 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
15299 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
15301 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
15304 * Read a Shutdown from a byte array, created by Shutdown_write
15306 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
15309 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
15311 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
15314 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
15316 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
15319 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
15321 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
15324 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
15326 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
15329 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
15331 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
15334 * Read a UpdateFee from a byte array, created by UpdateFee_write
15336 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
15339 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
15341 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
15344 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
15346 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
15349 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
15351 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
15354 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
15356 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
15359 * Serialize the Ping object into a byte array which can be read by Ping_read
15361 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
15364 * Read a Ping from a byte array, created by Ping_write
15366 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
15369 * Serialize the Pong object into a byte array which can be read by Pong_read
15371 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
15374 * Read a Pong from a byte array, created by Pong_write
15376 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
15379 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
15381 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
15384 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
15386 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
15389 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
15391 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
15394 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
15396 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
15399 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
15401 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
15404 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
15406 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
15409 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
15411 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
15414 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
15416 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
15419 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
15421 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
15424 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
15426 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
15429 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
15431 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
15434 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
15436 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
15439 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
15441 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
15444 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
15446 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
15449 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
15451 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
15454 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
15456 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
15459 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
15461 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
15464 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
15466 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
15469 *\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
15471 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
15474 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
15476 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
15479 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
15481 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
15484 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
15486 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
15489 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
15491 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
15494 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
15496 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
15499 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
15501 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
15504 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
15506 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
15509 * Constructs a new IgnoringMessageHandler given each field
15511 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
15514 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
15515 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
15517 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
15520 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
15521 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
15523 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
15526 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
15528 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
15531 * Constructs a new ErroringMessageHandler
15533 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
15536 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
15537 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
15539 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
15542 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
15543 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
15545 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
15548 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
15550 void MessageHandler_free(struct LDKMessageHandler this_obj);
15553 * A message handler which handles messages specific to channels. Usually this is just a
15554 * ChannelManager object or a ErroringMessageHandler.
15556 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
15559 * A message handler which handles messages specific to channels. Usually this is just a
15560 * ChannelManager object or a ErroringMessageHandler.
15562 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
15565 * A message handler which handles messages updating our knowledge of the network channel
15566 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
15568 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
15571 * A message handler which handles messages updating our knowledge of the network channel
15572 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
15574 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
15577 * Constructs a new MessageHandler given each field
15579 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
15582 * Creates a copy of a SocketDescriptor
15584 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
15587 * Calls the free function if one is set
15589 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
15592 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
15594 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
15597 * Used to indicate that we probably can't make any future connections to this peer, implying
15598 * we should go ahead and force-close any channels we have with it.
15600 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
15603 * Used to indicate that we probably can't make any future connections to this peer, implying
15604 * we should go ahead and force-close any channels we have with it.
15606 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
15609 * Constructs a new PeerHandleError given each field
15611 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
15614 * Creates a copy of the PeerHandleError
15616 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
15619 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
15621 void PeerManager_free(struct LDKPeerManager this_obj);
15624 * Constructs a new PeerManager with the given message handlers and node_id secret key
15625 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
15626 * cryptographically secure random bytes.
15628 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);
15631 * Get the list of node ids for peers which have completed the initial handshake.
15633 * For outbound connections, this will be the same as the their_node_id parameter passed in to
15634 * new_outbound_connection, however entries will only appear once the initial handshake has
15635 * completed and we are sure the remote peer has the private key for the given node_id.
15637 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
15640 * Indicates a new outbound connection has been established to a node with the given node_id.
15641 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
15642 * descriptor but must disconnect the connection immediately.
15644 * Returns a small number of bytes to send to the remote node (currently always 50).
15646 * Panics if descriptor is duplicative with some other descriptor which has not yet had a
15647 * socket_disconnected().
15649 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);
15652 * Indicates a new inbound connection has been established.
15654 * May refuse the connection by returning an Err, but will never write bytes to the remote end
15655 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
15656 * call socket_disconnected for the new descriptor but must disconnect the connection
15659 * Panics if descriptor is duplicative with some other descriptor which has not yet had
15660 * socket_disconnected called.
15662 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
15665 * Indicates that there is room to write data to the given socket descriptor.
15667 * May return an Err to indicate that the connection should be closed.
15669 * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
15670 * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
15671 * invariants around calling write_buffer_space_avail in case a write did not fully complete
15672 * must still hold - be ready to call write_buffer_space_avail again if a write call generated
15673 * here isn't sufficient! Panics if the descriptor was not previously registered in a
15674 * new_\\*_connection event.
15676 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
15679 * Indicates that data was read from the given socket descriptor.
15681 * May return an Err to indicate that the connection should be closed.
15683 * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
15684 * Thus, however, you almost certainly want to call process_events() after any read_event to
15685 * generate send_data calls to handle responses.
15687 * If Ok(true) is returned, further read_events should not be triggered until a send_data call
15688 * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
15690 * Panics if the descriptor was not previously registered in a new_*_connection event.
15692 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);
15695 * Checks for any events generated by our handlers and processes them. Includes sending most
15696 * response messages as well as messages generated by calls to handler functions directly (eg
15697 * functions like ChannelManager::process_pending_htlc_forward or send_payment).
15699 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
15702 * Indicates that the given socket descriptor's connection is now closed.
15704 * This must only be called if the socket has been disconnected by the peer or your own
15705 * decision to disconnect it and must NOT be called in any case where other parts of this
15706 * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
15709 * Panics if the descriptor was not previously registered in a successful new_*_connection event.
15711 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
15714 * Disconnect a peer given its node id.
15716 * Set no_connection_possible to true to prevent any further connection with this peer,
15717 * force-closing any channels we have with it.
15719 * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer,
15720 * so be careful about reentrancy issues.
15722 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
15725 * This function should be called roughly once every 30 seconds.
15726 * It will send pings to each peer and disconnect those which did not respond to the last round of pings.
15727 * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
15729 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
15732 * Build the commitment secret from the seed and the commitment number
15734 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
15737 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
15738 * from the base secret and the per_commitment_point.
15740 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15741 * generated (ie our own).
15743 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
15746 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
15747 * from the base point and the per_commitment_key. This is the public equivalent of
15748 * derive_private_key - using only public keys to derive a public key instead of private keys.
15750 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15751 * generated (ie our own).
15753 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
15756 * Derives a per-commitment-transaction revocation key from its constituent parts.
15758 * Only the cheating participant owns a valid witness to propagate a revoked
15759 * commitment transaction, thus per_commitment_secret always come from cheater
15760 * and revocation_base_secret always come from punisher, which is the broadcaster
15761 * of the transaction spending with this key knowledge.
15763 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15764 * generated (ie our own).
15766 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
15769 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
15770 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
15771 * public key instead of private keys.
15773 * Only the cheating participant owns a valid witness to propagate a revoked
15774 * commitment transaction, thus per_commitment_point always come from cheater
15775 * and revocation_base_point always come from punisher, which is the broadcaster
15776 * of the transaction spending with this key knowledge.
15778 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15779 * generated (ie our own).
15781 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
15784 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
15786 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
15789 * The broadcaster's per-commitment public key which was used to derive the other keys.
15791 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15794 * The broadcaster's per-commitment public key which was used to derive the other keys.
15796 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15799 * The revocation key which is used to allow the broadcaster of the commitment
15800 * transaction to provide their counterparty the ability to punish them if they broadcast
15803 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15806 * The revocation key which is used to allow the broadcaster of the commitment
15807 * transaction to provide their counterparty the ability to punish them if they broadcast
15810 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15813 * Broadcaster's HTLC Key
15815 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15818 * Broadcaster's HTLC Key
15820 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15823 * Countersignatory's HTLC Key
15825 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15828 * Countersignatory's HTLC Key
15830 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15833 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
15835 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15838 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
15840 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15843 * Constructs a new TxCreationKeys given each field
15845 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);
15848 * Creates a copy of the TxCreationKeys
15850 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
15853 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
15855 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
15858 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
15860 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
15863 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
15865 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
15868 * The public key which is used to sign all commitment transactions, as it appears in the
15869 * on-chain channel lock-in 2-of-2 multisig output.
15871 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
15874 * The public key which is used to sign all commitment transactions, as it appears in the
15875 * on-chain channel lock-in 2-of-2 multisig output.
15877 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15880 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
15881 * revocation keys. This is combined with the per-commitment-secret generated by the
15882 * counterparty to create a secret which the counterparty can reveal to revoke previous
15885 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
15888 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
15889 * revocation keys. This is combined with the per-commitment-secret generated by the
15890 * counterparty to create a secret which the counterparty can reveal to revoke previous
15893 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15896 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
15897 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
15898 * static across every commitment transaction.
15900 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
15903 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
15904 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
15905 * static across every commitment transaction.
15907 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15910 * The base point which is used (with derive_public_key) to derive a per-commitment payment
15911 * public key which receives non-HTLC-encumbered funds which are only available for spending
15912 * after some delay (or can be claimed via the revocation path).
15914 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
15917 * The base point which is used (with derive_public_key) to derive a per-commitment payment
15918 * public key which receives non-HTLC-encumbered funds which are only available for spending
15919 * after some delay (or can be claimed via the revocation path).
15921 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15924 * The base point which is used (with derive_public_key) to derive a per-commitment public key
15925 * which is used to encumber HTLC-in-flight outputs.
15927 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
15930 * The base point which is used (with derive_public_key) to derive a per-commitment public key
15931 * which is used to encumber HTLC-in-flight outputs.
15933 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15936 * Constructs a new ChannelPublicKeys given each field
15938 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);
15941 * Creates a copy of the ChannelPublicKeys
15943 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
15946 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
15948 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
15951 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
15953 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
15956 * Create per-state keys from channel base points and the per-commitment point.
15957 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
15959 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);
15962 * Generate per-state keys from channel static keys.
15963 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
15965 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);
15968 * A script either spendable by the revocation
15969 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
15970 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
15972 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
15975 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
15977 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
15980 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
15981 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
15982 * need to compare this value to whether the commitment transaction in question is that of
15983 * the counterparty or our own.
15985 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
15988 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
15989 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
15990 * need to compare this value to whether the commitment transaction in question is that of
15991 * the counterparty or our own.
15993 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
15996 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
15997 * this divided by 1000.
15999 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
16002 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
16003 * this divided by 1000.
16005 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
16008 * The CLTV lock-time at which this HTLC expires.
16010 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
16013 * The CLTV lock-time at which this HTLC expires.
16015 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
16018 * The hash of the preimage which unlocks this HTLC.
16020 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
16023 * The hash of the preimage which unlocks this HTLC.
16025 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16028 * The position within the commitment transactions' outputs. This may be None if the value is
16029 * below the dust limit (in which case no output appears in the commitment transaction and the
16030 * value is spent to additional transaction fees).
16032 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
16035 * The position within the commitment transactions' outputs. This may be None if the value is
16036 * below the dust limit (in which case no output appears in the commitment transaction and the
16037 * value is spent to additional transaction fees).
16039 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
16042 * Constructs a new HTLCOutputInCommitment given each field
16044 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);
16047 * Creates a copy of the HTLCOutputInCommitment
16049 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
16052 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
16054 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
16057 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
16059 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
16062 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
16063 * does not need to have its previous_output_index filled.
16065 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
16068 * Gets the redeemscript for a funding output from the two funding public keys.
16069 * Note that the order of funding public keys does not matter.
16071 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
16074 * panics if htlc.transaction_output_index.is_none()!
16076 struct LDKTransaction build_htlc_transaction(const uint8_t (*prev_hash)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
16079 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
16081 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
16084 * Holder public keys
16086 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16089 * Holder public keys
16091 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
16094 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
16096 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16099 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
16101 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
16104 * Whether the holder is the initiator of this channel.
16105 * This is an input to the commitment number obscure factor computation.
16107 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16110 * Whether the holder is the initiator of this channel.
16111 * This is an input to the commitment number obscure factor computation.
16113 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
16116 * The late-bound counterparty channel transaction parameters.
16117 * These parameters are populated at the point in the protocol where the counterparty provides them.
16119 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16122 * The late-bound counterparty channel transaction parameters.
16123 * These parameters are populated at the point in the protocol where the counterparty provides them.
16125 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
16128 * The late-bound funding outpoint
16130 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16133 * The late-bound funding outpoint
16135 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
16138 * Constructs a new ChannelTransactionParameters given each field
16140 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);
16143 * Creates a copy of the ChannelTransactionParameters
16145 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
16148 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
16150 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
16153 * Counter-party public keys
16155 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
16158 * Counter-party public keys
16160 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
16163 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
16165 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
16168 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
16170 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
16173 * Constructs a new CounterpartyChannelTransactionParameters given each field
16175 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
16178 * Creates a copy of the CounterpartyChannelTransactionParameters
16180 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
16183 * Whether the late bound parameters are populated.
16185 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
16188 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
16189 * given that the holder is the broadcaster.
16191 * self.is_populated() must be true before calling this function.
16193 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
16196 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
16197 * given that the counterparty is the broadcaster.
16199 * self.is_populated() must be true before calling this function.
16201 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
16204 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
16206 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
16209 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
16211 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
16214 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
16216 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
16219 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
16221 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
16224 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
16226 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
16229 * Get the channel pubkeys for the broadcaster
16231 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16234 * Get the channel pubkeys for the countersignatory
16236 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16239 * Get the contest delay applicable to the transactions.
16240 * Note that the contest delay was selected by the countersignatory.
16242 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16245 * Whether the channel is outbound from the broadcaster.
16247 * The boolean representing the side that initiated the channel is
16248 * an input to the commitment number obscure factor computation.
16250 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16253 * The funding outpoint
16255 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16258 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
16260 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
16263 * Our counterparty's signature for the transaction
16265 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
16268 * Our counterparty's signature for the transaction
16270 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
16273 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
16275 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
16278 * Creates a copy of the HolderCommitmentTransaction
16280 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
16283 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
16285 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
16288 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
16290 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
16293 * Create a new holder transaction with the given counterparty signatures.
16294 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
16296 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);
16299 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
16301 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
16304 * The commitment transaction
16306 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
16309 * The commitment transaction
16311 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
16314 * The txid for the commitment transaction.
16316 * This is provided as a performance optimization, instead of calling transaction.txid()
16319 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
16322 * The txid for the commitment transaction.
16324 * This is provided as a performance optimization, instead of calling transaction.txid()
16327 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16330 * Constructs a new BuiltCommitmentTransaction given each field
16332 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
16335 * Creates a copy of the BuiltCommitmentTransaction
16337 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
16340 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
16342 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
16345 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
16347 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
16350 * Get the SIGHASH_ALL sighash value of the transaction.
16352 * This can be used to verify a signature.
16354 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);
16357 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
16358 * because we are about to broadcast a holder transaction.
16360 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);
16363 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
16365 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
16368 * Creates a copy of the CommitmentTransaction
16370 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
16373 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
16375 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
16378 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
16380 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
16383 * The backwards-counting commitment number
16385 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16388 * The value to be sent to the broadcaster
16390 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16393 * The value to be sent to the counterparty
16395 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16398 * The feerate paid per 1000-weight-unit in this commitment transaction.
16400 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16403 * Trust our pre-built transaction and derived transaction creation public keys.
16405 * Applies a wrapper which allows access to these fields.
16407 * This should only be used if you fully trust the builder of this object. It should not
16408 *\tbe used by an external signer - instead use the verify function.
16410 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16413 * Verify our pre-built transaction and derived transaction creation public keys.
16415 * Applies a wrapper which allows access to these fields.
16417 * An external validating signer must call this method before signing
16418 * or using the built transaction.
16420 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);
16423 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
16425 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
16428 * The transaction ID of the built Bitcoin transaction
16430 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
16433 * The pre-built Bitcoin commitment transaction
16435 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
16438 * The pre-calculated transaction creation public keys.
16440 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
16443 * Get a signature for each HTLC which was included in the commitment transaction (ie for
16444 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
16446 * The returned Vec has one entry for each HTLC, and in the same order.
16448 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);
16451 * Get the transaction number obscure factor
16453 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
16456 * Checks if two InitFeaturess contain equal inner contents.
16457 * This ignores pointers and is_owned flags and looks at the values in fields.
16458 * Two objects with NULL inner values will be considered "equal" here.
16460 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
16463 * Checks if two NodeFeaturess contain equal inner contents.
16464 * This ignores pointers and is_owned flags and looks at the values in fields.
16465 * Two objects with NULL inner values will be considered "equal" here.
16467 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
16470 * Checks if two ChannelFeaturess contain equal inner contents.
16471 * This ignores pointers and is_owned flags and looks at the values in fields.
16472 * Two objects with NULL inner values will be considered "equal" here.
16474 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
16477 * Checks if two InvoiceFeaturess contain equal inner contents.
16478 * This ignores pointers and is_owned flags and looks at the values in fields.
16479 * Two objects with NULL inner values will be considered "equal" here.
16481 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
16484 * Creates a copy of the InitFeatures
16486 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
16489 * Creates a copy of the NodeFeatures
16491 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
16494 * Creates a copy of the ChannelFeatures
16496 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
16499 * Creates a copy of the InvoiceFeatures
16501 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
16504 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
16506 void InitFeatures_free(struct LDKInitFeatures this_obj);
16509 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
16511 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
16514 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
16516 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
16519 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
16521 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
16524 * Create a blank Features with no features set
16526 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
16529 * Creates a Features with the bits set which are known by the implementation
16531 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
16534 * Create a blank Features with no features set
16536 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
16539 * Creates a Features with the bits set which are known by the implementation
16541 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
16544 * Create a blank Features with no features set
16546 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
16549 * Creates a Features with the bits set which are known by the implementation
16551 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
16554 * Create a blank Features with no features set
16556 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
16559 * Creates a Features with the bits set which are known by the implementation
16561 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
16564 * Returns whether the `payment_secret` feature is supported.
16566 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
16569 * Returns whether the `payment_secret` feature is supported.
16571 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
16574 * Returns whether the `payment_secret` feature is supported.
16576 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
16579 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
16581 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
16584 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
16586 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
16589 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
16591 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
16594 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
16596 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
16599 * Read a InitFeatures from a byte array, created by InitFeatures_write
16601 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
16604 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
16606 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
16609 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
16611 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
16614 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
16616 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
16619 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
16621 void RouteHop_free(struct LDKRouteHop this_obj);
16624 * The node_id of the node at this hop.
16626 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16629 * The node_id of the node at this hop.
16631 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16634 * The node_announcement features of the node at this hop. For the last hop, these may be
16635 * amended to match the features present in the invoice this node generated.
16637 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16640 * The node_announcement features of the node at this hop. For the last hop, these may be
16641 * amended to match the features present in the invoice this node generated.
16643 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
16646 * The channel that should be used from the previous hop to reach this node.
16648 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16651 * The channel that should be used from the previous hop to reach this node.
16653 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
16656 * The channel_announcement features of the channel that should be used from the previous hop
16657 * to reach this node.
16659 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16662 * The channel_announcement features of the channel that should be used from the previous hop
16663 * to reach this node.
16665 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
16668 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
16669 * For the last hop, this should be the full value of the payment (might be more than
16670 * requested if we had to match htlc_minimum_msat).
16672 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16675 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
16676 * For the last hop, this should be the full value of the payment (might be more than
16677 * requested if we had to match htlc_minimum_msat).
16679 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
16682 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
16683 * expected at the destination, in excess of the current block height.
16685 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16688 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
16689 * expected at the destination, in excess of the current block height.
16691 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
16694 * Constructs a new RouteHop given each field
16696 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);
16699 * Creates a copy of the RouteHop
16701 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
16704 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
16706 void Route_free(struct LDKRoute this_obj);
16709 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
16710 * last RouteHop in each path must be the same.
16711 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
16712 * destination. Thus, this must always be at least length one. While the maximum length of any
16713 * given path is variable, keeping the length of any path to less than 20 should currently
16714 * ensure it is viable.
16716 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
16719 * Constructs a new Route given each field
16721 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
16724 * Creates a copy of the Route
16726 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
16729 * Serialize the Route object into a byte array which can be read by Route_read
16731 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
16734 * Read a Route from a byte array, created by Route_write
16736 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
16739 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
16741 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
16744 * The node_id of the non-target end of the route
16746 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16749 * The node_id of the non-target end of the route
16751 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16754 * The short_channel_id of this channel
16756 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16759 * The short_channel_id of this channel
16761 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
16764 * The fees which must be paid to use this channel
16766 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16769 * The fees which must be paid to use this channel
16771 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
16774 * The difference in CLTV values between this node and the next node.
16776 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16779 * The difference in CLTV values between this node and the next node.
16781 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
16784 * The minimum value, in msat, which must be relayed to the next hop.
16786 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16789 * The minimum value, in msat, which must be relayed to the next hop.
16791 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
16794 * The maximum value in msat available for routing with a single HTLC.
16796 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16799 * The maximum value in msat available for routing with a single HTLC.
16801 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
16804 * Constructs a new RouteHintHop given each field
16806 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);
16809 * Checks if two RouteHintHops contain equal inner contents.
16810 * This ignores pointers and is_owned flags and looks at the values in fields.
16811 * Two objects with NULL inner values will be considered "equal" here.
16813 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
16816 * Creates a copy of the RouteHintHop
16818 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
16821 * Gets a route from us (payer) to the given target node (payee).
16823 * If the payee provided features in their invoice, they should be provided via payee_features.
16824 * Without this, MPP will only be used if the payee's features are available in the network graph.
16826 * Extra routing hops between known nodes and the target will be used if they are included in
16829 * If some channels aren't announced, it may be useful to fill in a first_hops with the
16830 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
16831 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
16832 * in first_hops will be used.
16834 * Panics if first_hops contains channels without short_channel_ids
16835 * (ChannelManager::list_usable_channels will never include such channels).
16837 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
16838 * equal), however the enabled/disabled bit on such channels as well as the
16839 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
16841 struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintHopZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
16844 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
16846 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
16849 * Creates a copy of the NetworkGraph
16851 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
16854 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
16856 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
16859 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
16861 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
16864 * Creates a new tracker of the actual state of the network of channels and nodes,
16865 * assuming a fresh network graph.
16866 * Chain monitor is used to make sure announced channels exist on-chain,
16867 * channel data is correct, and that the announcement is signed with
16868 * channel owners' keys.
16870 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
16873 * Creates a new tracker of the actual state of the network of channels and nodes,
16874 * assuming an existing Network Graph.
16876 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
16879 * Adds a provider used to check new announcements. Does not affect
16880 * existing announcements unless they are updated.
16881 * Add, update or remove the provider would replace the current one.
16883 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
16886 * Take a read lock on the network_graph and return it in the C-bindings
16887 * newtype helper. This is likely only useful when called via the C
16888 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
16891 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
16894 * Get a reference to the NetworkGraph which this read-lock contains.
16896 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
16899 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
16900 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
16902 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
16905 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
16906 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
16908 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
16911 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
16913 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
16916 * When the last update to the channel direction was issued.
16917 * Value is opaque, as set in the announcement.
16919 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16922 * When the last update to the channel direction was issued.
16923 * Value is opaque, as set in the announcement.
16925 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
16928 * Whether the channel can be currently used for payments (in this one direction).
16930 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16933 * Whether the channel can be currently used for payments (in this one direction).
16935 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
16938 * The difference in CLTV values that you must have when routing through this channel.
16940 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16943 * The difference in CLTV values that you must have when routing through this channel.
16945 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
16948 * The minimum value, which must be relayed to the next hop via the channel
16950 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16953 * The minimum value, which must be relayed to the next hop via the channel
16955 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
16958 * The maximum value which may be relayed to the next hop via the channel.
16960 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16963 * The maximum value which may be relayed to the next hop via the channel.
16965 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
16968 * Fees charged when the channel is used for routing
16970 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16973 * Fees charged when the channel is used for routing
16975 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
16978 * Most recent update for the channel received from the network
16979 * Mostly redundant with the data we store in fields explicitly.
16980 * Everything else is useful only for sending out for initial routing sync.
16981 * Not stored if contains excess data to prevent DoS.
16983 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16986 * Most recent update for the channel received from the network
16987 * Mostly redundant with the data we store in fields explicitly.
16988 * Everything else is useful only for sending out for initial routing sync.
16989 * Not stored if contains excess data to prevent DoS.
16991 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
16994 * Constructs a new DirectionalChannelInfo given each field
16996 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);
16999 * Creates a copy of the DirectionalChannelInfo
17001 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
17004 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
17006 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
17009 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
17011 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
17014 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
17016 void ChannelInfo_free(struct LDKChannelInfo this_obj);
17019 * Protocol features of a channel communicated during its announcement
17021 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17024 * Protocol features of a channel communicated during its announcement
17026 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
17029 * Source node of the first direction of a channel
17031 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17034 * Source node of the first direction of a channel
17036 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17039 * Details about the first direction of a channel
17041 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17044 * Details about the first direction of a channel
17046 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
17049 * Source node of the second direction of a channel
17051 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17054 * Source node of the second direction of a channel
17056 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17059 * Details about the second direction of a channel
17061 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17064 * Details about the second direction of a channel
17066 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
17069 * The channel capacity as seen on-chain, if chain lookup is available.
17071 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17074 * The channel capacity as seen on-chain, if chain lookup is available.
17076 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
17079 * An initial announcement of the channel
17080 * Mostly redundant with the data we store in fields explicitly.
17081 * Everything else is useful only for sending out for initial routing sync.
17082 * Not stored if contains excess data to prevent DoS.
17084 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17087 * An initial announcement of the channel
17088 * Mostly redundant with the data we store in fields explicitly.
17089 * Everything else is useful only for sending out for initial routing sync.
17090 * Not stored if contains excess data to prevent DoS.
17092 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
17095 * Constructs a new ChannelInfo given each field
17097 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);
17100 * Creates a copy of the ChannelInfo
17102 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
17105 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
17107 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
17110 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
17112 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
17115 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
17117 void RoutingFees_free(struct LDKRoutingFees this_obj);
17120 * Flat routing fee in satoshis
17122 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
17125 * Flat routing fee in satoshis
17127 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
17130 * Liquidity-based routing fee in millionths of a routed amount.
17131 * In other words, 10000 is 1%.
17133 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
17136 * Liquidity-based routing fee in millionths of a routed amount.
17137 * In other words, 10000 is 1%.
17139 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
17142 * Constructs a new RoutingFees given each field
17144 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
17147 * Checks if two RoutingFeess contain equal inner contents.
17148 * This ignores pointers and is_owned flags and looks at the values in fields.
17149 * Two objects with NULL inner values will be considered "equal" here.
17151 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
17154 * Creates a copy of the RoutingFees
17156 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
17159 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
17161 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
17164 * Read a RoutingFees from a byte array, created by RoutingFees_write
17166 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
17169 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
17171 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
17174 * Protocol features the node announced support for
17176 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
17179 * Protocol features the node announced support for
17181 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
17184 * When the last known update to the node state was issued.
17185 * Value is opaque, as set in the announcement.
17187 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
17190 * When the last known update to the node state was issued.
17191 * Value is opaque, as set in the announcement.
17193 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
17196 * Color assigned to the node
17198 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
17201 * Color assigned to the node
17203 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
17206 * Moniker assigned to the node.
17207 * May be invalid or malicious (eg control chars),
17208 * should not be exposed to the user.
17210 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
17213 * Moniker assigned to the node.
17214 * May be invalid or malicious (eg control chars),
17215 * should not be exposed to the user.
17217 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
17220 * Internet-level addresses via which one can connect to the node
17222 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
17225 * An initial announcement of the node
17226 * Mostly redundant with the data we store in fields explicitly.
17227 * Everything else is useful only for sending out for initial routing sync.
17228 * Not stored if contains excess data to prevent DoS.
17230 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
17233 * An initial announcement of the node
17234 * Mostly redundant with the data we store in fields explicitly.
17235 * Everything else is useful only for sending out for initial routing sync.
17236 * Not stored if contains excess data to prevent DoS.
17238 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
17241 * Constructs a new NodeAnnouncementInfo given each field
17243 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);
17246 * Creates a copy of the NodeAnnouncementInfo
17248 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
17251 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
17253 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
17256 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
17258 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
17261 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
17263 void NodeInfo_free(struct LDKNodeInfo this_obj);
17266 * All valid channels a node has announced
17268 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
17271 * Lowest fees enabling routing via any of the enabled, known channels to a node.
17272 * The two fields (flat and proportional fee) are independent,
17273 * meaning they don't have to refer to the same channel.
17275 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
17278 * Lowest fees enabling routing via any of the enabled, known channels to a node.
17279 * The two fields (flat and proportional fee) are independent,
17280 * meaning they don't have to refer to the same channel.
17282 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
17285 * More information about a node from node_announcement.
17286 * Optional because we store a Node entry after learning about it from
17287 * a channel announcement, but before receiving a node announcement.
17289 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
17292 * More information about a node from node_announcement.
17293 * Optional because we store a Node entry after learning about it from
17294 * a channel announcement, but before receiving a node announcement.
17296 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
17299 * Constructs a new NodeInfo given each field
17301 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
17304 * Creates a copy of the NodeInfo
17306 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
17309 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
17311 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
17314 * Read a NodeInfo from a byte array, created by NodeInfo_write
17316 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
17319 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
17321 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
17324 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
17326 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
17329 * Creates a new, empty, network graph.
17331 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
17334 * For an already known node (from channel announcements), update its stored properties from a
17335 * given node announcement.
17337 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
17338 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
17339 * routing messages from a source using a protocol other than the lightning P2P protocol.
17341 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
17344 * For an already known node (from channel announcements), update its stored properties from a
17345 * given node announcement without verifying the associated signatures. Because we aren't
17346 * given the associated signatures here we cannot relay the node announcement to any of our
17349 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
17352 * Store or update channel info from a channel announcement.
17354 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
17355 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
17356 * routing messages from a source using a protocol other than the lightning P2P protocol.
17358 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
17359 * the corresponding UTXO exists on chain and is correctly-formatted.
17361 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);
17364 * Store or update channel info from a channel announcement without verifying the associated
17365 * signatures. Because we aren't given the associated signatures here we cannot relay the
17366 * channel announcement to any of our peers.
17368 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
17369 * the corresponding UTXO exists on chain and is correctly-formatted.
17371 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);
17374 * Close a channel if a corresponding HTLC fail was sent.
17375 * If permanent, removes a channel from the local storage.
17376 * May cause the removal of nodes too, if this was their last channel.
17377 * If not permanent, makes channels unavailable for routing.
17379 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
17382 * For an already known (from announcement) channel, update info about one of the directions
17385 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
17386 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
17387 * routing messages from a source using a protocol other than the lightning P2P protocol.
17389 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
17392 * For an already known (from announcement) channel, update info about one of the directions
17393 * of the channel without verifying the associated signatures. Because we aren't given the
17394 * associated signatures here we cannot relay the channel update to any of our peers.
17396 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
17399 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
17401 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
17404 * Initialize a new FilesystemPersister and set the path to the individual channels'
17407 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
17410 * Get the directory which was provided when this persister was initialized.
17412 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
17415 * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
17416 * initialization, within a file called \"manager\".
17418 MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKStr data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
17421 * Read `ChannelMonitor`s from disk.
17423 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
17426 * Constructs a new Persist which calls the relevant methods on this_arg.
17427 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
17429 struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
17432 * **Call this function on startup to ensure that all assumptions about the platform are valid.**
17434 * Unfortunately we have to make assumptions about the upper bounds of the `SystemTime` type on
17435 * your platform which we can't fully verify at compile time and which isn't part of it's contract.
17436 * To our best knowledge our assumptions hold for all platforms officially supported by rust, but
17437 * since this check is fast we recommend to do it anyway.
17439 * If this function fails this is considered a bug. Please open an issue describing your
17440 * platform and stating your current system time.
17443 * If the check fails this function panics. By calling this function on startup you ensure that
17444 * this wont happen at an arbitrary later point in time.
17446 void check_platform(void);
17449 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
17451 void Invoice_free(struct LDKInvoice this_obj);
17454 * Checks if two Invoices contain equal inner contents.
17455 * This ignores pointers and is_owned flags and looks at the values in fields.
17456 * Two objects with NULL inner values will be considered "equal" here.
17458 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
17461 * Creates a copy of the Invoice
17463 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
17466 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
17468 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
17471 * Checks if two SignedRawInvoices contain equal inner contents.
17472 * This ignores pointers and is_owned flags and looks at the values in fields.
17473 * Two objects with NULL inner values will be considered "equal" here.
17475 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
17478 * Creates a copy of the SignedRawInvoice
17480 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
17483 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
17485 void RawInvoice_free(struct LDKRawInvoice this_obj);
17490 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
17495 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
17498 * Checks if two RawInvoices contain equal inner contents.
17499 * This ignores pointers and is_owned flags and looks at the values in fields.
17500 * Two objects with NULL inner values will be considered "equal" here.
17502 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
17505 * Creates a copy of the RawInvoice
17507 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
17510 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
17512 void RawDataPart_free(struct LDKRawDataPart this_obj);
17515 * generation time of the invoice
17517 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
17520 * generation time of the invoice
17522 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
17525 * Checks if two RawDataParts contain equal inner contents.
17526 * This ignores pointers and is_owned flags and looks at the values in fields.
17527 * Two objects with NULL inner values will be considered "equal" here.
17529 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
17532 * Creates a copy of the RawDataPart
17534 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
17537 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
17539 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
17542 * Checks if two PositiveTimestamps 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 PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
17549 * Creates a copy of the PositiveTimestamp
17551 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
17554 * Creates a copy of the SiPrefix
17556 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
17559 * Checks if two SiPrefixs contain equal inner contents.
17560 * This ignores pointers and is_owned flags and looks at the values in fields.
17562 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
17565 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
17566 * This is effectively 10^12 * the prefix multiplier
17568 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
17571 * Creates a copy of the Currency
17573 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
17576 * Checks if two Currencys contain equal inner contents.
17577 * This ignores pointers and is_owned flags and looks at the values in fields.
17579 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
17582 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
17584 void Sha256_free(struct LDKSha256 this_obj);
17587 * Checks if two Sha256s contain equal inner contents.
17588 * This ignores pointers and is_owned flags and looks at the values in fields.
17589 * Two objects with NULL inner values will be considered "equal" here.
17591 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
17594 * Creates a copy of the Sha256
17596 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
17599 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
17601 void Description_free(struct LDKDescription this_obj);
17604 * Checks if two Descriptions contain equal inner contents.
17605 * This ignores pointers and is_owned flags and looks at the values in fields.
17606 * Two objects with NULL inner values will be considered "equal" here.
17608 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
17611 * Creates a copy of the Description
17613 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
17616 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
17618 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
17621 * Checks if two PayeePubKeys contain equal inner contents.
17622 * This ignores pointers and is_owned flags and looks at the values in fields.
17623 * Two objects with NULL inner values will be considered "equal" here.
17625 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
17628 * Creates a copy of the PayeePubKey
17630 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
17633 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
17635 void ExpiryTime_free(struct LDKExpiryTime this_obj);
17638 * Checks if two ExpiryTimes contain equal inner contents.
17639 * This ignores pointers and is_owned flags and looks at the values in fields.
17640 * Two objects with NULL inner values will be considered "equal" here.
17642 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
17645 * Creates a copy of the ExpiryTime
17647 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
17650 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
17652 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
17655 * Checks if two MinFinalCltvExpirys contain equal inner contents.
17656 * This ignores pointers and is_owned flags and looks at the values in fields.
17657 * Two objects with NULL inner values will be considered "equal" here.
17659 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
17662 * Creates a copy of the MinFinalCltvExpiry
17664 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
17667 * Frees any resources used by the Fallback
17669 void Fallback_free(struct LDKFallback this_ptr);
17672 * Creates a copy of the Fallback
17674 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
17677 * Checks if two Fallbacks contain equal inner contents.
17678 * This ignores pointers and is_owned flags and looks at the values in fields.
17680 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
17683 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
17685 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
17688 * Checks if two InvoiceSignatures contain equal inner contents.
17689 * This ignores pointers and is_owned flags and looks at the values in fields.
17690 * Two objects with NULL inner values will be considered "equal" here.
17692 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
17695 * Creates a copy of the InvoiceSignature
17697 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
17700 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
17702 void RouteHint_free(struct LDKRouteHint this_obj);
17705 * Checks if two RouteHints contain equal inner contents.
17706 * This ignores pointers and is_owned flags and looks at the values in fields.
17707 * Two objects with NULL inner values will be considered "equal" here.
17709 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
17712 * Creates a copy of the RouteHint
17714 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
17717 * Disassembles the `SignedRawInvoice` into its three parts:
17719 * 2. hash of the raw invoice
17722 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
17725 * The `RawInvoice` which was signed.
17727 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17730 * The hash of the `RawInvoice` that was signed.
17732 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
17735 * InvoiceSignature for the invoice.
17737 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17740 * Recovers the public key used for signing the invoice from the recoverable signature.
17742 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17745 * Checks if the signature is valid for the included payee public key or if none exists if it's
17746 * valid for the recovered signature (which should always be true?).
17748 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17751 * Calculate the hash of the encoded `RawInvoice`
17753 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17755 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17757 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17759 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17761 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17763 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17765 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17767 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17769 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17771 MUST_USE_RES struct LDKCVec_RouteHintZ RawInvoice_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17773 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17775 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17778 * Create a new `PositiveTimestamp` from a unix timestamp in the Range
17779 * `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
17780 * `CreationError::TimestampOutOfBounds`.
17782 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
17785 * Create a new `PositiveTimestamp` from a `SystemTime` with a corresponding unix timestamp in
17786 * the Range `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
17787 * `CreationError::TimestampOutOfBounds`.
17789 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
17792 * Returns the UNIX timestamp representing the stored time
17794 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
17797 * Returns a reference to the internal `SystemTime` time representation
17799 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
17802 * Transform the `Invoice` into it's unchecked version
17804 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
17807 * Check that the invoice is signed correctly and that key recovery works
17809 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
17812 * Constructs an `Invoice` from a `SignedInvoice` by checking all its invariants.
17814 * use lightning_invoice::*;
17816 * let invoice = \"lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdp\\
17817 * \tl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d7\\
17818 * \t3gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ec\\
17819 * \tky03ylcqca784w\";
17821 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
17823 * assert!(Invoice::from_signed(signed).is_ok());
17826 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
17829 * Returns the `Invoice`'s timestamp (should equal it's creation time)
17831 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
17834 * Returns the hash to which we will receive the preimage on completion of the payment
17836 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
17839 * Get the payee's public key if one was included in the invoice
17841 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
17844 * Get the payment secret if one was included in the invoice
17846 MUST_USE_RES struct LDKThirtyTwoBytes Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg);
17849 * Get the invoice features if they were included in the invoice
17851 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
17854 * Recover the payee's public key (only to be used if none was included in the invoice)
17856 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
17859 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
17861 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
17864 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
17865 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
17867 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
17870 * Returns a list of all routes included in the invoice
17872 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
17875 * Returns the currency for which the invoice was issued
17877 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
17880 * Returns the amount if specified in the invoice as pico <currency>.
17882 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_pico_btc(const struct LDKInvoice *NONNULL_PTR this_arg);
17885 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
17886 * returns `CreationError::DescriptionTooLong` otherwise
17888 * Please note that single characters may use more than one byte due to UTF8 encoding.
17890 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
17893 * Returns the underlying description `String`
17895 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
17898 * Construct an `ExpiryTime` from seconds. If there exists a `PositiveTimestamp` which would
17899 * overflow on adding the `EpiryTime` to it then this function will return a
17900 * `CreationError::ExpiryTimeOutOfBounds`.
17902 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_seconds(uint64_t seconds);
17905 * Construct an `ExpiryTime` from a `Duration`. If there exists a `PositiveTimestamp` which
17906 * would overflow on adding the `EpiryTime` to it then this function will return a
17907 * `CreationError::ExpiryTimeOutOfBounds`.
17909 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_duration(uint64_t duration);
17912 * Returns the expiry time in seconds
17914 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
17917 * Returns a reference to the underlying `Duration` (=expiry time)
17919 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
17922 * Create a new (partial) route from a list of hops
17924 MUST_USE_RES struct LDKCResult_RouteHintCreationErrorZ RouteHint_new(struct LDKCVec_RouteHintHopZ hops);
17927 * Returrn the underlying vector of hops
17929 MUST_USE_RES struct LDKCVec_RouteHintHopZ RouteHint_into_inner(struct LDKRouteHint this_arg);
17932 * Creates a copy of the CreationError
17934 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
17937 * Checks if two CreationErrors contain equal inner contents.
17938 * This ignores pointers and is_owned flags and looks at the values in fields.
17940 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
17943 * Get the string representation of a CreationError object
17945 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
17948 * Creates a copy of the SemanticError
17950 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
17953 * Checks if two SemanticErrors contain equal inner contents.
17954 * This ignores pointers and is_owned flags and looks at the values in fields.
17956 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
17959 * Get the string representation of a SemanticError object
17961 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
17964 * Frees any resources used by the SignOrCreationError
17966 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
17969 * Creates a copy of the SignOrCreationError
17971 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
17974 * Checks if two SignOrCreationErrors contain equal inner contents.
17975 * This ignores pointers and is_owned flags and looks at the values in fields.
17977 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
17980 * Get the string representation of a SignOrCreationError object
17982 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
17985 * Utility to construct an invoice. Generally, unless you want to do something like a custom
17986 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
17987 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
17988 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
17989 * that the payment secret is valid when the invoice is paid.
17991 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);
17994 * Read a SiPrefix object from a string
17996 struct LDKCResult_SiPrefixNoneZ SiPrefix_from_str(struct LDKStr s);
17999 * Read a Invoice object from a string
18001 struct LDKCResult_InvoiceNoneZ Invoice_from_str(struct LDKStr s);
18004 * Read a SignedRawInvoice object from a string
18006 struct LDKCResult_SignedRawInvoiceNoneZ SignedRawInvoice_from_str(struct LDKStr s);
18009 * Get the string representation of a Invoice object
18011 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
18014 * Get the string representation of a SignedRawInvoice object
18016 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
18019 * Get the string representation of a Currency object
18021 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
18024 * Get the string representation of a SiPrefix object
18026 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
18028 #endif /* LDK_C_BINDINGS_H */
18030 #include <ldk_ver.h>